Commit 7a382383 authored by Noam Postavsky's avatar Noam Postavsky Committed by Noam Postavsky

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.
parent 74412e7d
Pipeline #1306 failed with stage
in 50 minutes and 35 seconds
......@@ -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.
......
......@@ -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)))
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment