]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: fix minor errors in the fontification of enums.
authorAlan Mackenzie <acm@muc.de>
Sat, 21 Sep 2024 16:46:32 +0000 (16:46 +0000)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Sep 2024 10:45:28 +0000 (12:45 +0200)
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.

(cherry picked from commit 086cb1b590251ca353fec5a841ea882cdf9cbcb2)

lisp/progmodes/cc-engine.el
lisp/progmodes/cc-mode.el

index 1ffca7365ea1fe01ea50fe068984d0e9b68c315c..30006054de7b8a06ac9524055e6d1697fb0d7053 100644 (file)
@@ -10044,7 +10044,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
@@ -10177,9 +10177,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
index 93bfad1df3996bce358f7ef06a1bf82a24c528cf..a10a41e82b6f2b2aed38801f46550a5668a1eea3 100644 (file)
@@ -2453,7 +2453,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?