[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex fded69c292 59/60: Let \Describe<f
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex fded69c292 59/60: Let \Describe<foo> macros stay on their own lines |
Date: |
Fri, 8 Apr 2022 11:52:57 -0400 (EDT) |
branch: externals/auctex
commit fded69c292b46d924d66e1ba7d5a89e2e74fd220
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Let \Describe<foo> macros stay on their own lines
* style/doc.el (LaTeX-doc-auto-cleanup): Run
`LaTeX-paragraph-commands-add-locally' on 'Describe<parsed>'
macros.
("doc"): Run `LaTeX-paragraph-commands-add-locally' on
'DescribeEnv' and 'DescribeMacro'.
---
style/doc.el | 81 +++++++++++++++++++++++++++++++++---------------------------
1 file changed, 45 insertions(+), 36 deletions(-)
diff --git a/style/doc.el b/style/doc.el
index 322f91ba78..63c6580c07 100644
--- a/style/doc.el
+++ b/style/doc.el
@@ -185,41 +185,48 @@ percent sign at the beginning of a line before
;; 2. \begin{<env-name>}[<options>]{<element>}
;; 3. \PrintDescribe<element-name>{<element>}
;; 4. \Print<element-name>Name
- (dolist (elt (LaTeX-doc-NewDocElement-list))
- (let ((eltname (car elt))
- (envname (cadr elt)))
- (TeX-add-symbols
- ;; Cater for \Describe<eltname>[options]{<elements query>}
- `(,(concat "Describe" eltname)
- [TeX-arg-eval completing-read
- (TeX-argument-prompt t nil "Suppress option")
- '("noindex" "noprint")]
- "Element")
-
- ;; Cater for \PrintDescribe<eltname>{<elements query>}
- `(,(concat "PrintDescribe" eltname) "Element")
-
- ;; Cater for \Print<eltname>Name
- (concat "Print" eltname "Name"))
-
- ;; Cater for \begin{<envname>}[options]{<elements query>}
- (LaTeX-add-environments
- `(,envname LaTeX-env-doc-commented))
-
- ;; Make sure we have fixed inner indent for our environments:
- (add-to-list 'docTeX-indent-inner-fixed
- `(,(concat (regexp-quote TeX-esc)
- "\\(begin\\|end\\)[ \t]*"
- (regexp-quote TeX-grop)
- envname
- (regexp-quote TeX-grcl))
- 0 nil)
- t)
- ;; Add fontification:
- (when (and (featurep 'font-latex)
- (eq TeX-install-font-lock 'font-latex-setup))
- (font-latex-add-keywords `((,(concat "Describe" eltname) "[|{\\" ))
- 'variable))))))
+ (let (macs)
+ (dolist (elt (LaTeX-doc-NewDocElement-list))
+ (let ((eltname (car elt))
+ (envname (cadr elt)))
+ (TeX-add-symbols
+ ;; Cater for \Describe<eltname>[options]{<elements query>}
+ `(,(concat "Describe" eltname)
+ [TeX-arg-eval completing-read
+ (TeX-argument-prompt t nil "Suppress option")
+ '("noindex" "noprint")]
+ "Element")
+
+ ;; Cater for \PrintDescribe<eltname>{<elements query>}
+ `(,(concat "PrintDescribe" eltname) "Element")
+
+ ;; Cater for \Print<eltname>Name
+ (concat "Print" eltname "Name"))
+
+ ;; Add the \Describe<element-name> to macs
+ (push (concat "Describe" eltname) macs)
+
+ ;; Cater for \begin{<envname>}[options]{<elements query>}
+ (LaTeX-add-environments
+ `(,envname LaTeX-env-doc-commented))
+
+ ;; Make sure we have fixed inner indent for our environments:
+ (add-to-list 'docTeX-indent-inner-fixed
+ `(,(concat (regexp-quote TeX-esc)
+ "\\(begin\\|end\\)[ \t]*"
+ (regexp-quote TeX-grop)
+ envname
+ (regexp-quote TeX-grcl))
+ 0 nil)
+ t)
+ ;; Add fontification:
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,(concat "Describe" eltname) "[|{\\" ))
+ 'variable))))
+
+ ;; Let \Describe<element-name> stay in their own lines:
+ (LaTeX-paragraph-commands-add-locally macs))))
(add-hook 'TeX-auto-prepare-hook #'LaTeX-doc-auto-prepare t)
(add-hook 'TeX-auto-cleanup-hook #'LaTeX-doc-auto-cleanup t)
@@ -402,7 +409,9 @@ percent sign at the beginning of a line before
(LaTeX-add-counters "IndexColumns" "GlossaryColumns" "StandardModuleDepth")
;; Macros which should be on their own line:
- (LaTeX-paragraph-commands-add-locally '("changes"))
+ (LaTeX-paragraph-commands-add-locally '("DescribeEnv"
+ "DescribeMacro"
+ "changes"))
;; Fontification
(when (and (featurep 'font-latex)
- [AUCTeX-diffs] [elpa] externals/auctex 45aff50ff3 48/60: Support \mathcolor in style/x?color.el, (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 45aff50ff3 48/60: Support \mathcolor in style/x?color.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 5d2829aed4 49/60: Remove old defadvices (patch by Stefan Monnier), Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 5cf46ff8e2 52/60: Improve parsing of re-definitions, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 03ed9004cd 60/60: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex c050335dd8 21/60: ; Fix typo, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 69b78fcc26 54/60: Don't change indentation when defining a conditional, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 323eb08ca6 46/60: Assign reasonable sentinel in AmS-TeX mode, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 2af3c1bcbd 33/60: Add new style/ifthen.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex e1c3e37e0c 56/60: ; Update copyright year, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 3df1e313ea 25/60: Adapt TeX-region-hook for lexical-binding, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex fded69c292 59/60: Let \Describe<foo> macros stay on their own lines,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 806100f29a 27/60: Delete obsoleted variables (bug#54339), Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 9554d1e8a2 40/60: * doc/changes.texi: Announce the indentation improvement., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 8460859b69 34/60: Improve fontification of kernel macros, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 494d501e63 43/60: Adjust indenting of conditionals in styles, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 8e7d19fe84 44/60: Make tex-buf.el compile without (require 'latex), Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 7e6d83ff4e 47/60: Add news, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 180cc28dfa 50/60: Apply remaining portion of Stefan's patch, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex fd118c67d4 58/60: ; * style/doc.el (LaTeX-env-doc-no-comment): Fix docstring., Tassilo Horn, 2022/04/08