[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 1823017839 55/60: Wrap the 'funct
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 1823017839 55/60: Wrap the 'function' environment better with % |
Date: |
Fri, 8 Apr 2022 11:52:56 -0400 (EDT) |
branch: externals/auctex
commit 1823017839b2c2bd09d3d58fd08ef6dd168c10b8
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Wrap the 'function' environment better with %
* style/l3doc.el (LaTeX-env-l3doc-function): Improve inserting of
comment-char % around and in the 'function' environment.
---
style/l3doc.el | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/style/l3doc.el b/style/l3doc.el
index 1e11bb1415..e51e83a472 100644
--- a/style/l3doc.el
+++ b/style/l3doc.el
@@ -63,7 +63,7 @@ This function should be used for the environments 'function'
and
("noTF")
("label")
("verb"))
- "Flag(s)"))
+ "Flags (k=v)"))
(mac (TeX-read-string
(TeX-argument-prompt nil nil "Macro(s)")
TeX-esc))
@@ -72,19 +72,37 @@ This function should be used for the environments
'function' and
(elt-count 0)
(count 1)
(comment-func (lambda ()
- (if (TeX-in-commented-line)
+ (if (TeX-in-line-comment)
(indent-according-to-mode)
(delete-horizontal-space)
(beginning-of-line)
(insert "%")
- (indent-according-to-mode)))))
+ (indent-according-to-mode))))
+ p)
(LaTeX-insert-environment environment
(concat
(unless (zerop (length exp-flag))
(format "[%s]" exp-flag))
TeX-grop mac TeX-grcl))
- ;; Now make sure the current line starts with a '%':
+ ;; Remember where we start:
+ (setq p (point-marker))
+ ;; Now make sure we have '%' everywhere, start at the beginning:
+ (search-backward (concat TeX-esc "begin" TeX-grop environment TeX-grcl)
+ (if active-mark nil (line-beginning-position 0))
+ t)
(funcall comment-func)
+ ;; Now at the end:
+ (goto-char p)
+ (search-forward (concat TeX-esc "end" TeX-grop environment TeX-grcl)
+ (if active-mark nil (line-end-position 2))
+ t)
+ (goto-char (match-beginning 0))
+ (funcall comment-func)
+ ;; Finally for where we started and clean up only when region was
+ ;; not active:
+ (goto-char p)
+ (unless active-mark (funcall comment-func))
+ (set-marker p nil)
;; Ask if we should insert a 'syntax' environment:
(when (and (not active-mark)
(y-or-n-p "Insert syntax environment? "))
- [AUCTeX-diffs] [elpa] externals/auctex 844e758a47 07/60: Improve indent in tabular-like environments, (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 844e758a47 07/60: Improve indent in tabular-like environments, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 0e0551126d 17/60: * doc/changes.texi: Document switch from initial input to default., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex ab3bfaf103 13/60: Don't use obsolete font-lock-syntactic-keywords, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 2be733a3e3 28/60: Add new style/l3doc.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex dff1592319 09/60: Adjust argument list of `TeX-arg-length', Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex c43d21326d 42/60: Follow similar update of latex.el in context.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex b2cea20056 53/60: ; Delete unnecessary quoting in docstrings, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 4e4c48556b 08/60: ; Trivial cleanup, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex b3d4a509d0 39/60: ; * doc/auctex.texi (Indenting): Fix wording., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 4bcda2d50c 35/60: Improve indentation in env from algpseudocode package, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 1823017839 55/60: Wrap the 'function' environment better with %,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 36655f6a5e 24/60: Revert "Fix simultaneity", Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex fce8b94ca8 41/60: Update documentation with respect to indent, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 8938787491 37/60: ; * style/algpseudocode.el ("algpseudocode"): Fix "While"., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex eb4e331bd6 51/60: Add news for new indent feature, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex a2724f3677 15/60: Don't set syntax-propertize-function in defaults, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex e83ca6a072 57/60: Update style/doc.el to package version 3.0h, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex f9356664c8 23/60: Update documentation, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 78cf12b33c 18/60: ; * doc/auctex.texi: Adjust the year in @copying., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex c731038844 11/60: Improve regexp matching new environments, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 259ffc34c4 12/60: Use DEFAULT argument of `TeX-read-string' in styles, Tassilo Horn, 2022/04/08