Commit 03c45536 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

Merge trivially safe differences from standalone CC-mode.

* lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Don't quote a symbol
just to then pass it to `symbol-value'.
(prog-mode): Provide fallback definition, if needed.
* lisp/progmodes/cc-langs.el: Always load `cl'.  Don't load `cl-lib'.
Remove "cl-" prefix accordingly.
* lisp/progmodes/cc-fonts.el (c-font-lock-invalid-string): Use integerp or
characterp depending on the type of characters.
(c-font-lock-enum-tail): Remove unused var `start'.
* lisp/progmodes/cc-engine.el: Load CL at compile-time.
(c-declare-lang-variables): Use mapcan.
(c-append-to-state-cache): Remove unused var `ce+1'.
(c-parse-state-state): Make buffer-local.
(c-ssb-lit-begin): Remove unused var `pps-end-pos'.
(c-just-after-func-arglist-p): Remove unused var `end'.
* lisp/progmodes/cc-defs.el: Load cc-fix if delete-dups is undefined.
(c-<-as-paren-syntax, c->-as-paren-syntax): Move definition earlier.
(c-make-keywords-re): Use delete-dups.
(c-get-current-file): Avoid file-name-base.
* lisp/progmodes/cc-cmds.el (c-electric-lt-gt): Remove unused var
`close-paren-inserted'.
* lisp/progmodes/cc-awk.el (c-forward-sws): Remove unused declaration.
parent 94ab176a
2014-10-04 Stefan Monnier <monnier@iro.umontreal.ca> 2014-10-04 Stefan Monnier <monnier@iro.umontreal.ca>
   
