[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex b379da7 18/71: Don't indent begin/end of comment
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex b379da7 18/71: Don't indent begin/end of comment env |
Date: |
Fri, 17 Dec 2021 15:00:27 -0500 (EST) |
branch: externals/auctex
commit b379da77ad5caee4e45d4ed6b43398c11437baa8
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Don't indent begin/end of comment env
Begin/end line of comment environment must be flush left, just like
verbatim environments. However, comment environment shouldn't be
included in `LaTeX-verbatim-environments' because
1. filling shouldn't be disabled inside comment environment
2. contents inside comment environment should be fontified as comment
* latex.el (LaTeX-verbatim-regexp): Attach a new optional argument
COMMENT to allow inclusion of comment environments.
(LaTeX-indent-calculate): Indent begin/end line of comment environment
at column 0.
Remove redundant regexp grouping.
(LaTeX-indent-calculate-last): Calculate indent after comment
environment correctly.
Remove redundant regexp grouping.
---
latex.el | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/latex.el b/latex.el
index 9954cc5..d833b0f 100644
--- a/latex.el
+++ b/latex.el
@@ -3681,9 +3681,12 @@ Lines starting with an item is given an extra
indentation of
(delete-region (line-beginning-position) (point))
(indent-to outer-indent))
-(defun LaTeX-verbatim-regexp ()
- "Calculate the verbatim env regex from `LaTeX-verbatim-environments'."
- (regexp-opt (LaTeX-verbatim-environments)))
+(defun LaTeX-verbatim-regexp (&optional comment)
+ "Calculate the verbatim env regex from `LaTeX-verbatim-environments'.
+If optional argument COMMENT is non-nil, include comment env from
+`LaTeX-comment-env-list'."
+ (regexp-opt (append (LaTeX-verbatim-environments)
+ (if comment LaTeX-comment-env-list))))
(defun LaTeX-indent-calculate (&optional force-type)
"Return the indentation of a line of LaTeX source.
@@ -3715,9 +3718,9 @@ outer indentation in case of a commented line. The
symbols
(length comment-padding)))
(nth 1 entry)))
((looking-at (concat (regexp-quote TeX-esc)
- "\\(begin\\|end\\){\\("
- (LaTeX-verbatim-regexp)
- "\\)}"))
+ "\\(begin\\|end\\){"
+ (LaTeX-verbatim-regexp t)
+ "}"))
;; \end{verbatim} must be flush left, otherwise an unwanted
;; empty line appears in LaTeX's output.
0)
@@ -3848,20 +3851,23 @@ outer indentation in case of a commented line. The
symbols
0)
((looking-at (concat (regexp-quote TeX-esc)
"begin *{\\("
+ ;; Don't give optional argument here
+ ;; because indent would be disabled
+ ;; inside comment env otherwise.
(LaTeX-verbatim-regexp)
"\\)}"))
0)
((looking-at (concat (regexp-quote TeX-esc)
- "end *{\\("
- (LaTeX-verbatim-regexp)
- "\\)}"))
+ "end *{"
+ (LaTeX-verbatim-regexp t)
+ "}"))
;; If I see an \end{verbatim} in the previous line I skip
;; back to the preceding \begin{verbatim}.
(save-excursion
(if (re-search-backward (concat (regexp-quote TeX-esc)
- "begin *{\\("
- (LaTeX-verbatim-regexp)
- "\\)}") 0 t)
+ "begin *{"
+ (LaTeX-verbatim-regexp t)
+ "}") 0 t)
(LaTeX-indent-calculate-last force-type)
0)))
(t (+ (LaTeX-current-indentation force-type)
- [elpa] externals/auctex 0c01b75 13/71: ; * doc/changes.texi: Fix a markup., (continued)
- [elpa] externals/auctex 0c01b75 13/71: ; * doc/changes.texi: Fix a markup., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex fd73414 11/71: ; * doc/changes.texi: Add supplementary notice., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 7fa094f 14/71: ; * style/tabulary.el ("tabulary"): Really append the entry., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 464fd34 20/71: * tests/latex/latex-test.el (LaTeX-flush-left-indent): New test., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex ae2d7ef 23/71: Silence compiler warning, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex f6dd4a4 25/71: ; Silence the compiler, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex df0d719 52/71: Improve handling of key=vals in style/hologo.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 08f5c9e 51/71: Improve handling of key=vals in style/floatrow.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 9fa3859 38/71: ; Remove duplicates, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 7b632c6 43/71: * doc/todo.texi (Mid-term Goals): Add TODO about tool bar., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex b379da7 18/71: Don't indent begin/end of comment env,
Tassilo Horn <=
- [elpa] externals/auctex 483f6e9 05/71: ; * style/hyperref.el ("hyperref"): Fix other link to testform.tex., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 380bc4a 06/71: Handle optional embellishment arguments correctly, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex bd723c7 24/71: Cater for corner case when dealing with TeX error, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 6433dc3 30/71: Extend `TeX-read-key-val' to accept a function call, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex df69443 26/71: ; Silence the compiler, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 8e0fb65 47/71: Improve handling of key=vals in style/listings.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 0419539 37/71: Improve style/babel.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex d62d8f3 34/71: Update style/fontspec.el to package version 2.7i, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex b9545c8 45/71: Improve handling of key=vals in style/fancyvrb.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 9e97edc 49/71: Fix wrong logic of the previous commit, Tassilo Horn, 2021/12/17