emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 7a38238: Properly bracket concat of comment-start-s


From: Noam Postavsky
Subject: [Emacs-diffs] master 7a38238: Properly bracket concat of comment-start-skip (Bug#34805)
Date: Mon, 15 Apr 2019 20:34:45 -0400 (EDT)

branch: master
commit 7a382383ac7912541bcceea16676ade20cc6b9ba
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Properly bracket concat of comment-start-skip (Bug#34805)
    
    * lisp/emacs-lisp/smie.el (smie-indent-fixindent):
    * lisp/cedet/semantic/doc.el (semantic-doc-snarf-comment-for-tag):
    * lisp/progmodes/fortran.el (fortran-previous-statement)
    (fortran-next-statement)
    (fortran-fill-statement):
    * lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-statement): Bracket
    comment-start-skip and comment-end-skip to avoid unexpected regexp
    operator precedence.
---
 lisp/cedet/semantic/doc.el  | 3 ++-
 lisp/emacs-lisp/smie.el     | 4 ++--
 lisp/progmodes/fortran.el   | 9 ++++++---
 lisp/progmodes/vhdl-mode.el | 2 +-
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/lisp/cedet/semantic/doc.el b/lisp/cedet/semantic/doc.el
index 5611629..4f98cf4 100644
--- a/lisp/cedet/semantic/doc.el
+++ b/lisp/cedet/semantic/doc.el
@@ -103,7 +103,8 @@ If NOSNARF is `lex', then return the lex token."
            nil
          ;; ok, try to clean the text up.
          ;; Comment start thingy
-         (while (string-match (concat "^\\s-*" comment-start-skip) ct)
+         (while (string-match (concat "^\\s-*\\(?:" comment-start-skip "\\)")
+                               ct)
            (setq ct (concat (substring ct 0 (match-beginning 0))
                             (substring ct (match-end 0)))))
          ;; Arbitrary punctuation at the beginning of each line.
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 92b639d..e0293c3 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1446,9 +1446,9 @@ in order to figure out the indentation of some other 
(further down) point."
   (and (smie-indent--bolp)
        (save-excursion
          (comment-normalize-vars)
-         (re-search-forward (concat comment-start-skip
+         (re-search-forward (concat "\\(?:" comment-start-skip "\\)"
                                     "fixindent"
-                                    comment-end-skip)
+                                    "\\(?:" comment-end-skip "\\)")
                             ;; 1+ to account for the \n comment termination.
                             (1+ (line-end-position)) t))
        (current-column)))
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 1526670..f01e866 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1275,7 +1275,8 @@ Directive lines are treated as comments."
                      (concat "[ \t]*"
                              (regexp-quote fortran-continuation-string)))
                     (looking-at "[ \t]*$\\| \\{5\\}[^ 0\n]\\|\t[1-9]")
-                    (looking-at (concat "[ \t]*" comment-start-skip)))))
+                    (looking-at (concat "[ \t]*\\(?:"
+                                        comment-start-skip "\\)")))))
     (cond ((and continue-test
                 (not not-first-statement))
            (message "Incomplete continuation statement."))
@@ -1298,7 +1299,8 @@ Directive lines are treated as comments."
                 (or (looking-at fortran-comment-line-start-skip)
                     (looking-at fortran-directive-re)
                     (looking-at "[ \t]*$\\|     [^ 0\n]\\|\t[1-9]")
-                    (looking-at (concat "[ \t]*" comment-start-skip)))))
+                    (looking-at (concat "[ \t]*\\(?:"
+                                        comment-start-skip "\\)")))))
     (if (not not-last-statement)
         'last-statement)))
 
@@ -2146,7 +2148,8 @@ Always returns non-nil (to prevent `fill-paragraph' being 
called)."
               (or (looking-at "[ \t]*$")
                   (looking-at fortran-comment-line-start-skip)
                   (and comment-start-skip
-                       (looking-at (concat "[ \t]*" comment-start-skip)))))
+                       (looking-at (concat "[ \t]*\\(?:"
+                                           comment-start-skip "\\)")))))
       (save-excursion
         ;; Find beginning of statement.
         (fortran-next-statement)
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 1dc0c61..13d0cfa 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -6699,7 +6699,7 @@ search, and an argument indicating an interactive call."
     (if (and interactive
             (or (nth 3 state)
                 (nth 4 state)
-                (looking-at (concat "[ \t]*" comment-start-skip))))
+                (looking-at (concat "[ \t]*\\(?:" comment-start-skip "\\)"))))
        (forward-sentence (- count))
       (while (> count 0)
        (vhdl-beginning-of-statement-1 lim)



reply via email to

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