1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

CC Mode: fix minor errors in the fontification of enums.

1: Fix the typing of a space on the { line in an enum
specification which is the first item in a buffer.  This
defontified the enum's identifiers.
2: Fix the typing of a space on the line of the enum's last
identifier.  This defontified that identifier for
jit-lock-context-time.

* lisp/progmodes/cc-engine.el (c-forward-declarator): Cease
rejecting the identifier if there are no further tokens before
LIMIT.

* lisp/progmodes/cc-mode.el (c-fl-decl-start): Accept a
backward search as succeeding if it hits point-min.
This commit is contained in:
Alan Mackenzie 2024-09-21 16:46:32 +00:00
parent 4745bafa6a
commit 086cb1b590
2 changed files with 2 additions and 5 deletions

View file

@ -10045,7 +10045,7 @@ point unchanged and return nil."
(defun c-forward-declarator (&optional limit accept-anon not-top)
;; Assuming point is at the start of a declarator, move forward over it,
;; leaving point at the next token after it (e.g. a ) or a ; or a ,), or at
;; end of buffer if there is no such token.
;; LIMIT (or end of buffer) if that comes first.
;;
;; Return a list (ID-START ID-END BRACKETS-AFTER-ID GOT-INIT DECORATED
;; ARGLIST), where ID-START and ID-END are the bounds of the declarator's
@ -10178,9 +10178,6 @@ point unchanged and return nil."
(c-safe (goto-char (scan-lists (point) 1 paren-depth)))
(c-forward-syntactic-ws)))
(or (eq (point) (point-max)) ; No token after identifier.
(< (point) limit))
;; Skip over any trailing bit, such as "__attribute__".
(progn
(while (cond

View file

@ -2463,7 +2463,7 @@ with // and /*, not more generic line and block comments."
(backward-char)
(setq pseudo (c-cheap-inside-bracelist-p (c-parse-state)))))))
(goto-char pseudo))
(or pseudo (> (point) bod-lim)))
(or pseudo (bobp) (> (point) bod-lim)))
;; Move forward to the start of the next declaration.
(progn (c-forward-syntactic-ws)
;; Have we got stuck in a comment at EOB?