summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-engine.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2020-02-10 21:20:12 +0000
committerAlan Mackenzie <acm@muc.de>2020-02-10 21:20:12 +0000
commitad5e350ab764f3a420d29f24ab3222f671b2e8c0 (patch)
tree6b94248be6fc1053ec5873944cc8827453801cfd /lisp/progmodes/cc-engine.el
parent06c302d425fc2093130479b8aed7da4507d43331 (diff)
downloademacs-ad5e350ab764f3a420d29f24ab3222f671b2e8c0.tar.gz
c-end-of-macro: Handle block coment lines with unescaped NLs correctly
* lisp/progmodes/cc-langs.el (c-last-open-c-comment-start-on-line-re): Make obsolete, and supersede by ... (c-open-c-comment-on-logical-line-re): New language variable. * lisp/progmodes/cc-engine.el (c-end-of-macro): Inside macros, handle multiline block comments whose line ends are not escaped correctly.
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r--lisp/progmodes/cc-engine.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index c3cd31fdd00..23fb1effdd4 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -388,14 +388,17 @@ comment at the start of cc-engine.el for more info."
(forward-char)
t)))
(let ((cand-EOM (point)))
- (if (and c-last-open-c-comment-start-on-line-re
+ (if (and c-open-c-comment-on-logical-line-re
(re-search-backward
- c-last-open-c-comment-start-on-line-re
- (c-point 'bol) t))
- (progn
- (goto-char (match-beginning 1))
- (and (c-forward-single-comment)
- (> (point) cand-EOM)))
+ c-open-c-comment-on-logical-line-re
+ nil t)
+ (match-beginning 1)
+ (progn
+ (goto-char (match-beginning 1))
+ (and (c-forward-single-comment)
+ (> (point) cand-EOM))))
+ t
+ (goto-char cand-EOM)
nil)))))
(when (and (car c-macro-cache)