summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2020-12-31 12:14:54 +0000
committerAlan Mackenzie <acm@muc.de>2020-12-31 12:18:56 +0000
commit2f8a7bcdc8c4b1ef0a5b46fb773fa7e058a20243 (patch)
treef4f792980fa2560336454ec37904e1c2443e24a7
parent57d97bb170e86c77dede5456ab8fd178c3a5bf61 (diff)
downloademacs-2f8a7bcdc8c4b1ef0a5b46fb773fa7e058a20243.tar.gz
emacs-2f8a7bcdc8c4b1ef0a5b46fb773fa7e058a20243.tar.bz2
emacs-2f8a7bcdc8c4b1ef0a5b46fb773fa7e058a20243.zip
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.
-rw-r--r--lisp/progmodes/cc-awk.el2
-rw-r--r--lisp/progmodes/cc-engine.el45
2 files changed, 23 insertions, 24 deletions
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el
index 841c3a4bb6d..72a4b070490 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 51f620ea1f0..7444f0f8051 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