[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 42f061a 17/62: Improve style/amsthm.el
From: |
Tassilo Horn |
Subject: |
[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 <arash@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>
Improve style/amsthm.el
* style/amsthm.el (LaTeX-amsthm-theoremstyle-list): Delete
variable.
(LaTeX-arg-amsthm-fontdecl): Adjust `prompt' in
`TeX-argument-prompt' and don't use the 5. argument of
`TeX-completing-read-multiple'.
(LaTeX-amsthm-auto-cleanup): Remove the part for the deleted
`LaTeX-amsthm-theoremstyle-list'.
("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-completing-read-multiple
- (TeX-argument-prompt optional prompt "Font")
- LaTeX-amsthm-fontdecl nil nil TeX-esc)
+ (TeX-argument-prompt optional prompt "Font: \\"
t)
+ LaTeX-amsthm-fontdecl)
TeX-esc)))
(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
-\"\\newtheoremstyle\"."
- (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
(TeX-add-style-hook
"amsthm"
(lambda ()
+ ;; Add the pre-defined styles:
+ (LaTeX-add-amsthm-newtheoremstyles "definition"
+ "plain"
+ "remark")
+
(LaTeX-add-environments
'("proof" LaTeX-amsthm-env-label))
+
(TeX-add-symbols
;; Overrule the defintion in `latex.el':
'("newtheorem"
@@ -163,8 +159,10 @@ make them available as new environments. Update
(format "%s" heading)))))
'("theoremstyle"
- (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)))
"qedhere"
"swapnumbers"
@@ -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"))
- [elpa] externals/auctex 19cdfe0 22/62: Put point after the graphic file argrument, (continued)
- [elpa] externals/auctex 19cdfe0 22/62: Put point after the graphic file argrument, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex f7c0c73 01/62: Enable lexical-binding for AUCTeX core files, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 8951549 04/62: ; Trivial cleanups, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 96c945a 11/62: Remove `TeX-arg-none', Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 9656d30 21/62: Fix insertion of unnecessary backslash, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex b42e932 23/62: ; * style/graphicx.el: Fix Ataka-san's name and email., Tassilo Horn, 2020/12/20
- [elpa] externals/auctex f9387c6 27/62: ; use with-no-warnings instead of with-suppressed-warnings for compat, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 384c1d2 08/62: Use declared dynamic variable in tex-jp, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 717e5f0 06/62: Simplify nested `let's, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex ced4b1a 10/62: Adapt styles to lexical-binding, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 42f061a 17/62: Improve style/amsthm.el,
Tassilo Horn <=
- [elpa] externals/auctex 08d01c1 19/62: ; * style/changelog.el: Silence the compiler for `reftex-label-alist'., Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 4c1430a 20/62: Add new style/appendix.el, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 5bffc24 24/62: ; * font-latex.el (font-latex-update-math-env): Fix docstring., Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 072cfc7 28/62: ; Convert suffix to pattern rule, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex a9c37b7 29/62: ; Add new make target dynvars-check, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 3fa1baa 32/62: ; Improve dynvars check, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex f1f71c2 36/62: ; Fix byte-compiler warnings in styles, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 70dc031 38/62: ; Fix more byte-compiler warnings in styles, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex fc037de 44/62: ; Fix byte-compiler warnings in styles, Tassilo Horn, 2020/12/20
- [elpa] externals/auctex 471748b 46/62: ; Fix byte-compiler warnings in styles, Tassilo Horn, 2020/12/20