[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 296/299: Fix indentation of tabularx environment closing.
From: |
Stefan Monnier |
Subject: |
[elpa] 296/299: Fix indentation of tabularx environment closing. |
Date: |
Sun, 02 Nov 2014 03:12:05 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 700587fe36b0104eba7dd30bef869ba3349a66d1
Author: Matthew Leach <address@hidden>
Date: Wed Oct 29 17:46:24 2014 +0100
Fix indentation of tabularx environment closing.
* latex.el (LaTeX-indent-environment-list): Remove setter
lambda.
(LaTeX--tabular-like-end): Remove variable.
(LaTeX-indent-tabular): Move setter function from
LaTeX-indent-environment-list to generate tabular-end regex when
called.
Signed-off-by: Mosè Giordano <address@hidden>
---
ChangeLog | 9 ++++++++
latex.el | 64 ++++++++++++++++++++++++++----------------------------------
2 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 897a9b8..22813c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-10-29 Matthew Leach <address@hidden>
+
+ * latex.el (LaTeX-indent-environment-list): Remove setter
+ lambda.
+ (LaTeX--tabular-like-end): Remove variable.
+ (LaTeX-indent-tabular): Move setter function from
+ LaTeX-indent-environment-list to generate tabular-end regex when
+ called.
+
2014-10-29 Mos� Giordano <address@hidden>
* latex.el (LaTeX-largest-level-set): Set `outline-heading-alist'
diff --git a/latex.el b/latex.el
index 33e4720..b56abf3 100644
--- a/latex.el
+++ b/latex.el
@@ -2852,25 +2852,7 @@ The second element in each entry is the function to
calculate the
indentation level in columns."
:group 'LaTeX-indentation
:type '(repeat (list (string :tag "Environment")
- (option function)))
- :set (lambda (symbol value)
- (setq LaTeX--tabular-like-end
- (format "\\\\end{%s}"
- (regexp-opt
- (let (out)
- (mapc (lambda (x)
- (when (eq (cadr x) 'LaTeX-indent-tabular)
- (push (car x) out)))
- value)
- out))))
- (set-default symbol value)))
-
-(defvar LaTeX--tabular-like-end nil
- "A regexp matching tabular-like environment ends.
-Those will be aligned with `LaTeX-indent-tabular'.
-
-Do not set this variable. This variable is auto-set
-by customizing `LaTeX-indent-environment-list'.")
+ (option function))))
(defcustom LaTeX-indent-environment-check t
"*If non-nil, check for any special environments."
@@ -6311,23 +6293,33 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
"Return indent column for the current tabular-like line."
(destructuring-bind (beg-pos . beg-col)
(LaTeX-env-beginning-pos-col)
- (cond ((looking-at LaTeX--tabular-like-end)
- beg-col)
-
- ((looking-at "\\\\\\\\")
- (+ 2 beg-col))
-
- ((looking-at "&")
- (LaTeX-hanging-ampersand-position))
-
- (t
- (+ 2
- (let ((any-col (save-excursion
- (when (re-search-backward "\\\\\\\\\\|&"
beg-pos t)
- (current-column)))))
- (if (and any-col (string= "&" (match-string 0)))
- any-col
- beg-col)))))))
+ (let ((tabular-like-end-regex
+ (format "\\\\end{%s}"
+ (regexp-opt
+ (let (out)
+ (mapcar (lambda (x)
+ (when (eq (cadr x) 'LaTeX-indent-tabular)
+ (push (car x) out)))
+ LaTeX-indent-environment-list)
+ (pp out)
+ out)))))
+ (cond ((looking-at tabular-like-end-regex)
+ beg-col)
+
+ ((looking-at "\\\\\\\\")
+ (+ 2 beg-col))
+
+ ((looking-at "&")
+ (LaTeX-hanging-ampersand-position))
+
+ (t
+ (+ 2
+ (let ((any-col (save-excursion
+ (when (re-search-backward "\\\\\\\\\\|&"
beg-pos t)
+ (current-column)))))
+ (if (and any-col (string= "&" (match-string 0)))
+ any-col
+ beg-col))))))))
(provide 'latex)
- [elpa] 286/299: Rename LaTeX-amstext-package-option to LaTeX-amstext-package-options., (continued)
- [elpa] 286/299: Rename LaTeX-amstext-package-option to LaTeX-amstext-package-options., Stefan Monnier, 2014/11/01
- [elpa] 285/299: Use `push-mark' instead of `set-mark'., Stefan Monnier, 2014/11/01
- [elpa] 284/299: Fix \end buffer position passed to hooks., Stefan Monnier, 2014/11/01
- [elpa] 290/299: Fix LaTeX-newline when comment-auto-fill-only-comments is non-nil., Stefan Monnier, 2014/11/01
- [elpa] 287/299: Docstring fix., Stefan Monnier, 2014/11/01
- [elpa] 276/299: Code cleanup and optimizations., Stefan Monnier, 2014/11/01
- [elpa] 288/299: Avoid duplicate marks in TeX-insert-dollar., Stefan Monnier, 2014/11/01
- [elpa] 289/299: Add style for cleverref., Stefan Monnier, 2014/11/01
- [elpa] 295/299: Fix in LaTeX-largest-level-set for XEmacs compatibility., Stefan Monnier, 2014/11/01
- [elpa] 291/299: Build HTML doc with makeinfo if texi2html is not available., Stefan Monnier, 2014/11/01
- [elpa] 296/299: Fix indentation of tabularx environment closing.,
Stefan Monnier <=
- [elpa] 292/299: Update for upcoming release., Stefan Monnier, 2014/11/01
- [elpa] 298/299: Release_11.88, Stefan Monnier, 2014/11/01
- [elpa] 297/299: Minor fix to previous change., Stefan Monnier, 2014/11/01
- [elpa] 293/299: Use autoconf variables for preview version and date., Stefan Monnier, 2014/11/01
- [elpa] 294/299: Manually adjust preview release version in dtx., Stefan Monnier, 2014/11/01
- [elpa] 282/299: Allow applying style hooks only in a certain context., Stefan Monnier, 2014/11/01
- [elpa] 299/299: Merge from upstream release 11.88., Stefan Monnier, 2014/11/01