[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa 5886c49 41/51: Improve the insertation of "macro" environmen
From: |
Tassilo Horn |
Subject: |
[elpa] elpa 5886c49 41/51: Improve the insertation of "macro" environment |
Date: |
Sun, 22 May 2016 07:22:50 +0000 (UTC) |
branch: elpa
commit 5886c49d94ac761020bf2494afb42677987b3e90
Author: Arash Esbati <address@hidden>
Commit: Mosè Giordano <address@hidden>
Improve the insertation of "macro" environment
* style/doc.el (LaTeX-env-no-comment): Check if argument
`environment' is "macro" and query/insert a name prefixed with
`TeX-esc'.
(LaTeX-doc-after-insert-macrocode): Add "macro" environment.
("doc"): Run `LaTeX-env-no-comment' when "macro" environment is
inserted.
Signed-off-by: Mosè Giordano <address@hidden>
---
style/doc.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/style/doc.el b/style/doc.el
index abd248d..6c98d66 100644
--- a/style/doc.el
+++ b/style/doc.el
@@ -31,7 +31,12 @@
(defun LaTeX-env-no-comment (environment)
"Insert ENVIRONMENT and make sure there is no commented empty line inside."
- (LaTeX-insert-environment environment)
+ (LaTeX-insert-environment environment
+ (when (string-equal environment "macro")
+ (let ((macroname (TeX-read-string
+ (TeX-argument-prompt nil nil
"Macro")
+ TeX-esc)))
+ (format "{%s}" macroname))))
(unless (TeX-active-mark)
(when (save-excursion
(beginning-of-line)
@@ -42,7 +47,7 @@
(defun LaTeX-doc-after-insert-macrocode (env start end)
"Make sure the macrocode environment is properly formatted after insertion."
- (when (TeX-member env '("macrocode" "macrocode*") 'string-equal)
+ (when (TeX-member env '("macro" "macrocode" "macrocode*") 'string-equal)
(save-excursion
(goto-char end)
(skip-chars-backward " \t")
@@ -70,7 +75,7 @@
"theglossary"
'("macrocode" LaTeX-env-no-comment)
'("macrocode*" LaTeX-env-no-comment)
- '("macro" "Macro"))
+ '("macro" LaTeX-env-no-comment))
(TeX-add-symbols
"EnableCrossrefs"
"DisableCrossrefs"
- [elpa] elpa 44e654b 22/51: Use `match-string-no-properties', (continued)
- [elpa] elpa 44e654b 22/51: Use `match-string-no-properties', Tassilo Horn, 2016/05/22
- [elpa] elpa 36b6051 12/51: Compatibility for XEmacs, Tassilo Horn, 2016/05/22
- [elpa] elpa af27d33 17/51: TikZ: Add the grid command., Tassilo Horn, 2016/05/22
- [elpa] elpa bc8d07f 27/51: Temporarily bind `TeX-insert-macro-default-style' to 'show-optional-args', Tassilo Horn, 2016/05/22
- [elpa] elpa 88fbf80 20/51: Fix in TeX sentinels, Tassilo Horn, 2016/05/22
- [elpa] elpa 693eee6 11/51: TikZ: Remove unneeded function., Tassilo Horn, 2016/05/22
- [elpa] elpa b20cd68 16/51: Fix a documentation type., Tassilo Horn, 2016/05/22
- [elpa] elpa 71349ec 23/51: Use `deactivate-input-method' if defined, Tassilo Horn, 2016/05/22
- [elpa] elpa d4d2ab5 31/51: Enable directory local variables in japanese-{latex, plain-tex}-mode, Tassilo Horn, 2016/05/22
- [elpa] elpa 63a83c3 30/51: Make unloading of tex-site work on Emacs 24, Tassilo Horn, 2016/05/22
- [elpa] elpa 5886c49 41/51: Improve the insertation of "macro" environment,
Tassilo Horn <=
- [elpa] elpa e19f8bd 37/51: Do not check TeX engine with ifluatex package, Tassilo Horn, 2016/05/22
- [elpa] elpa 79a8643 47/51: Respect both "xcolor" and "color" for command queries, Tassilo Horn, 2016/05/22
- [elpa] elpa ccfe316 42/51: Make TeX-view work better with regions, Tassilo Horn, 2016/05/22
- [elpa] elpa d418e9a 15/51: Prevent infinite loop in TeX-command-expand, Tassilo Horn, 2016/05/22
- [elpa] elpa 4f9666b 24/51: Use customize option `TeX-region' instead of "_region_", Tassilo Horn, 2016/05/22
- [elpa] elpa a83c4d0 02/51: Fix compatibility with older Emacs versions, Tassilo Horn, 2016/05/22
- [elpa] elpa 13153ba 40/51: Use commit date for package date also in configure, Tassilo Horn, 2016/05/22
- [elpa] elpa 7fc63f1 39/51: Tweak mode name only when file local variable is enabled., Tassilo Horn, 2016/05/22
- [elpa] elpa 7e3bec8 44/51: Run `TeX-add-symbols' if "xcolor" is not an active style, Tassilo Horn, 2016/05/22
- [elpa] elpa f0849b4 10/51: TikZ: Add the 'sin' and 'cos' connectors., Tassilo Horn, 2016/05/22