[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-28 e0f54c62ec: CC Mode: fontify variables/functions after line com
From: |
Alan Mackenzie |
Subject: |
emacs-28 e0f54c62ec: CC Mode: fontify variables/functions after line comments ending in spaces |
Date: |
Fri, 29 Jul 2022 16:22:23 -0400 (EDT) |
branch: emacs-28
commit e0f54c62ecb72c41a9afc6d6c3e22b1a0b113f11
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>
CC Mode: fontify variables/functions after line comments ending in spaces
* lisp/progmodes/cc-engine.el (c-forward-comment-minus-1): Take account of
spaces preceding a linefeed when scanning a putative line comment end.
---
lisp/progmodes/cc-engine.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3068c41a57..80ac496749 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -1668,9 +1668,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))) ?\\))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-28 e0f54c62ec: CC Mode: fontify variables/functions after line comments ending in spaces,
Alan Mackenzie <=