diff options
| author | Alan Mackenzie | 2021-04-10 19:18:28 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2021-04-10 19:20:14 +0000 |
| commit | 3f5fe0cdfc77b537d2faf148c614d9f8043bf33d (patch) | |
| tree | 22e1b9083ade6276dcc5f2288e583ec3e06f8a20 | |
| parent | 1060289f51ee1bf269bb45940892eb272d35af97 (diff) | |
| download | emacs-3f5fe0cdfc77b537d2faf148c614d9f8043bf33d.tar.gz emacs-3f5fe0cdfc77b537d2faf148c614d9f8043bf33d.zip | |
Convert CC Mode to lexical binding in Emacs
lisp/progmodes/cc-align.el, lisp/progmodes/cc-awk.el,
lisp/progmodes/cc-bytecomp.el, lisp/progmodes/cc-cmds.el,
lisp/progmodes/cc-defs.el, lisp/progmodes/cc-engine.el,
lisp/progmodes/cc-fonts.el, lisp/progmodes/cc-guess.el,
lisp/progmodes/cc-langs.el, lisp/progmodes/cc-menus.el,
lisp/progmodes/cc-mode.el, lisp/progmodes/cc-styles.el,
lisp/progmodes/cc-subword.el, lisp/progmodes/cc-vars.el: Mark these files with
a `lexical-binding' setting in line 1.
lisp/progmodes/cc-align.el, lisp/progmodes/cc-engine.el,
lisp/progmodes/cc-vars.el (c-syntactic-context, c-syntactic-element): Declare
these as special variables.
lisp/progmodes/cc-bytecomp.el (cc-bytecomp-debug-msg): prefix the parameter
ARGS with a _, and remove an `ignore' call.
lisp/progmodes/cc-cmds.el (c-where-wrt-brace-construct): Remove `kluge-start',
an unused variable.
(c-while-widening-to-decl-block): Add an extra parameter, which suppresses
the generation of a setting of variable `where'.
(c-defun-name-and-limits): Remove variable `where' from the function and use
the new argument to the previous macro.
lisp/progmodes/cc-engine.el (c-cache-to-parse-ps-state): Remove two unneeded
variables, `last' and `intermediate'.
lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): Remove unused variable.
lisp/progmodes/cc-langs.el (c-vsemi-status-unknown-p-fn): Replace the doc
string with the more precise one from stand-alone CC Mode.
lisp/progmodes/cc-styles.el (c-set-offset): Give the `ignored' parameter a
leading _.
| -rw-r--r-- | lisp/progmodes/cc-align.el | 5 | ||||
| -rw-r--r-- | lisp/progmodes/cc-awk.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-bytecomp.el | 5 | ||||
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 39 | ||||
| -rw-r--r-- | lisp/progmodes/cc-defs.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 17 | ||||
| -rw-r--r-- | lisp/progmodes/cc-fonts.el | 8 | ||||
| -rw-r--r-- | lisp/progmodes/cc-guess.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 16 | ||||
| -rw-r--r-- | lisp/progmodes/cc-menus.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-styles.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/cc-vars.el | 5 |
13 files changed, 58 insertions, 51 deletions
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index 51d51deef71..9234d0b19b9 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-align.el --- custom indentation functions for CC Mode | 1 | ;;; cc-align.el --- custom indentation functions for CC Mode -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -44,6 +44,9 @@ | |||
| 44 | (cc-require 'cc-vars) | 44 | (cc-require 'cc-vars) |
| 45 | (cc-require 'cc-engine) | 45 | (cc-require 'cc-engine) |
| 46 | 46 | ||
| 47 | (defvar c-syntactic-context) | ||
| 48 | (defvar c-syntactic-element) | ||
| 49 | |||
| 47 | 50 | ||
| 48 | ;; Standard line-up functions | 51 | ;; Standard line-up functions |
| 49 | ;; | 52 | ;; |
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index 32289443725..84cc5b115e7 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-awk.el --- AWK specific code within cc-mode. | 1 | ;;; cc-awk.el --- AWK specific code within cc-mode. -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1988, 1994, 1996, 2000-2021 Free Software Foundation, | 3 | ;; Copyright (C) 1988, 1994, 1996, 2000-2021 Free Software Foundation, |
| 4 | ;; Inc. | 4 | ;; Inc. |
diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el index 3f7caf3c2e9..29f4b81637d 100644 --- a/lisp/progmodes/cc-bytecomp.el +++ b/lisp/progmodes/cc-bytecomp.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-bytecomp.el --- compile time setup for proper compilation | 1 | ;;; cc-bytecomp.el --- compile time setup for proper compilation -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -85,8 +85,7 @@ | |||
| 85 | 85 | ||
| 86 | (defvar cc-bytecomp-environment-set nil) | 86 | (defvar cc-bytecomp-environment-set nil) |
| 87 | 87 | ||
| 88 | (defmacro cc-bytecomp-debug-msg (&rest args) | 88 | (defmacro cc-bytecomp-debug-msg (&rest _args) ; Change to ARGS when needed. |
| 89 | (ignore args) | ||
| 90 | ;;`(message ,@args) | 89 | ;;`(message ,@args) |
| 91 | ) | 90 | ) |
| 92 | 91 | ||
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index c8949448271..bee87b68499 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-cmds.el --- user level commands for CC Mode | 1 | ;;; cc-cmds.el --- user level commands for CC Mode -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -49,12 +49,11 @@ | |||
| 49 | ; which looks at this. | 49 | ; which looks at this. |
| 50 | (cc-bytecomp-defun electric-pair-post-self-insert-function) | 50 | (cc-bytecomp-defun electric-pair-post-self-insert-function) |
| 51 | (cc-bytecomp-defvar c-indent-to-body-directives) | 51 | (cc-bytecomp-defvar c-indent-to-body-directives) |
| 52 | (defvar c-syntactic-context) | ||
| 52 | 53 | ||
| 53 | ;; Indentation / Display syntax functions | 54 | ;; Indentation / Display syntax functions |
| 54 | (defvar c-fix-backslashes t) | 55 | (defvar c-fix-backslashes t) |
| 55 | 56 | ||
| 56 | (defvar c-syntactic-context) | ||
| 57 | |||
| 58 | (defun c-indent-line (&optional syntax quiet ignore-point-pos) | 57 | (defun c-indent-line (&optional syntax quiet ignore-point-pos) |
| 59 | "Indent the current line according to the syntactic context, | 58 | "Indent the current line according to the syntactic context, |
| 60 | if `c-syntactic-indentation' is non-nil. Optional SYNTAX is the | 59 | if `c-syntactic-indentation' is non-nil. Optional SYNTAX is the |
| @@ -1220,9 +1219,9 @@ numeric argument is supplied, or the point is inside a literal." | |||
| 1220 | (self-insert-command (prefix-numeric-value arg))) | 1219 | (self-insert-command (prefix-numeric-value arg))) |
| 1221 | (setq final-pos (point)) | 1220 | (setq final-pos (point)) |
| 1222 | 1221 | ||
| 1223 | ;;;; 2010-01-31: There used to be code here to put a syntax-table text | 1222 | ;;;; 2010-01-31: There used to be code here to put a syntax-table text |
| 1224 | ;;;; property on the new < or > and its mate (if any) when they are template | 1223 | ;;;; property on the new < or > and its mate (if any) when they are template |
| 1225 | ;;;; parens. This is now done in an after-change function. | 1224 | ;;;; parens. This is now done in an after-change function. |
| 1226 | 1225 | ||
| 1227 | (when (and (not arg) (not literal)) | 1226 | (when (and (not arg) (not literal)) |
| 1228 | ;; Have we got a delimiter on a #include directive? | 1227 | ;; Have we got a delimiter on a #include directive? |
| @@ -1639,9 +1638,8 @@ No indentation or other \"electric\" behavior is performed." | |||
| 1639 | ;; | 1638 | ;; |
| 1640 | ;; This function might do hidden buffer changes. | 1639 | ;; This function might do hidden buffer changes. |
| 1641 | (save-excursion | 1640 | (save-excursion |
| 1642 | (let* (kluge-start | 1641 | (let* (knr-start knr-res |
| 1643 | knr-start knr-res | 1642 | decl-result |
| 1644 | decl-result brace-decl-p | ||
| 1645 | (start (point)) | 1643 | (start (point)) |
| 1646 | (paren-state (c-parse-state)) | 1644 | (paren-state (c-parse-state)) |
| 1647 | (least-enclosing (c-least-enclosing-brace paren-state))) | 1645 | (least-enclosing (c-least-enclosing-brace paren-state))) |
| @@ -1676,7 +1674,6 @@ No indentation or other \"electric\" behavior is performed." | |||
| 1676 | (if (or (and (eolp) (not (eobp))) ; EOL is matched by "\\s>" | 1674 | (if (or (and (eolp) (not (eobp))) ; EOL is matched by "\\s>" |
| 1677 | (not (c-looking-at-non-alphnumspace))) | 1675 | (not (c-looking-at-non-alphnumspace))) |
| 1678 | (forward-char)) | 1676 | (forward-char)) |
| 1679 | (setq kluge-start (point)) | ||
| 1680 | 1677 | ||
| 1681 | (if (and least-enclosing | 1678 | (if (and least-enclosing |
| 1682 | (eq (char-after least-enclosing) ?\()) | 1679 | (eq (char-after least-enclosing) ?\()) |
| @@ -1827,12 +1824,14 @@ No indentation or other \"electric\" behavior is performed." | |||
| 1827 | nil))) | 1824 | nil))) |
| 1828 | 1825 | ||
| 1829 | (eval-and-compile | 1826 | (eval-and-compile |
| 1830 | (defmacro c-while-widening-to-decl-block (condition) | 1827 | (defmacro c-while-widening-to-decl-block (condition &optional no-where) |
| 1831 | ;; Repeatedly evaluate CONDITION until it returns nil. After each | 1828 | ;; Repeatedly evaluate CONDITION until it returns nil. After each |
| 1832 | ;; evaluation, if `c-defun-tactic' is set appropriately, widen to innards | 1829 | ;; evaluation, if `c-defun-tactic' is set appropriately, widen to innards |
| 1833 | ;; of the next enclosing declaration block (e.g. namespace, class), or the | 1830 | ;; of the next enclosing declaration block (e.g. namespace, class), or the |
| 1834 | ;; buffer's original restriction. | 1831 | ;; buffer's original restriction. |
| 1835 | ;; | 1832 | ;; |
| 1833 | ;; If NO-WHERE is non-nil, don't compile in a `(setq where ....)'. | ||
| 1834 | ;; | ||
| 1836 | ;; This is a very special purpose macro, which assumes the existence of | 1835 | ;; This is a very special purpose macro, which assumes the existence of |
| 1837 | ;; several variables. It is for use only in c-beginning-of-defun and | 1836 | ;; several variables. It is for use only in c-beginning-of-defun and |
| 1838 | ;; c-end-of-defun. | 1837 | ;; c-end-of-defun. |
| @@ -1843,7 +1842,8 @@ No indentation or other \"electric\" behavior is performed." | |||
| 1843 | (setq paren-state (c-whack-state-after lim paren-state)) | 1842 | (setq paren-state (c-whack-state-after lim paren-state)) |
| 1844 | (setq lim (c-widen-to-enclosing-decl-scope | 1843 | (setq lim (c-widen-to-enclosing-decl-scope |
| 1845 | paren-state orig-point-min orig-point-max)) | 1844 | paren-state orig-point-min orig-point-max)) |
| 1846 | (setq where 'in-block)))) | 1845 | ,@(if (not no-where) |
| 1846 | `((setq where 'in-block)))))) | ||
| 1847 | 1847 | ||
| 1848 | (def-edebug-spec c-while-widening-to-decl-block t) | 1848 | (def-edebug-spec c-while-widening-to-decl-block t) |
| 1849 | 1849 | ||
| @@ -2324,11 +2324,11 @@ with a brace block, at the outermost level of nesting." | |||
| 2324 | (c-save-buffer-state ((paren-state (c-parse-state)) | 2324 | (c-save-buffer-state ((paren-state (c-parse-state)) |
| 2325 | (orig-point-min (point-min)) | 2325 | (orig-point-min (point-min)) |
| 2326 | (orig-point-max (point-max)) | 2326 | (orig-point-max (point-max)) |
| 2327 | lim name limits where) | 2327 | lim name limits) |
| 2328 | (setq lim (c-widen-to-enclosing-decl-scope | 2328 | (setq lim (c-widen-to-enclosing-decl-scope |
| 2329 | paren-state orig-point-min orig-point-max)) | 2329 | paren-state orig-point-min orig-point-max)) |
| 2330 | (and lim (setq lim (1- lim))) | 2330 | (and lim (setq lim (1- lim))) |
| 2331 | (c-while-widening-to-decl-block (not (setq name (c-defun-name-1)))) | 2331 | (c-while-widening-to-decl-block (not (setq name (c-defun-name-1))) t) |
| 2332 | (when name | 2332 | (when name |
| 2333 | (setq limits (c-declaration-limits-1 near)) | 2333 | (setq limits (c-declaration-limits-1 near)) |
| 2334 | (cons name limits))) | 2334 | (cons name limits))) |
| @@ -2944,10 +2944,13 @@ function does not require the declaration to contain a brace block." | |||
| 2944 | (c-looking-at-special-brace-list))) | 2944 | (c-looking-at-special-brace-list))) |
| 2945 | (or allow-early-stop (/= here last)) | 2945 | (or allow-early-stop (/= here last)) |
| 2946 | (save-excursion ; Is this a check that we're NOT at top level? | 2946 | (save-excursion ; Is this a check that we're NOT at top level? |
| 2947 | ;;;; NO! This seems to check that (i) EITHER we're at the top level; OR (ii) The next enclosing | 2947 | ;;;; NO! This seems to check that (i) EITHER we're at the top level; |
| 2948 | ;;;; level of bracketing is a '{'. HMM. Doesn't seem to make sense. | 2948 | ;;;; OR (ii) The next enclosing level of bracketing is a '{'. HMM. |
| 2949 | ;;;; 2003/8/8 This might have something to do with the GCC extension "Statement Expressions", e.g. | 2949 | ;;;; Doesn't seem to make sense. |
| 2950 | ;;;; while ({stmt1 ; stmt2 ; exp ;}). This form excludes such Statement Expressions. | 2950 | ;;;; 2003/8/8 This might have something to do with the GCC extension |
| 2951 | ;;;; "Statement Expressions", e.g. | ||
| 2952 | ;;;; while ({stmt1 ; stmt2 ; exp ;}). | ||
| 2953 | ;;;; This form excludes such Statement Expressions. | ||
| 2951 | (or (not (c-safe (up-list -1) t)) | 2954 | (or (not (c-safe (up-list -1) t)) |
| 2952 | (= (char-after) ?{)))) | 2955 | (= (char-after) ?{)))) |
| 2953 | (goto-char last) | 2956 | (goto-char last) |
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 536e6766261..20dc97db5d7 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-defs.el --- compile time definitions for CC Mode | 1 | ;;; cc-defs.el --- compile time definitions for CC Mode -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index cc9833a434e..747a6fd4eda 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-engine.el --- core syntax guessing engine for CC mode -*- coding: utf-8 -*- | 1 | ;;; cc-engine.el --- core syntax guessing engine for CC mode -*- lexical-binding:t; coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -163,6 +163,8 @@ | |||
| 163 | (defvar c-doc-line-join-re) | 163 | (defvar c-doc-line-join-re) |
| 164 | (defvar c-doc-bright-comment-start-re) | 164 | (defvar c-doc-bright-comment-start-re) |
| 165 | (defvar c-doc-line-join-end-ch) | 165 | (defvar c-doc-line-join-end-ch) |
| 166 | (defvar c-syntactic-context) | ||
| 167 | (defvar c-syntactic-element) | ||
| 166 | (cc-bytecomp-defvar c-min-syn-tab-mkr) | 168 | (cc-bytecomp-defvar c-min-syn-tab-mkr) |
| 167 | (cc-bytecomp-defvar c-max-syn-tab-mkr) | 169 | (cc-bytecomp-defvar c-max-syn-tab-mkr) |
| 168 | (cc-bytecomp-defun c-clear-syn-tab) | 170 | (cc-bytecomp-defun c-clear-syn-tab) |
| @@ -2717,9 +2719,9 @@ comment at the start of cc-engine.el for more info." | |||
| 2717 | ;; two char construct (such as a comment opener or an escaped character).) | 2719 | ;; two char construct (such as a comment opener or an escaped character).) |
| 2718 | (if (and (consp elt) (>= (length elt) 3)) | 2720 | (if (and (consp elt) (>= (length elt) 3)) |
| 2719 | ;; Inside a string or comment | 2721 | ;; Inside a string or comment |
| 2720 | (let ((depth 0) (containing nil) (last nil) | 2722 | (let ((depth 0) (containing nil) |
| 2721 | in-string in-comment | 2723 | in-string in-comment |
| 2722 | (min-depth 0) com-style com-str-start (intermediate nil) | 2724 | (min-depth 0) com-style com-str-start |
| 2723 | (char-1 (nth 3 elt)) ; first char of poss. 2-char construct | 2725 | (char-1 (nth 3 elt)) ; first char of poss. 2-char construct |
| 2724 | (pos (car elt)) | 2726 | (pos (car elt)) |
| 2725 | (type (cadr elt))) | 2727 | (type (cadr elt))) |
| @@ -2736,14 +2738,13 @@ comment at the start of cc-engine.el for more info." | |||
| 2736 | (1- pos) | 2738 | (1- pos) |
| 2737 | pos)) | 2739 | pos)) |
| 2738 | (if (memq 'pps-extended-state c-emacs-features) | 2740 | (if (memq 'pps-extended-state c-emacs-features) |
| 2739 | (list depth containing last | 2741 | (list depth containing nil |
| 2740 | in-string in-comment nil | 2742 | in-string in-comment nil |
| 2741 | min-depth com-style com-str-start | 2743 | min-depth com-style com-str-start |
| 2742 | intermediate nil) | 2744 | nil nil) |
| 2743 | (list depth containing last | 2745 | (list depth containing nil |
| 2744 | in-string in-comment nil | 2746 | in-string in-comment nil |
| 2745 | min-depth com-style com-str-start | 2747 | min-depth com-style com-str-start nil))) |
| 2746 | intermediate))) | ||
| 2747 | 2748 | ||
| 2748 | ;; Not in a string or comment. | 2749 | ;; Not in a string or comment. |
| 2749 | (if (memq 'pps-extended-state c-emacs-features) | 2750 | (if (memq 'pps-extended-state c-emacs-features) |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 4e283764ceb..433b4dcf4a8 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-fonts.el --- font lock support for CC Mode | 1 | ;;; cc-fonts.el --- font lock support for CC Mode -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -2287,7 +2287,7 @@ need for `c-font-lock-extra-types'.") | |||
| 2287 | ;; font-lock-keyword-face. It always returns NIL to inhibit this and | 2287 | ;; font-lock-keyword-face. It always returns NIL to inhibit this and |
| 2288 | ;; prevent a repeat invocation. See elisp/lispref page "Search-based | 2288 | ;; prevent a repeat invocation. See elisp/lispref page "Search-based |
| 2289 | ;; fontification". | 2289 | ;; fontification". |
| 2290 | (let (pos after-name) | 2290 | (let (pos) |
| 2291 | (while (c-syntactic-re-search-forward c-using-key limit 'end) | 2291 | (while (c-syntactic-re-search-forward c-using-key limit 'end) |
| 2292 | (while ; Do one declarator of a comma separated list, each time around. | 2292 | (while ; Do one declarator of a comma separated list, each time around. |
| 2293 | (progn | 2293 | (progn |
| @@ -2295,7 +2295,6 @@ need for `c-font-lock-extra-types'.") | |||
| 2295 | (setq pos (point)) ; token after "using". | 2295 | (setq pos (point)) ; token after "using". |
| 2296 | (when (and (c-on-identifier) | 2296 | (when (and (c-on-identifier) |
| 2297 | (c-forward-name)) | 2297 | (c-forward-name)) |
| 2298 | (setq after-name (point)) | ||
| 2299 | (cond | 2298 | (cond |
| 2300 | ((eq (char-after) ?=) ; using foo = <type-id>; | 2299 | ((eq (char-after) ?=) ; using foo = <type-id>; |
| 2301 | (goto-char pos) | 2300 | (goto-char pos) |
| @@ -2305,7 +2304,8 @@ need for `c-font-lock-extra-types'.") | |||
| 2305 | (c-go-up-list-backward) | 2304 | (c-go-up-list-backward) |
| 2306 | (eq (char-after) ?{) | 2305 | (eq (char-after) ?{) |
| 2307 | (eq (car (c-beginning-of-decl-1 | 2306 | (eq (car (c-beginning-of-decl-1 |
| 2308 | (c-determine-limit 1000))) 'same) | 2307 | (c-determine-limit 1000))) |
| 2308 | 'same) | ||
| 2309 | (looking-at c-colon-type-list-re))) | 2309 | (looking-at c-colon-type-list-re))) |
| 2310 | ;; Inherited protected member: leave unfontified | 2310 | ;; Inherited protected member: leave unfontified |
| 2311 | ) | 2311 | ) |
diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el index 1b852ec4910..0824af66b43 100644 --- a/lisp/progmodes/cc-guess.el +++ b/lisp/progmodes/cc-guess.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-guess.el --- guess indentation values by scanning existing code | 1 | ;;; cc-guess.el --- guess indentation values by scanning existing code -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2006, 2011-2021 Free Software | 3 | ;; Copyright (C) 1985, 1987, 1992-2006, 2011-2021 Free Software |
| 4 | ;; Foundation, Inc. | 4 | ;; Foundation, Inc. |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index fa4e73087ef..28a15654277 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-langs.el --- language specific settings for CC Mode -*- coding: utf-8 -*- | 1 | ;;; cc-langs.el --- language specific settings for CC Mode -*- lexical-binding: t; coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -579,14 +579,12 @@ don't have EOL terminated statements. " | |||
| 579 | (c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn)) | 579 | (c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn)) |
| 580 | 580 | ||
| 581 | (c-lang-defconst c-vsemi-status-unknown-p-fn | 581 | (c-lang-defconst c-vsemi-status-unknown-p-fn |
| 582 | "Contains a predicate regarding the presence of virtual semicolons. | 582 | "A function \"are we unsure whether there is a virtual semicolon on this line?\". |
| 583 | More precisely, the function answers the question, \"are we unsure whether a | 583 | The (admittedly kludgy) purpose of such a function is to prevent an infinite |
| 584 | virtual semicolon exists on this line?\". The (admittedly kludgy) purpose of | 584 | recursion in c-beginning-of-statement-1 when point starts at a `while' token. |
| 585 | such a function is to prevent an infinite recursion in | 585 | The function MUST NOT UNDER ANY CIRCUMSTANCES call `c-beginning-of-statement-1', |
| 586 | `c-beginning-of-statement-1' when point starts at a `while' token. The function | 586 | even indirectly. This variable contains nil for languages which don't have |
| 587 | MUST NOT UNDER ANY CIRCUMSTANCES call `c-beginning-of-statement-1', even | 587 | EOL terminated statements." |
| 588 | indirectly. This variable contains nil for languages which don't have EOL | ||
| 589 | terminated statements." | ||
| 590 | t nil | 588 | t nil |
| 591 | (c c++ objc) 'c-macro-vsemi-status-unknown-p | 589 | (c c++ objc) 'c-macro-vsemi-status-unknown-p |
| 592 | awk 'c-awk-vsemi-status-unknown-p) | 590 | awk 'c-awk-vsemi-status-unknown-p) |
diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index 0ff6efb7d37..a099ec1de95 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-menus.el --- imenu support for CC Mode | 1 | ;;; cc-menus.el --- imenu support for CC Mode -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index cfb23d0d45e..dae0062efb5 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-mode.el --- major mode for editing C and similar languages | 1 | ;;; cc-mode.el --- major mode for editing C and similar languages -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 29cbe54c3bd..77cad77711a 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-styles.el --- support for styles in CC Mode | 1 | ;;; cc-styles.el --- support for styles in CC Mode -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -464,7 +464,7 @@ STYLE using `c-set-style' if the optional SET-P flag is non-nil." | |||
| 464 | offset)) | 464 | offset)) |
| 465 | 465 | ||
| 466 | ;;;###autoload | 466 | ;;;###autoload |
| 467 | (defun c-set-offset (symbol offset &optional ignored) | 467 | (defun c-set-offset (symbol offset &optional _ignored) |
| 468 | "Change the value of a syntactic element symbol in `c-offsets-alist'. | 468 | "Change the value of a syntactic element symbol in `c-offsets-alist'. |
| 469 | SYMBOL is the syntactic element symbol to change and OFFSET is the new | 469 | SYMBOL is the syntactic element symbol to change and OFFSET is the new |
| 470 | offset for that syntactic element. The optional argument is not used | 470 | offset for that syntactic element. The optional argument is not used |
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 88ee092da79..b33fea0b48c 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cc-vars.el --- user customization variables for CC Mode | 1 | ;;; cc-vars.el --- user customization variables for CC Mode -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -42,6 +42,9 @@ | |||
| 42 | 42 | ||
| 43 | (cc-require 'cc-defs) | 43 | (cc-require 'cc-defs) |
| 44 | 44 | ||
| 45 | (defvar c-syntactic-context) | ||
| 46 | (defvar c-syntactic-element) | ||
| 47 | |||
| 45 | (cc-eval-when-compile | 48 | (cc-eval-when-compile |
| 46 | (require 'custom) | 49 | (require 'custom) |
| 47 | (require 'widget)) | 50 | (require 'widget)) |