summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-engine.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-07-30 06:30:23 +0200
committerStefan Kangas <stefan@marxist.se>2022-07-30 06:30:23 +0200
commit76bcbe5f930f16014343ae75e92df94c727f30af (patch)
treeb05186dda664417b0abfaca8dc32da00028d5e1e /lisp/progmodes/cc-engine.el
parent40c0124816969985d00cb7edf55859ef2264d332 (diff)
parente0f54c62ecb72c41a9afc6d6c3e22b1a0b113f11 (diff)
downloademacs-76bcbe5f930f16014343ae75e92df94c727f30af.tar.gz
emacs-76bcbe5f930f16014343ae75e92df94c727f30af.tar.bz2
emacs-76bcbe5f930f16014343ae75e92df94c727f30af.zip
Merge from origin/emacs-28
e0f54c62ec CC Mode: fontify variables/functions after line comments e... 2c6a94c5b8 ; Correct the meaning of "cf." in tips.texi
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r--lisp/progmodes/cc-engine.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index cfbb668baeb..bc6155dd668 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -1672,9 +1672,13 @@ comment at the start of cc-engine.el for more info."
Return the result of `forward-comment' if it gets called, nil otherwise."
`(if (not comment-end-can-be-escaped)
(forward-comment -1)
- (when (and (< (skip-syntax-backward " >") 0)
- (eq (char-after) ?\n))
- (forward-char))
+ (let ((dist (skip-syntax-backward " >")))
+ (when (and
+ (< dist 0)
+ (progn
+ (skip-syntax-forward " " (- (point) dist 1))
+ (eq (char-after) ?\n)))
+ (forward-char)))
(cond
((and (eq (char-before) ?\n)
(eq (char-before (1- (point))) ?\\))