summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-engine.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2020-02-20 07:50:30 -0800
committerGlenn Morris <rgm@gnu.org>2020-02-20 07:50:30 -0800
commit398afbaf6f31d89b5cb813b75a28b98cf7b1acd2 (patch)
tree587f23019db4d4b1a5b138c741dd2895483cbca8 /lisp/progmodes/cc-engine.el
parent770f76f050376bbd77a3cc8cf44db57cf855a27c (diff)
parent9f0852474810311fd2b26fa3756ab6d816016389 (diff)
downloademacs-398afbaf6f31d89b5cb813b75a28b98cf7b1acd2.tar.gz
Merge from origin/emacs-27
9f08524748 (origin/emacs-27) Fix broken regexps 1d10885763 ; spelling and comment fix 614203bc80 ; make change-history-commit 28399e585e * Makefile.in (PREFERRED_BRANCH): Now emacs-27. 62afbc513a Fix bug when visiting euc-jp-encoded directories a2c4eeeecd Clarify when fixnums are used. 4e5ac4b0c6 Reorder discussion of integer basics f765aad28b Make OMake support slightly less expensive (bug#39595) 39410cfc5a Speed up 'msft' and 'watcom' compilation error regexps 96a269d045 Speed up 'maven' compilation error message regexp efc9d4fe3e Amend c-backward-sws better to handle multiline block comm...
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r--lisp/progmodes/cc-engine.el35
1 files changed, 27 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 0964c04b899..0c338fa3868 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -327,6 +327,8 @@ comment at the start of cc-engine.el for more info."
(when (or (null lim)
(>= here lim))
(save-match-data
+ ;; Note the similarity of the code here to some in
+ ;; `c-backward-sws'.
(while
(progn
(while (eq (char-before (1- (point))) ?\\)
@@ -2461,17 +2463,34 @@ comment at the start of cc-engine.el for more info."
(/= cmt-skip-pos simple-ws-beg)
(c-beginning-of-macro))
;; Inside a cpp directive. See if it should be skipped over.
- (let ((cpp-beg (point)))
+ (let ((cpp-beg (point))
+ pause pos)
- ;; Move back over all line continuations in the region skipped
- ;; over by `c-backward-comments'. If we go past it then we
- ;; started inside the cpp directive.
+ ;; Move back over all line continuations and block comments in
+ ;; the region skipped over by `c-backward-comments'. If we go
+ ;; past it then we started inside the cpp directive.
(goto-char simple-ws-beg)
(beginning-of-line)
- (while (and (> (point) cmt-skip-pos)
- (progn (backward-char)
- (eq (char-before) ?\\)))
- (beginning-of-line))
+ ;; Note the similarity of the code here to some in
+ ;; `c-beginning-of-macro'.
+ (setq pause (point))
+ (while
+ (progn
+ (while (and (> (point) cmt-skip-pos)
+ (progn (backward-char)
+ (eq (char-before) ?\\)))
+ (beginning-of-line))
+ (setq pos (point))
+ (when (and c-last-c-comment-end-on-line-re
+ (re-search-forward
+ c-last-c-comment-end-on-line-re pause t))
+ (goto-char (match-end 1))
+ (if (c-backward-single-comment)
+ (progn
+ (beginning-of-line)
+ (setq pause (point)))
+ (goto-char pos)
+ nil))))
(if (< (point) cmt-skip-pos)
;; Don't move past the cpp directive if we began inside