emacs-diffs
[Top][All Lists]
Advanced

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

master 2f8a7bc: CC Mode. Fix AWK Mode fontification bug, remove some un


From: Alan Mackenzie
Subject: master 2f8a7bc: CC Mode. Fix AWK Mode fontification bug, remove some unused variables
Date: Thu, 31 Dec 2020 07:19:13 -0500 (EST)

branch: master
commit 2f8a7bcdc8c4b1ef0a5b46fb773fa7e058a20243
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    CC Mode.  Fix AWK Mode fontification bug, remove some unused variables
    
    * lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Replace a hard use of
    c-preprocessor-face-name by an `eval' expression which evaluates it.
    
    * lisp/progmodes/cc-engine.el (c-in-knr-argdecl, c-laomib-put-cache)
    (c-laomib-fix-elt): Remove unused bound variables.
---
 lisp/progmodes/cc-awk.el    |  2 +-
 lisp/progmodes/cc-engine.el | 45 ++++++++++++++++++++++-----------------------
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el
index 841c3a4..72a4b07 100644
--- a/lisp/progmodes/cc-awk.el
+++ b/lisp/progmodes/cc-awk.el
@@ -1037,7 +1037,7 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\
               0 c-preprocessor-face-name))
 
      ;; Directives
-     '("@\\(include\\|load\\|namespace\\)\\>" 0 c-preprocessor-face-name)
+     `(eval . '("@\\(include\\|load\\|namespace\\)\\>" 0 
,c-preprocessor-face-name))
 
      ;; gawk debugging keywords.  (acm, 2002/7/21)
      ;; (Removed, 2003/6/6.  These functions are now fontified as built-ins)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 51f620e..7444f0f 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10893,7 +10893,7 @@ comment at the start of cc-engine.el for more info."
             (pp-count-out 20)   ; Max number of paren/brace constructs before
                                        ; we give up
             ids              ; List of identifiers in the parenthesized list.
-            id-start after-prec-token decl-or-cast decl-res
+            id-start after-prec-token decl-or-cast
             c-last-identifier-range semi-position+1)
        (narrow-to-region low-lim (or macro-end (point-max)))
 
@@ -11735,7 +11735,7 @@ comment at the start of cc-engine.el for more info."
          (new-elt (list lim start end result))
          big-ptr
          (cur-ptr c-laomib-cache)
-         togo togo-ptr (size 0) cur-size
+         togo (size 0) cur-size
          )
       (if old-elt (setq c-laomib-cache (delq old-elt c-laomib-cache)))
 
@@ -11776,27 +11776,26 @@ comment at the start of cc-engine.el for more info."
    ((<= lwm (nth 2 elt))
     nil)
    (t
-    (let (cur-brace)
-      ;; Search for the last brace in `paren-state' before (car `lim').  This
-      ;; brace will become our new 2nd element of `elt'.
-      (while
-         ;; Search one brace level per iteration.
-         (and paren-state
-              (progn
-                ;; (setq cur-brace (c-laomib-next-BRACE paren-state))
-                (while
-                    ;; Go past non-brace levels, one per iteration.
-                    (and paren-state
-                         (not (eq (char-after
-                                   (c-state-cache-top-lparen paren-state))
-                                  ?{)))
-                  (setq paren-state (cdr paren-state)))
-                (cadr paren-state))
-              (> (c-state-cache-top-lparen (cdr paren-state)) (car elt)))
-       (setq paren-state (cdr paren-state)))
-      (when (cadr paren-state)
-       (setcar (cdr elt) (c-state-cache-top-lparen paren-state))
-       elt)))))
+    ;; Search for the last brace in `paren-state' before (car `lim').  This
+    ;; brace will become our new 2nd element of `elt'.
+    (while
+       ;; Search one brace level per iteration.
+       (and paren-state
+            (progn
+              ;; (setq cur-brace (c-laomib-next-BRACE paren-state))
+              (while
+                  ;; Go past non-brace levels, one per iteration.
+                  (and paren-state
+                       (not (eq (char-after
+                                 (c-state-cache-top-lparen paren-state))
+                                ?{)))
+                (setq paren-state (cdr paren-state)))
+              (cadr paren-state))
+            (> (c-state-cache-top-lparen (cdr paren-state)) (car elt)))
+      (setq paren-state (cdr paren-state)))
+    (when (cadr paren-state)
+      (setcar (cdr elt) (c-state-cache-top-lparen paren-state))
+      elt))))
 
 (defun c-laomib-invalidate-cache (beg _end)
   ;; Called from late in c-before-change.  Amend `c-laomib-cache' to remove



reply via email to

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