Merge trivially safe differences from standalone CC-mode.
* progmodes/cc-mode.el (c-initialize-cc-mode): Don't quote a symbol
just to then pass it to `symbol-value'.
(prog-mode): Provide fallback definition, if needed.
* progmodes/cc-langs.el: Always load `cl'. Don't load `cl-lib'.
Remove "cl-" prefix accordingly.
* progmodes/cc-fonts.el (c-font-lock-invalid-string): Use integerp or
characterp depending on the type of characters.
(c-font-lock-enum-tail): Remove unused var `start'.
* progmodes/cc-engine.el: Load CL at compile-time.
(c-declare-lang-variables): Use mapcan.
(c-append-to-state-cache): Remove unused var `ce+1'.
(c-parse-state-state): Make buffer-local.
(c-ssb-lit-begin): Remove unused var `pps-end-pos'.
(c-just-after-func-arglist-p): Remove unused var `end'.
* progmodes/cc-defs.el: Load cc-fix if delete-dups is undefined.
(c-<-as-paren-syntax, c->-as-paren-syntax): Move definition earlier.
(c-make-keywords-re): Use delete-dups.
(c-get-current-file): Avoid file-name-base.
* progmodes/cc-cmds.el (c-electric-lt-gt): Remove unused var
`close-paren-inserted'.
* progmodes/cc-awk.el (c-forward-sws): Remove unused declaration.
* progmodes/python.el: Avoid building unneeded markers. * progmodes/python.el: Avoid building unneeded markers.
(python-font-lock-keywords, python-indent-dedent-line) (python-font-lock-keywords, python-indent-dedent-line)
(python-fill-paren, python-shell-completion-complete-or-indent): (python-fill-paren, python-shell-completion-complete-or-indent):
......
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
(cc-bytecomp-defun c-backward-token-1) (cc-bytecomp-defun c-backward-token-1)
(cc-bytecomp-defun c-beginning-of-statement-1) (cc-bytecomp-defun c-beginning-of-statement-1)
(cc-bytecomp-defun c-backward-sws) (cc-bytecomp-defun c-backward-sws)
(cc-bytecomp-defun c-forward-sws)
(defvar awk-mode-syntax-table (defvar awk-mode-syntax-table
(let ((st (make-syntax-table))) (let ((st (make-syntax-table)))
......
...@@ -1090,7 +1090,7 @@ numeric argument is supplied, or the point is inside a literal." ...@@ -1090,7 +1090,7 @@ numeric argument is supplied, or the point is inside a literal."
(interactive "*P") (interactive "*P")
(let ((c-echo-syntactic-information-p nil) (let ((c-echo-syntactic-information-p nil)
final-pos close-paren-inserted found-delim case-fold-search) final-pos found-delim case-fold-search)
(self-insert-command (prefix-numeric-value arg)) (self-insert-command (prefix-numeric-value arg))
(setq final-pos (point)) (setq final-pos (point))
......
...@@ -86,6 +86,11 @@ ...@@ -86,6 +86,11 @@
font-lock-keywords))) font-lock-keywords)))
(cc-load "cc-fix"))) (cc-load "cc-fix")))
;; XEmacs 21.4 doesn't have `delete-dups'.
(eval-and-compile
(if (and (not (fboundp 'delete-dups))
(not (featurep 'cc-fix)))
(cc-load "cc-fix")))
;;; Variables also used at compile time. ;;; Variables also used at compile time.
...@@ -913,6 +918,12 @@ MODE is either a mode symbol or a list of mode symbols." ...@@ -913,6 +918,12 @@ MODE is either a mode symbol or a list of mode symbols."
(cc-bytecomp-fboundp 'delete-extent) (cc-bytecomp-fboundp 'delete-extent)
(cc-bytecomp-fboundp 'map-extents)))) (cc-bytecomp-fboundp 'map-extents))))
(defconst c-<-as-paren-syntax '(4 . ?>))
(put 'c-<-as-paren-syntax 'syntax-table c-<-as-paren-syntax)
(defconst c->-as-paren-syntax '(5 . ?<))
(put 'c->-as-paren-syntax 'syntax-table c->-as-paren-syntax)
;; `c-put-char-property' is complex enough in XEmacs and Emacs < 21 to ;; `c-put-char-property' is complex enough in XEmacs and Emacs < 21 to
;; make it a function. ;; make it a function.
(defalias 'c-put-char-property-fun (defalias 'c-put-char-property-fun
...@@ -1188,9 +1199,6 @@ been put there by c-put-char-property. POINT remains unchanged." ...@@ -1188,9 +1199,6 @@ been put there by c-put-char-property. POINT remains unchanged."
(if (< (point) start) (if (< (point) start)
(goto-char (point-max))))) (goto-char (point-max)))))
(defconst c-<-as-paren-syntax '(4 . ?>))
(put 'c-<-as-paren-syntax 'syntax-table c-<-as-paren-syntax)
(defsubst c-mark-<-as-paren (pos) (defsubst c-mark-<-as-paren (pos)
;; Mark the "<" character at POS as a template opener using the ;; Mark the "<" character at POS as a template opener using the
;; `syntax-table' property via the `category' property. ;; `syntax-table' property via the `category' property.
...@@ -1201,9 +1209,6 @@ been put there by c-put-char-property. POINT remains unchanged." ...@@ -1201,9 +1209,6 @@ been put there by c-put-char-property. POINT remains unchanged."
;; cheaply. We use this, for instance, in `c-parse-state'. ;; cheaply. We use this, for instance, in `c-parse-state'.
(c-put-char-property pos 'category 'c-<-as-paren-syntax)) (c-put-char-property pos 'category 'c-<-as-paren-syntax))
(defconst c->-as-paren-syntax '(5 . ?<))
(put 'c->-as-paren-syntax 'syntax-table c->-as-paren-syntax)
(defsubst c-mark->-as-paren (pos) (defsubst c-mark->-as-paren (pos)
;; Mark the ">" character at POS as an sexp list closer using the ;; Mark the ">" character at POS as an sexp list closer using the
;; syntax-table property. ;; syntax-table property.
...@@ -1419,8 +1424,8 @@ Notably, null elements in LIST are ignored." ...@@ -1419,8 +1424,8 @@ Notably, null elements in LIST are ignored."
(defun c-make-keywords-re (adorn list &optional mode) (defun c-make-keywords-re (adorn list &optional mode)
"Make a regexp that matches all the strings the list. "Make a regexp that matches all the strings the list.
Duplicates and nil elements in the list are removed. The resulting Duplicates and nil elements in the list are removed. The
regexp may contain zero or more submatch expressions. resulting regexp may contain zero or more submatch expressions.
If ADORN is t there will be at least one submatch and the first If ADORN is t there will be at least one submatch and the first
surrounds the matched alternative, and the regexp will also not match surrounds the matched alternative, and the regexp will also not match
...@@ -1438,11 +1443,7 @@ The optional MODE specifies the language to get `c-nonsymbol-key' from ...@@ -1438,11 +1443,7 @@ The optional MODE specifies the language to get `c-nonsymbol-key' from
when it's needed. The default is the current language taken from when it's needed. The default is the current language taken from
`c-buffer-is-cc-mode'." `c-buffer-is-cc-mode'."
(let (unique) (setq list (delete nil (delete-dups list)))
(dolist (elt list)
(unless (member elt unique)
(push elt unique)))
(setq list (delete nil unique)))
(if list (if list
(let (re) (let (re)
...@@ -1638,13 +1639,13 @@ non-nil, a caret is prepended to invert the set." ...@@ -1638,13 +1639,13 @@ non-nil, a caret is prepended to invert the set."
"support for the `syntax-table' text property " "support for the `syntax-table' text property "
"is required."))) "is required.")))
;; Find out if generic comment delimiters work. ;; Find out if "\\s!" (generic comment delimiters) work.
(c-safe (c-safe
(modify-syntax-entry ?x "!") (modify-syntax-entry ?x "!")
(if (string-match "\\s!" "x") (if (string-match "\\s!" "x")
(setq list (cons 'gen-comment-delim list)))) (setq list (cons 'gen-comment-delim list))))
;; Find out if generic string delimiters work. ;; Find out if "\\s|" (generic string delimiters) work.
(c-safe (c-safe
(modify-syntax-entry ?x "|") (modify-syntax-entry ?x "|")
(if (string-match "\\s|" "x") (if (string-match "\\s|" "x")
...@@ -1691,7 +1692,8 @@ non-nil, a caret is prepended to invert the set." ...@@ -1691,7 +1692,8 @@ non-nil, a caret is prepended to invert the set."
(kill-buffer buf)) (kill-buffer buf))
;; See if `parse-partial-sexp' returns the eighth element. ;; See if `parse-partial-sexp' returns the eighth element.
(if (c-safe (>= (length (save-excursion (parse-partial-sexp (point) (point)))) (if (c-safe (>= (length (save-excursion
(parse-partial-sexp (point) (point))))
10)) 10))
(setq list (cons 'pps-extended-state list)) (setq list (cons 'pps-extended-state list))
(error (concat (error (concat
...@@ -1707,9 +1709,8 @@ might be present: ...@@ -1707,9 +1709,8 @@ might be present:
'8-bit 8 bit syntax entry flags (XEmacs style). '8-bit 8 bit syntax entry flags (XEmacs style).
'1-bit 1 bit syntax entry flags (Emacs style). '1-bit 1 bit syntax entry flags (Emacs style).
'argumentative-bod-function beginning-of-defun passes ARG through 'argumentative-bod-function beginning-of-defun and end-of-defun pass
to a non-null beginning-of-defun-function. It is assumed ARG through to beginning/end-of-defun-function.
the end-of-defun does the same thing.
'syntax-properties It works to override the syntax for specific characters 'syntax-properties It works to override the syntax for specific characters
in the buffer with the 'syntax-table property. It's in the buffer with the 'syntax-table property. It's
always set - CC Mode no longer works in emacsen without always set - CC Mode no longer works in emacsen without
...@@ -1803,18 +1804,18 @@ system." ...@@ -1803,18 +1804,18 @@ system."
(error "Unknown base mode `%s'" base-mode)) (error "Unknown base mode `%s'" base-mode))
(put mode 'c-fallback-mode base-mode)) (put mode 'c-fallback-mode base-mode))
(defvar c-lang-constants (make-vector 151 0) (defvar c-lang-constants (make-vector 151 0))
"Obarray used as a cache to keep track of the language constants. ;; Obarray used as a cache to keep track of the language constants.
The constants stored are those defined by `c-lang-defconst' and the values ;; The constants stored are those defined by `c-lang-defconst' and the values
computed by `c-lang-const'. It's mostly used at compile time but it's not ;; computed by `c-lang-const'. It's mostly used at compile time but it's not
stored in compiled files. ;; stored in compiled files.
The obarray contains all the language constants as symbols. The ;; The obarray contains all the language constants as symbols. The
value cells hold the evaluated values as alists where each car is ;; value cells hold the evaluated values as alists where each car is
the mode name symbol and the corresponding cdr is the evaluated ;; the mode name symbol and the corresponding cdr is the evaluated
value in that mode. The property lists hold the source definitions ;; value in that mode. The property lists hold the source definitions
and other miscellaneous data. The obarray might also contain ;; and other miscellaneous data. The obarray might also contain
various other symbols, but those don't have any variable bindings.") ;; various other symbols, but those don't have any variable bindings.
(defvar c-lang-const-expansion nil) (defvar c-lang-const-expansion nil)
...@@ -1831,7 +1832,9 @@ various other symbols, but those don't have any variable bindings.") ...@@ -1831,7 +1832,9 @@ various other symbols, but those don't have any variable bindings.")
(t (t
;; Being evaluated interactively. ;; Being evaluated interactively.
(buffer-file-name))))) (buffer-file-name)))))
(and file (file-name-base file)))) (and file
(file-name-sans-extension
(file-name-nondirectory file)))))
(defmacro c-lang-defconst-eval-immediately (form) (defmacro c-lang-defconst-eval-immediately (form)
"Can be used inside a VAL in `c-lang-defconst' to evaluate FORM "Can be used inside a VAL in `c-lang-defconst' to evaluate FORM
......
This diff is collapsed.
...@@ -366,39 +366,7 @@ ...@@ -366,39 +366,7 @@
(parse-sexp-lookup-properties (parse-sexp-lookup-properties
(cc-eval-when-compile (cc-eval-when-compile
(boundp 'parse-sexp-lookup-properties)))) (boundp 'parse-sexp-lookup-properties))))
;; (while (re-search-forward ,regexp limit t)
;; (unless (progn
;; (goto-char (match-beginning 0))
;; (c-skip-comments-and-strings limit))
;; (goto-char (match-end 0))
;; ,@(mapcar
;; (lambda (highlight)
;; (if (integerp (car highlight))
;; (progn
;; (unless (eq (nth 2 highlight) t)
;; (error
;; "The override flag must currently be t in %s"
;; highlight))
;; (when (nth 3 highlight)
;; (error
;; "The laxmatch flag may currently not be set in %s"
;; highlight))
;; `(save-match-data
;; (c-put-font-lock-face
;; (match-beginning ,(car highlight))
;; (match-end ,(car highlight))
;; ,(elt highlight 1))))
;; (when (nth 3 highlight)
;; (error "Match highlights currently not supported in %s"
;; highlight))
;; `(progn
;; ,(nth 1 highlight)
;; (save-match-data ,(car highlight))
;; ,(nth 2 highlight))))
;; highlights)))
,(c-make-font-lock-search-form regexp highlights)) ,(c-make-font-lock-search-form regexp highlights))
nil))) nil)))
(defun c-make-font-lock-BO-decl-search-function (regexp &rest highlights) (defun c-make-font-lock-BO-decl-search-function (regexp &rest highlights)
...@@ -716,7 +684,11 @@ stuff. Used on level 1 and higher." ...@@ -716,7 +684,11 @@ stuff. Used on level 1 and higher."
(let ((start (1- (point)))) (let ((start (1- (point))))
(save-excursion (save-excursion
(and (eq (elt (parse-partial-sexp start (c-point 'eol)) 8) start) (and (eq (elt (parse-partial-sexp start (c-point 'eol)) 8) start)
(if (integerp c-multiline-string-start-char) (if (if (eval-when-compile (integerp ?c))
;; Emacs
(integerp c-multiline-string-start-char)
;; XEmacs
(characterp c-multiline-string-start-char))
;; There's no multiline string start char before the ;; There's no multiline string start char before the
;; string, so newlines aren't allowed. ;; string, so newlines aren't allowed.
(not (eq (char-before start) c-multiline-string-start-char)) (not (eq (char-before start) c-multiline-string-start-char))
...@@ -1151,7 +1123,6 @@ casts and declarations are fontified. Used on level 2 and higher." ...@@ -1151,7 +1123,6 @@ casts and declarations are fontified. Used on level 2 and higher."
(when list (when list
;; Jump past any initializer or function prototype to see if ;; Jump past any initializer or function prototype to see if
;; there's a ',' to continue at. ;; there's a ',' to continue at.
(cond ((eq id-face 'font-lock-function-name-face) (cond ((eq id-face 'font-lock-function-name-face)
;; Skip a parenthesized initializer (C++) or a function ;; Skip a parenthesized initializer (C++) or a function
;; prototype. ;; prototype.
...@@ -1219,8 +1190,8 @@ casts and declarations are fontified. Used on level 2 and higher." ...@@ -1219,8 +1190,8 @@ casts and declarations are fontified. Used on level 2 and higher."
;; o - nil, if not in an arglist at all. This includes the ;; o - nil, if not in an arglist at all. This includes the
;; parenthesized condition which follows "if", "while", etc. ;; parenthesized condition which follows "if", "while", etc.
context context
;; The position of the next token after the closing paren of ;; A list of starting positions of possible type declarations, or of
;; the last detected cast. ;; the typedef preceding one, if any.
last-cast-end last-cast-end
;; The result from `c-forward-decl-or-cast-1'. ;; The result from `c-forward-decl-or-cast-1'.
decl-or-cast decl-or-cast
...@@ -1564,9 +1535,7 @@ casts and declarations are fontified. Used on level 2 and higher." ...@@ -1564,9 +1535,7 @@ casts and declarations are fontified. Used on level 2 and higher."
;; Note that this function won't attempt to fontify beyond the end of the ;; Note that this function won't attempt to fontify beyond the end of the
;; current enum block, if any. ;; current enum block, if any.
(let* ((paren-state (c-parse-state)) (let* ((paren-state (c-parse-state))
(encl-pos (c-most-enclosing-brace paren-state)) (encl-pos (c-most-enclosing-brace paren-state)))
(start (point))
)
(when (and (when (and
encl-pos encl-pos
(eq (char-after encl-pos) ?\{) (eq (char-after encl-pos) ?\{)
......
...@@ -519,7 +519,8 @@ is called with one argument, the guessed style." ...@@ -519,7 +519,8 @@ is called with one argument, the guessed style."
(goto-char (point-min)) (goto-char (point-min))
(when (search-forward (concat "(" (when (search-forward (concat "("
(symbol-name (car needs-markers)) (symbol-name (car needs-markers))
" ") nil t) " ")
nil t)
(move-end-of-line 1) (move-end-of-line 1)
(comment-dwim nil) (comment-dwim nil)
(insert " Guessed value")) (insert " Guessed value"))
......
...@@ -130,9 +130,7 @@ ...@@ -130,9 +130,7 @@
;; This file is not always loaded. See note above. ;; This file is not always loaded. See note above.
;; Except it is always loaded - see bug#17463. (cc-external-require 'cl)
;;;(cc-external-require 'cl)
(require 'cl-lib)
;;; Setup for the `c-lang-defvar' system. ;;; Setup for the `c-lang-defvar' system.
...@@ -253,14 +251,14 @@ the evaluated constant value at compile time." ...@@ -253,14 +251,14 @@ the evaluated constant value at compile time."
(unless xlate (unless xlate
(setq xlate 'identity)) (setq xlate 'identity))
(c-with-syntax-table (c-lang-const c-mode-syntax-table) (c-with-syntax-table (c-lang-const c-mode-syntax-table)
(cl-delete-duplicates (delete-duplicates
(cl-mapcan (lambda (opgroup) (mapcan (lambda (opgroup)
(when (if (symbolp (car opgroup)) (when (if (symbolp (car opgroup))
(when (funcall opgroup-filter (car opgroup)) (when (funcall opgroup-filter (car opgroup))
(setq opgroup (cdr opgroup)) (setq opgroup (cdr opgroup))
t) t)
t) t)
(cl-mapcan (lambda (op) (mapcan (lambda (op)
(when (funcall op-filter op) (when (funcall op-filter op)
(let ((res (funcall xlate op))) (let ((res (funcall xlate op)))
(if (listp res) res (list res))))) (if (listp res) res (list res)))))
...@@ -301,7 +299,8 @@ the evaluated constant value at compile time." ...@@ -301,7 +299,8 @@ the evaluated constant value at compile time."
["Set Style..." c-set-style t] ["Set Style..." c-set-style t]
["Show Current Style Name" (message ["Show Current Style Name" (message
"Style Name: %s" "Style Name: %s"
c-indentation-style) t] c-indentation-style)
t]
["Guess Style from this Buffer" c-guess-buffer-no-install t] ["Guess Style from this Buffer" c-guess-buffer-no-install t]
["Install the Last Guessed Style..." c-guess-install ["Install the Last Guessed Style..." c-guess-install
(and c-guess-guessed-offsets-alist (and c-guess-guessed-offsets-alist
...@@ -1155,7 +1154,7 @@ operators." ...@@ -1155,7 +1154,7 @@ operators."
(c-lang-defconst c-all-op-syntax-tokens (c-lang-defconst c-all-op-syntax-tokens
;; List of all tokens in the punctuation and parenthesis syntax ;; List of all tokens in the punctuation and parenthesis syntax
;; classes. ;; classes.
t (cl-delete-duplicates (append (c-lang-const c-other-op-syntax-tokens) t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
(c-lang-const c-operator-list)) (c-lang-const c-operator-list))
:test 'string-equal)) :test 'string-equal))
...@@ -1587,13 +1586,14 @@ properly." ...@@ -1587,13 +1586,14 @@ properly."
(c-lang-defvar c-syntactic-eol (c-lang-const c-syntactic-eol)) (c-lang-defvar c-syntactic-eol (c-lang-const c-syntactic-eol))
;;; Defun functions ;;; Defun handling.
;; The Emacs variables beginning-of-defun-function and ;; The Emacs variables beginning-of-defun-function and end-of-defun-function
;; end-of-defun-function will be set so that commands like ;; will be set so that commands like `mark-defun' and `narrow-to-defun' work
;; `mark-defun' and `narrow-to-defun' work right. The key sequences ;; right. In older Emacsen, the key sequences C-M-a and C-M-e are, however,
;; C-M-a and C-M-e are, however, bound directly to the CC Mode ;; bound directly to the CC Mode functions, allowing optimisation for large n.
;; functions, allowing optimization for large n. ;; From Emacs 23, this isn't necessary any more, since n is passed to the two
;; functions.
(c-lang-defconst beginning-of-defun-function (c-lang-defconst beginning-of-defun-function
"Function to which beginning-of-defun-function will be set." "Function to which beginning-of-defun-function will be set."
t 'c-beginning-of-defun t 'c-beginning-of-defun
...@@ -1754,7 +1754,7 @@ not the type face." ...@@ -1754,7 +1754,7 @@ not the type face."
(c-lang-defconst c-type-start-kwds (c-lang-defconst c-type-start-kwds
;; All keywords that can start a type (i.e. are either a type prefix ;; All keywords that can start a type (i.e. are either a type prefix
;; or a complete type). ;; or a complete type).
t (cl-delete-duplicates (append (c-lang-const c-primitive-type-kwds) t (delete-duplicates (append (c-lang-const c-primitive-type-kwds)
(c-lang-const c-type-prefix-kwds) (c-lang-const c-type-prefix-kwds)
(c-lang-const c-type-modifier-kwds)) (c-lang-const c-type-modifier-kwds))
:test 'string-equal)) :test 'string-equal))
...@@ -1998,7 +1998,7 @@ one of `c-type-list-kwds', `c-ref-list-kwds', ...@@ -1998,7 +1998,7 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
;; something is a type or just some sort of macro in front of the ;; something is a type or just some sort of macro in front of the
;; declaration. They might be ambiguous with types or type ;; declaration. They might be ambiguous with types or type
;; prefixes. ;; prefixes.
t (cl-delete-duplicates (append (c-lang-const c-class-decl-kwds) t (delete-duplicates (append (c-lang-const c-class-decl-kwds)
(c-lang-const c-brace-list-decl-kwds) (c-lang-const c-brace-list-decl-kwds)
(c-lang-const c-other-block-decl-kwds) (c-lang-const c-other-block-decl-kwds)
(c-lang-const c-typedef-decl-kwds) (c-lang-const c-typedef-decl-kwds)
...@@ -2192,7 +2192,7 @@ type identifiers separated by arbitrary tokens." ...@@ -2192,7 +2192,7 @@ type identifiers separated by arbitrary tokens."
pike '("array" "function" "int" "mapping" "multiset" "object" "program")) pike '("array" "function" "int" "mapping" "multiset" "object" "program"))
(c-lang-defconst c-paren-any-kwds (c-lang-defconst c-paren-any-kwds
t (cl-delete-duplicates (append (c-lang-const c-paren-nontype-kwds) t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
(c-lang-const c-paren-type-kwds)) (c-lang-const c-paren-type-kwds))
:test 'string-equal)) :test 'string-equal))
...@@ -2218,7 +2218,7 @@ assumed to be set if this isn't nil." ...@@ -2218,7 +2218,7 @@ assumed to be set if this isn't nil."
(c-lang-defconst c-<>-sexp-kwds (c-lang-defconst c-<>-sexp-kwds
;; All keywords that can be followed by an angle bracket sexp. ;; All keywords that can be followed by an angle bracket sexp.
t (cl-delete-duplicates (append (c-lang-const c-<>-type-kwds) t (delete-duplicates (append (c-lang-const c-<>-type-kwds)
(c-lang-const c-<>-arglist-kwds)) (c-lang-const c-<>-arglist-kwds))
:test 'string-equal)) :test 'string-equal))
...@@ -2278,7 +2278,7 @@ Keywords here should also be in `c-block-stmt-1-kwds'." ...@@ -2278,7 +2278,7 @@ Keywords here should also be in `c-block-stmt-1-kwds'."
(c-lang-defconst c-block-stmt-kwds (c-lang-defconst c-block-stmt-kwds
;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'. ;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'.
t (cl-delete-duplicates (append (c-lang-const c-block-stmt-1-kwds) t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
(c-lang-const c-block-stmt-2-kwds)) (c-lang-const c-block-stmt-2-kwds))
:test 'string-equal)) :test 'string-equal))
...@@ -2382,7 +2382,7 @@ This construct is \"<keyword> <expression> :\"." ...@@ -2382,7 +2382,7 @@ This construct is \"<keyword> <expression> :\"."
(c-lang-defconst c-expr-kwds (c-lang-defconst c-expr-kwds
;; Keywords that can occur anywhere in expressions. Built from ;; Keywords that can occur anywhere in expressions. Built from
;; `c-primary-expr-kwds' and all keyword operators in `c-operators'. ;; `c-primary-expr-kwds' and all keyword operators in `c-operators'.
t (cl-delete-duplicates t (delete-duplicates
(append (c-lang-const c-primary-expr-kwds) (append (c-lang-const c-primary-expr-kwds)
(c-filter-ops (c-lang-const c-operator-list) (c-filter-ops (c-lang-const c-operator-list)
t t
...@@ -2486,7 +2486,7 @@ Note that Java specific rules are currently applied to tell this from ...@@ -2486,7 +2486,7 @@ Note that Java specific rules are currently applied to tell this from
(c-lang-defconst c-keywords (c-lang-defconst c-keywords
;; All keywords as a list. ;; All keywords as a list.
t (cl-delete-duplicates t (delete-duplicates
(c-lang-defconst-eval-immediately (c-lang-defconst-eval-immediately
`(append ,@(mapcar (lambda (kwds-lang-const) `(append ,@(mapcar (lambda (kwds-lang-const)
`(c-lang-const ,kwds-lang-const)) `(c-lang-const ,kwds-lang-const))
...@@ -2826,7 +2826,7 @@ possible for good performance." ...@@ -2826,7 +2826,7 @@ possible for good performance."
(c-lang-defvar c-block-prefix-charset (c-lang-const c-block-prefix-charset)) (c-lang-defvar c-block-prefix-charset (c-lang-const c-block-prefix-charset))
(c-lang-defconst c-type-decl-prefix-key (c-lang-defconst c-type-decl-prefix-key
"Regexp matching the declarator operators that might precede the "Regexp matching any declarator operator that might precede the
identifier in a declaration, e.g. the \"*\" in \"char *argv\". This identifier in a declaration, e.g. the \"*\" in \"char *argv\". This
regexp should match \"(\" if parentheses are valid in declarators. regexp should match \"(\" if parentheses are valid in declarators.
The end of the first submatch is taken as the end of the operator. The end of the first submatch is taken as the end of the operator.
...@@ -3025,7 +3025,8 @@ identifier or one of the keywords on `c-<>-type-kwds' or ...@@ -3025,7 +3025,8 @@ identifier or one of the keywords on `c-<>-type-kwds' or
expression is considered to be a type." expression is considered to be a type."
t (or (consp (c-lang-const c-<>-type-kwds)) t (or (consp (c-lang-const c-<>-type-kwds))
(consp (c-lang-const c-<>-arglist-kwds))) (consp (c-lang-const c-<>-arglist-kwds)))
java t) java t) ; 2008-10-19. This is crude. The syntax for java
; generics is not yet coded in CC Mode.
(c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists)) (c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists))
(c-lang-defconst c-enums-contain-decls (c-lang-defconst c-enums-contain-decls
...@@ -3249,7 +3250,7 @@ accomplish that conveniently." ...@@ -3249,7 +3250,7 @@ accomplish that conveniently."
;; `c-lang-const' will expand to the evaluated ;; `c-lang-const' will expand to the evaluated
;; constant immediately in `macroexpand-all' ;; constant immediately in `macroexpand-all'
;; below. ;; below.
(cl-mapcan (mapcan
(lambda (init) (lambda (init)
`(current-var ',(car init) `(current-var ',(car init)
,(car init) ,(macroexpand-all ,(car init) ,(macroexpand-all
......
...@@ -361,7 +361,7 @@ Example: ...@@ -361,7 +361,7 @@ Example:
p (1+ p)) p (1+ p))
(cond (cond
;; Is CHAR part of a objc token? ;; Is CHAR part of a objc token?
((and (not inargvar) ; Ignore if CHAR is part of an argument variable. ((and (not inargvar) ; Ignore if CHAR is part of an argument variable.
(eq 0 betweenparen) ; Ignore if CHAR is in parentheses. (eq 0 betweenparen) ; Ignore if CHAR is in parentheses.
(or (