[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a228137f: Don't count braces in verbatim constructs for indentati
From: |
Arash Esbati |
Subject: |
master a228137f: Don't count braces in verbatim constructs for indentation |
Date: |
Fri, 15 Sep 2023 04:14:49 -0400 (EDT) |
branch: master
commit a228137f66df1d5d9d20972cbcf5467a6a642303
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Don't count braces in verbatim constructs for indentation
* tex.el (TeX-brace-count-line): Ignore open/close braces in
verbatim constructs. (bug#65824)
---
tex.el | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/tex.el b/tex.el
index 18fafcff..d508a0cb 100644
--- a/tex.el
+++ b/tex.el
@@ -5496,21 +5496,25 @@ additional characters."
'(?\{ ?\} ?\\))
(TeX-in-comment))))
(forward-char)
- (cond ((memq char (append
- TeX-indent-open-delimiters
- '(?\{)))
- (setq count (+ count TeX-brace-indent-level)))
- ((memq char (append
- TeX-indent-close-delimiters
- '(?\})))
- (setq count (- count TeX-brace-indent-level)))
- ((eq char ?\\)
- (when (< (point) limit)
- ;; ?\\ in verbatim constructs doesn't escape
- ;; the next char
- (unless (TeX-verbatim-p)
- (forward-char))
- t))))))
+ ;; If inside a verbatim construct, just return t and
+ ;; proceed, otherwise start counting:
+ (if (TeX-verbatim-p)
+ t
+ (cond ((memq char (append
+ TeX-indent-open-delimiters
+ '(?\{)))
+ (setq count (+ count TeX-brace-indent-level)))
+ ((memq char (append
+ TeX-indent-close-delimiters
+ '(?\})))
+ (setq count (- count TeX-brace-indent-level)))
+ ((eq char ?\\)
+ (when (< (point) limit)
+ ;; ?\\ in verbatim constructs doesn't escape
+ ;; the next char
+ (unless (TeX-verbatim-p)
+ (forward-char))
+ t)))))))
count)))
;;; Navigation
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master a228137f: Don't count braces in verbatim constructs for indentation,
Arash Esbati <=