auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 5f67eac8d508402349884


From: Ikumi Keita
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 5f67eac8d508402349884ba80808ec0f4722f4fb
Date: Fri, 19 Nov 2021 00:11:06 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  5f67eac8d508402349884ba80808ec0f4722f4fb (commit)
      from  9e97edc3f288a40b5bdff6803c903b4f0d86712d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5f67eac8d508402349884ba80808ec0f4722f4fb
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Date:   Fri Nov 19 10:46:51 2021 +0900

    Fix logic again
    
    * latex.el (LaTeX-fill-region-as-paragraph): When identifying code
    comment, continue search if the found candidate turns out not to be a
    code comment.
    Add a comment for regexp.

diff --git a/latex.el b/latex.el
index 132e6a5..e3699c5 100644
--- a/latex.el
+++ b/latex.el
@@ -4022,15 +4022,20 @@ performed in that case."
         (goto-char from)
         (while (< (point) end-marker)
           ;; Code comments.
-          (when (setq has-code-comment
-                      (TeX-search-forward-comment-start end-marker))
-            ;; See if there is at least one non-whitespace
-            ;; character before the comment starts.
-            (goto-char has-code-comment)
-            (skip-chars-backward " \t" (line-beginning-position))
-            (if (bolp)
-                ;; Not a code comment.
-                (setq has-code-comment nil)))
+          (catch 'found
+            (while (setq has-code-comment
+                         (TeX-search-forward-comment-start end-marker))
+              ;; See if there is at least one non-whitespace
+              ;; character before the comment starts.
+              (goto-char has-code-comment)
+              (skip-chars-backward " \t" (line-beginning-position))
+              (if (not (bolp))
+                  ;; A real code comment.
+                  (throw 'found t)
+                ;; Not a code comment.  Continue the loop.
+                (forward-line 1)
+                (if (> (point) end-marker)
+                    (goto-char end-marker)))))
 
           ;; Go back to the former point for the next regexp search.
           (goto-char from)
@@ -4050,6 +4055,8 @@ performed in that case."
                         "\\(?:{[ \t]*}\\)?[ \t]*$"
                         "\\)\\|"
                         ;; Lines ending with `\\'.
+                        ;; XXX: This matches a line ending with "\\\ ".
+                        ;; Should we avoid such corner case?
                         (regexp-quote (concat TeX-esc TeX-esc))
                         ;; XXX: Why not just "\\s-*\\*?" ?
                         "\\(?:\\s-*\\*\\)?"

-----------------------------------------------------------------------

Summary of changes:
 latex.el | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]