diff options
| author | Alan Mackenzie | 2020-12-31 12:14:54 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2020-12-31 12:18:56 +0000 |
| commit | 2f8a7bcdc8c4b1ef0a5b46fb773fa7e058a20243 (patch) | |
| tree | f4f792980fa2560336454ec37904e1c2443e24a7 | |
| parent | 57d97bb170e86c77dede5456ab8fd178c3a5bf61 (diff) | |
| download | emacs-2f8a7bcdc8c4b1ef0a5b46fb773fa7e058a20243.tar.gz 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.el | 2 | ||||
| -rw-r--r-- | 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 841c3a4bb6d..72a4b070490 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el | |||
| @@ -1037,7 +1037,7 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\ | |||
| 1037 | 0 c-preprocessor-face-name)) | 1037 | 0 c-preprocessor-face-name)) |
| 1038 | 1038 | ||
| 1039 | ;; Directives | 1039 | ;; Directives |
| 1040 | '("@\\(include\\|load\\|namespace\\)\\>" 0 c-preprocessor-face-name) | 1040 | `(eval . '("@\\(include\\|load\\|namespace\\)\\>" 0 ,c-preprocessor-face-name)) |
| 1041 | 1041 | ||
| 1042 | ;; gawk debugging keywords. (acm, 2002/7/21) | 1042 | ;; gawk debugging keywords. (acm, 2002/7/21) |
| 1043 | ;; (Removed, 2003/6/6. These functions are now fontified as built-ins) | 1043 | ;; (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." | |||
| 10893 | (pp-count-out 20) ; Max number of paren/brace constructs before | 10893 | (pp-count-out 20) ; Max number of paren/brace constructs before |
| 10894 | ; we give up | 10894 | ; we give up |
| 10895 | ids ; List of identifiers in the parenthesized list. | 10895 | ids ; List of identifiers in the parenthesized list. |
| 10896 | id-start after-prec-token decl-or-cast decl-res | 10896 | id-start after-prec-token decl-or-cast |
| 10897 | c-last-identifier-range semi-position+1) | 10897 | c-last-identifier-range semi-position+1) |
| 10898 | (narrow-to-region low-lim (or macro-end (point-max))) | 10898 | (narrow-to-region low-lim (or macro-end (point-max))) |
| 10899 | 10899 | ||
| @@ -11735,7 +11735,7 @@ comment at the start of cc-engine.el for more info." | |||
| 11735 | (new-elt (list lim start end result)) | 11735 | (new-elt (list lim start end result)) |
| 11736 | big-ptr | 11736 | big-ptr |
| 11737 | (cur-ptr c-laomib-cache) | 11737 | (cur-ptr c-laomib-cache) |
| 11738 | togo togo-ptr (size 0) cur-size | 11738 | togo (size 0) cur-size |
| 11739 | ) | 11739 | ) |
| 11740 | (if old-elt (setq c-laomib-cache (delq old-elt c-laomib-cache))) | 11740 | (if old-elt (setq c-laomib-cache (delq old-elt c-laomib-cache))) |
| 11741 | 11741 | ||
| @@ -11776,27 +11776,26 @@ comment at the start of cc-engine.el for more info." | |||
| 11776 | ((<= lwm (nth 2 elt)) | 11776 | ((<= lwm (nth 2 elt)) |
| 11777 | nil) | 11777 | nil) |
| 11778 | (t | 11778 | (t |
| 11779 | (let (cur-brace) | 11779 | ;; Search for the last brace in `paren-state' before (car `lim'). This |
| 11780 | ;; Search for the last brace in `paren-state' before (car `lim'). This | 11780 | ;; brace will become our new 2nd element of `elt'. |
| 11781 | ;; brace will become our new 2nd element of `elt'. | 11781 | (while |
| 11782 | (while | 11782 | ;; Search one brace level per iteration. |
| 11783 | ;; Search one brace level per iteration. | 11783 | (and paren-state |
| 11784 | (and paren-state | 11784 | (progn |
| 11785 | (progn | 11785 | ;; (setq cur-brace (c-laomib-next-BRACE paren-state)) |
| 11786 | ;; (setq cur-brace (c-laomib-next-BRACE paren-state)) | 11786 | (while |
| 11787 | (while | 11787 | ;; Go past non-brace levels, one per iteration. |
| 11788 | ;; Go past non-brace levels, one per iteration. | 11788 | (and paren-state |
| 11789 | (and paren-state | 11789 | (not (eq (char-after |
| 11790 | (not (eq (char-after | 11790 | (c-state-cache-top-lparen paren-state)) |
| 11791 | (c-state-cache-top-lparen paren-state)) | 11791 | ?{))) |
| 11792 | ?{))) | 11792 | (setq paren-state (cdr paren-state))) |
| 11793 | (setq paren-state (cdr paren-state))) | 11793 | (cadr paren-state)) |
| 11794 | (cadr paren-state)) | 11794 | (> (c-state-cache-top-lparen (cdr paren-state)) (car elt))) |
| 11795 | (> (c-state-cache-top-lparen (cdr paren-state)) (car elt))) | 11795 | (setq paren-state (cdr paren-state))) |
| 11796 | (setq paren-state (cdr paren-state))) | 11796 | (when (cadr paren-state) |
| 11797 | (when (cadr paren-state) | 11797 | (setcar (cdr elt) (c-state-cache-top-lparen paren-state)) |
| 11798 | (setcar (cdr elt) (c-state-cache-top-lparen paren-state)) | 11798 | elt)))) |
| 11799 | elt))))) | ||
| 11800 | 11799 | ||
| 11801 | (defun c-laomib-invalidate-cache (beg _end) | 11800 | (defun c-laomib-invalidate-cache (beg _end) |
| 11802 | ;; Called from late in c-before-change. Amend `c-laomib-cache' to remove | 11801 | ;; Called from late in c-before-change. Amend `c-laomib-cache' to remove |