emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 086cb1b5902: CC Mode: fix minor errors in the fontification of en


From: Alan Mackenzie
Subject: master 086cb1b5902: CC Mode: fix minor errors in the fontification of enums.
Date: Sat, 21 Sep 2024 12:49:02 -0400 (EDT)

branch: master
commit 086cb1b590251ca353fec5a841ea882cdf9cbcb2
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    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.
---
 lisp/progmodes/cc-engine.el | 5 +----
 lisp/progmodes/cc-mode.el   | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 4c319a78e01..25e696487cd 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -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
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 8ce4da56ef7..35516a53bae 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]