[Top][All Lists]

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

[AUCTeX-diffs] [elpa] externals/auctex 42f061a 17/62: Improve style/amst

From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 42f061a 17/62: Improve style/amsthm.el
Date: Sun, 20 Dec 2020 10:39:54 -0500 (EST)

branch: externals/auctex
commit 42f061a05fd2de0f28de50728f9caecd0eccd128
Author: Arash Esbati <>
Commit: Tassilo Horn <>

    Improve style/amsthm.el
    * style/amsthm.el (LaTeX-amsthm-theoremstyle-list): Delete
    (LaTeX-arg-amsthm-fontdecl): Adjust `prompt' in
    `TeX-argument-prompt' and don't use the 5. argument of
    (LaTeX-amsthm-auto-cleanup): Remove the part for the deleted
    ("amsthm"): Use `LaTeX-add-amsthm-newtheoremstyles' for
    predefined styles.
    Adjust the hook for deleted variable.
 style/amsthm.el | 40 ++++++++++++++++++----------------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/style/amsthm.el b/style/amsthm.el
index b99fda8..569cef9 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -39,11 +39,6 @@
 (defvar LaTeX-amsthm-package-options nil
   "Package options for the amsthm package.")
-(defvar LaTeX-amsthm-theoremstyle-list
-  '(("plain") ("definition") ("remark"))
-  "List of theorem styles provided by `amsthm.el' and new ones
-defined with \"\\newtheoremstyle\".")
 (defvar LaTeX-amsthm-fontdecl
   '(;; family
     "rmfamily" "sffamily" "ttfamily"
@@ -66,10 +61,10 @@ 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-argument-prompt optional prompt "Font")
-                              LaTeX-amsthm-fontdecl nil nil TeX-esc)
+                              (TeX-argument-prompt optional prompt "Font: \\" 
+                              LaTeX-amsthm-fontdecl)
     (TeX-argument-insert fontdecl optional)))
@@ -114,14 +109,9 @@ RefTeX users should customize or add ENVIRONMENT to
 (defun LaTeX-amsthm-auto-cleanup ()
   "Move parsed results from `LaTeX-auto-amsthm-newtheorem' and
-make them available as new environments.  Update
-`LaTeX-amsthm-theoremstyle-list' with styles defined with
-  (dolist (newthm (mapcar 'car (LaTeX-amsthm-newtheorem-list)))
-    (LaTeX-add-environments (list newthm 'LaTeX-amsthm-env-label)))
-  (dolist (newthmstyle (LaTeX-amsthm-newtheoremstyle-list))
-    (add-to-list (make-local-variable 'LaTeX-amsthm-theoremstyle-list)
-                newthmstyle)))
+make them available as new environments."
+  (dolist (newthm (mapcar #'car (LaTeX-amsthm-newtheorem-list)))
+    (LaTeX-add-environments (list newthm 'LaTeX-amsthm-env-label))))
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-amsthm-auto-prepare t)
 (add-hook 'TeX-auto-cleanup-hook #'LaTeX-amsthm-auto-cleanup t)
@@ -130,8 +120,14 @@ make them available as new environments.  Update
  (lambda ()
+   ;; Add the pre-defined styles:
+   (LaTeX-add-amsthm-newtheoremstyles "definition"
+                                     "plain"
+                                     "remark")
     '("proof" LaTeX-amsthm-env-label))
     ;; Overrule the defintion in `latex.el':
@@ -163,8 +159,10 @@ make them available as new environments.  Update
           (format "%s" heading)))))
-      (TeX-arg-eval completing-read "Style: "
-                   LaTeX-amsthm-theoremstyle-list))
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt nil nil "Style")
+                   ;; LaTeX-amsthm-theoremstyle-list
+                   (LaTeX-amsthm-newtheoremstyle-list)))
@@ -174,14 +172,12 @@ make them available as new environments.  Update
         (let ((nthmstyle (TeX-read-string
                           (TeX-argument-prompt nil nil "Style name"))))
           (LaTeX-add-amsthm-newtheoremstyles nthmstyle)
-          (add-to-list (make-local-variable 'LaTeX-amsthm-theoremstyle-list)
-                       (list nthmstyle))
           (format "%s" nthmstyle))))
       (TeX-arg-length "Space above")
       (TeX-arg-length "Space below")
-      (LaTeX-arg-amsthm-fontdecl "Body font")
+      (LaTeX-arg-amsthm-fontdecl "Body font: \\")
       "Indent amount"
-      (LaTeX-arg-amsthm-fontdecl "Theorem head font")
+      (LaTeX-arg-amsthm-fontdecl "Theorem head font: \\")
       "Punctuation after head"
       (TeX-arg-length "Space after head")
       "Theorem head spec"))

reply via email to

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