aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2019-04-05 08:00:09 -0400
committerNoam Postavsky2019-04-15 20:28:03 -0400
commit7a382383ac7912541bcceea16676ade20cc6b9ba (patch)
treee0079da096dba4b8198c17535a89f8a65e7e1c14
parent74412e7dcb10909ffebb27db7d6eaffe96599810 (diff)
downloademacs-7a382383ac7912541bcceea16676ade20cc6b9ba.tar.gz
emacs-7a382383ac7912541bcceea16676ade20cc6b9ba.zip
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.
-rw-r--r--lisp/cedet/semantic/doc.el3
-rw-r--r--lisp/emacs-lisp/smie.el4
-rw-r--r--lisp/progmodes/fortran.el9
-rw-r--r--lisp/progmodes/vhdl-mode.el2
4 files changed, 11 insertions, 7 deletions
diff --git a/lisp/cedet/semantic/doc.el b/lisp/cedet/semantic/doc.el
index 5611629c14d..4f98cf41027 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."
103 nil 103 nil
104 ;; ok, try to clean the text up. 104 ;; ok, try to clean the text up.
105 ;; Comment start thingy 105 ;; Comment start thingy
106 (while (string-match (concat "^\\s-*" comment-start-skip) ct) 106 (while (string-match (concat "^\\s-*\\(?:" comment-start-skip "\\)")
107 ct)
107 (setq ct (concat (substring ct 0 (match-beginning 0)) 108 (setq ct (concat (substring ct 0 (match-beginning 0))
108 (substring ct (match-end 0))))) 109 (substring ct (match-end 0)))))
109 ;; Arbitrary punctuation at the beginning of each line. 110 ;; Arbitrary punctuation at the beginning of each line.
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 92b639d71e2..e0293c3cbb4 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."
1446 (and (smie-indent--bolp) 1446 (and (smie-indent--bolp)
1447 (save-excursion 1447 (save-excursion
1448 (comment-normalize-vars) 1448 (comment-normalize-vars)
1449 (re-search-forward (concat comment-start-skip 1449 (re-search-forward (concat "\\(?:" comment-start-skip "\\)"
1450 "fixindent" 1450 "fixindent"
1451 comment-end-skip) 1451 "\\(?:" comment-end-skip "\\)")
1452 ;; 1+ to account for the \n comment termination. 1452 ;; 1+ to account for the \n comment termination.
1453 (1+ (line-end-position)) t)) 1453 (1+ (line-end-position)) t))
1454 (current-column))) 1454 (current-column)))
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 152667040fa..f01e866f557 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1275,7 +1275,8 @@ Directive lines are treated as comments."
1275 (concat "[ \t]*" 1275 (concat "[ \t]*"
1276 (regexp-quote fortran-continuation-string))) 1276 (regexp-quote fortran-continuation-string)))
1277 (looking-at "[ \t]*$\\| \\{5\\}[^ 0\n]\\|\t[1-9]") 1277 (looking-at "[ \t]*$\\| \\{5\\}[^ 0\n]\\|\t[1-9]")
1278 (looking-at (concat "[ \t]*" comment-start-skip))))) 1278 (looking-at (concat "[ \t]*\\(?:"
1279 comment-start-skip "\\)")))))
1279 (cond ((and continue-test 1280 (cond ((and continue-test
1280 (not not-first-statement)) 1281 (not not-first-statement))
1281 (message "Incomplete continuation statement.")) 1282 (message "Incomplete continuation statement."))
@@ -1298,7 +1299,8 @@ Directive lines are treated as comments."
1298 (or (looking-at fortran-comment-line-start-skip) 1299 (or (looking-at fortran-comment-line-start-skip)
1299 (looking-at fortran-directive-re) 1300 (looking-at fortran-directive-re)
1300 (looking-at "[ \t]*$\\| [^ 0\n]\\|\t[1-9]") 1301 (looking-at "[ \t]*$\\| [^ 0\n]\\|\t[1-9]")
1301 (looking-at (concat "[ \t]*" comment-start-skip))))) 1302 (looking-at (concat "[ \t]*\\(?:"
1303 comment-start-skip "\\)")))))
1302 (if (not not-last-statement) 1304 (if (not not-last-statement)
1303 'last-statement))) 1305 'last-statement)))
1304 1306
@@ -2146,7 +2148,8 @@ Always returns non-nil (to prevent `fill-paragraph' being called)."
2146 (or (looking-at "[ \t]*$") 2148 (or (looking-at "[ \t]*$")
2147 (looking-at fortran-comment-line-start-skip) 2149 (looking-at fortran-comment-line-start-skip)
2148 (and comment-start-skip 2150 (and comment-start-skip
2149 (looking-at (concat "[ \t]*" comment-start-skip))))) 2151 (looking-at (concat "[ \t]*\\(?:"
2152 comment-start-skip "\\)")))))
2150 (save-excursion 2153 (save-excursion
2151 ;; Find beginning of statement. 2154 ;; Find beginning of statement.
2152 (fortran-next-statement) 2155 (fortran-next-statement)
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 1dc0c61d063..13d0cfa67e8 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."
6699 (if (and interactive 6699 (if (and interactive
6700 (or (nth 3 state) 6700 (or (nth 3 state)
6701 (nth 4 state) 6701 (nth 4 state)
6702 (looking-at (concat "[ \t]*" comment-start-skip)))) 6702 (looking-at (concat "[ \t]*\\(?:" comment-start-skip "\\)"))))
6703 (forward-sentence (- count)) 6703 (forward-sentence (- count))
6704 (while (> count 0) 6704 (while (> count 0)
6705 (vhdl-beginning-of-statement-1 lim) 6705 (vhdl-beginning-of-statement-1 lim)