emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex 9656d30 21/62: Fix insertion of unnecessary back


From: Tassilo Horn
Subject: [elpa] externals/auctex 9656d30 21/62: Fix insertion of unnecessary backslash
Date: Sun, 20 Dec 2020 10:39:55 -0500 (EST)

branch: externals/auctex
commit 9656d30f93fa4cfb2a9e4740d31f611f2b0f167c
Author: Arash Esbati <arash@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Fix insertion of unnecessary backslash
    
    * style/amsthm.el (LaTeX-arg-amsthm-fontdecl):
    * style/ntheorem.el (LaTeX-arg-ntheorem-fontdecl): Don't insert a
    backslash if the query for font declaration is left empty.
---
 style/amsthm.el   |  8 ++++----
 style/ntheorem.el | 15 ++++++++-------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/style/amsthm.el b/style/amsthm.el
index 569cef9..f7cc6bb 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -58,15 +58,16 @@
   "Prompt for font declaration commands in \"\\newtheoremstyle\".
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument.  Use PROMPT as the prompt string."
-  ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
-  ;; is hard-coded to `TeX-esc'.
   (let* ((crm-separator (regexp-quote TeX-esc))
         (fontdecl (mapconcat #'identity
                              (TeX-completing-read-multiple
                               (TeX-argument-prompt optional prompt "Font: \\" 
t)
                               LaTeX-amsthm-fontdecl)
                              TeX-esc)))
-    (TeX-argument-insert fontdecl optional)))
+    (TeX-argument-insert fontdecl
+                        optional
+                        (when (and fontdecl (not (string= fontdecl "")))
+                          TeX-esc))))
 
 (defun LaTeX-amsthm-env-label (environment)
   "Insert ENVIRONMENT, query for an optional argument and prompt
@@ -161,7 +162,6 @@ make them available as new environments."
     '("theoremstyle"
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt nil nil "Style")
-                   ;; LaTeX-amsthm-theoremstyle-list
                    (LaTeX-amsthm-newtheoremstyle-list)))
     "qedhere"
     "swapnumbers"
diff --git a/style/ntheorem.el b/style/ntheorem.el
index 03bdf4f..4886442 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -77,18 +77,19 @@ defined with \"\\newtheoremlisttype\".")
   "List of font declaration commands for \"\\newtheoremstyle\".")
 
 (defun LaTeX-arg-ntheorem-fontdecl (optional &optional prompt)
-  "Prompt for font declaration commands in \"\\theorem(body\|header)font\".
+  "Prompt for font declaration commands in \"\\theorem(body|header)font\".
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument.  Use PROMPT as the prompt string."
-  ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
-  ;; is hard-coded to `TeX-esc'.
   (let* ((crm-separator (regexp-quote TeX-esc))
-        (fontdecl (mapconcat 'identity
+        (fontdecl (mapconcat #'identity
                              (TeX-completing-read-multiple
-                              (TeX-argument-prompt optional prompt "Font 
declaration")
-                              LaTeX-ntheorem-fontdecl nil nil TeX-esc)
+                              (TeX-argument-prompt optional prompt "Font 
declaration: \\" t)
+                              LaTeX-ntheorem-fontdecl)
                              TeX-esc)))
-    (TeX-argument-insert fontdecl optional)))
+    (TeX-argument-insert fontdecl
+                        optional
+                        (when (and fontdecl (not (string= fontdecl "")))
+                          TeX-esc))))
 
 (defun LaTeX-ntheorem-env-label (environment)
   "Insert ENVIRONMENT, query for an optional argument and prompt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]