]> git.eshelyaron.com Git - emacs.git/commitdiff
Properly bracket concat of comment-start-skip (Bug#34805)
authorNoam Postavsky <npostavs@users.sourceforge.net>
Fri, 5 Apr 2019 12:00:09 +0000 (08:00 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Tue, 16 Apr 2019 00:28:03 +0000 (20:28 -0400)
* 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
lisp/emacs-lisp/smie.el
lisp/progmodes/fortran.el
lisp/progmodes/vhdl-mode.el

index 5611629c14dbe3b9966d6eb08557eca188d1d386..4f98cf4102786b90b7561ecf4f57c9a6a0606993 100644 (file)
@@ -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.
index 92b639d71e2abed9ccc1c7b31c9f5f73a8f9d480..e0293c3cbb4a7536ed3be94bf7f73a8eedf80ed8 100644 (file)
@@ -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)))
index 152667040fa537a138c4d2182eb73c5a00043ea7..f01e866f55741b72082cd6997cba311f4592815b 100644 (file)
@@ -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)
index 1dc0c61d063ae1bd5af92f51d1db01f4958ab34e..13d0cfa67e82a2630620dae93183c290420230e3 100644 (file)
@@ -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)