aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/cc-langs.el36
2 files changed, 26 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b4c51f7bb23..3990d4d0106 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12014-06-14 Glenn Morris <rgm@gnu.org>
2
3 * progmodes/cc-langs.el: Require cl-lib. (Bug#17463)
4 Replace delete-duplicates and mapcan by cl- versions throughout.
5 And cl-macroexpand-all by macroexpand-all.
6 (delete-duplicates, mapcan, cl-macroexpand-all): No need to declare.
7
12014-06-14 Eli Zaretskii <eliz@gnu.org> 82014-06-14 Eli Zaretskii <eliz@gnu.org>
2 9
3 * subr.el (posn-col-row): Doc fix. (Bug#17768) 10 * subr.el (posn-col-row): Doc fix. (Bug#17768)
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 29dff4a6394..d2d2de8801a 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -130,7 +130,9 @@
130 130
131 131
132;; This file is not always loaded. See note above. 132;; This file is not always loaded. See note above.
133(cc-external-require 'cl) 133;; Except it is always loaded - see bug#17463.
134;;;(cc-external-require 'cl)
135(require 'cl-lib)
134 136
135 137
136;;; Setup for the `c-lang-defvar' system. 138;;; Setup for the `c-lang-defvar' system.
@@ -209,9 +211,9 @@ the evaluated constant value at compile time."
209;; Suppress "might not be defined at runtime" warning. 211;; Suppress "might not be defined at runtime" warning.
210;; This file is only used when compiling other cc files. 212;; This file is only used when compiling other cc files.
211;; These are defined in cl as aliases to the cl- versions. 213;; These are defined in cl as aliases to the cl- versions.
212(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys) t) 214;(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys) t)
213(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest) t) 215;(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest) t)
214(declare-function cl-macroexpand-all "cl" (form &optional env)) 216;(declare-function cl-macroexpand-all "cl" (form &optional env))
215 217
216(eval-and-compile 218(eval-and-compile
217 ;; Some helper functions used when building the language constants. 219 ;; Some helper functions used when building the language constants.
@@ -252,14 +254,14 @@ the evaluated constant value at compile time."
252 (unless xlate 254 (unless xlate
253 (setq xlate 'identity)) 255 (setq xlate 'identity))
254 (c-with-syntax-table (c-lang-const c-mode-syntax-table) 256 (c-with-syntax-table (c-lang-const c-mode-syntax-table)
255 (delete-duplicates 257 (cl-delete-duplicates
256 (mapcan (lambda (opgroup) 258 (cl-mapcan (lambda (opgroup)
257 (when (if (symbolp (car opgroup)) 259 (when (if (symbolp (car opgroup))
258 (when (funcall opgroup-filter (car opgroup)) 260 (when (funcall opgroup-filter (car opgroup))
259 (setq opgroup (cdr opgroup)) 261 (setq opgroup (cdr opgroup))
260 t) 262 t)
261 t) 263 t)
262 (mapcan (lambda (op) 264 (cl-mapcan (lambda (op)
263 (when (funcall op-filter op) 265 (when (funcall op-filter op)
264 (let ((res (funcall xlate op))) 266 (let ((res (funcall xlate op)))
265 (if (listp res) res (list res))))) 267 (if (listp res) res (list res)))))
@@ -1147,7 +1149,7 @@ operators."
1147(c-lang-defconst c-all-op-syntax-tokens 1149(c-lang-defconst c-all-op-syntax-tokens
1148 ;; List of all tokens in the punctuation and parenthesis syntax 1150 ;; List of all tokens in the punctuation and parenthesis syntax
1149 ;; classes. 1151 ;; classes.
1150 t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens) 1152 t (cl-delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
1151 (c-lang-const c-operator-list)) 1153 (c-lang-const c-operator-list))
1152 :test 'string-equal)) 1154 :test 'string-equal))
1153 1155
@@ -1700,7 +1702,7 @@ not the type face."
1700(c-lang-defconst c-type-start-kwds 1702(c-lang-defconst c-type-start-kwds
1701 ;; All keywords that can start a type (i.e. are either a type prefix 1703 ;; All keywords that can start a type (i.e. are either a type prefix
1702 ;; or a complete type). 1704 ;; or a complete type).
1703 t (delete-duplicates (append (c-lang-const c-primitive-type-kwds) 1705 t (cl-delete-duplicates (append (c-lang-const c-primitive-type-kwds)
1704 (c-lang-const c-type-prefix-kwds) 1706 (c-lang-const c-type-prefix-kwds)
1705 (c-lang-const c-type-modifier-kwds)) 1707 (c-lang-const c-type-modifier-kwds))
1706 :test 'string-equal)) 1708 :test 'string-equal))
@@ -1943,7 +1945,7 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
1943 ;; something is a type or just some sort of macro in front of the 1945 ;; something is a type or just some sort of macro in front of the
1944 ;; declaration. They might be ambiguous with types or type 1946 ;; declaration. They might be ambiguous with types or type
1945 ;; prefixes. 1947 ;; prefixes.
1946 t (delete-duplicates (append (c-lang-const c-class-decl-kwds) 1948 t (cl-delete-duplicates (append (c-lang-const c-class-decl-kwds)
1947 (c-lang-const c-brace-list-decl-kwds) 1949 (c-lang-const c-brace-list-decl-kwds)
1948 (c-lang-const c-other-block-decl-kwds) 1950 (c-lang-const c-other-block-decl-kwds)
1949 (c-lang-const c-typedef-decl-kwds) 1951 (c-lang-const c-typedef-decl-kwds)
@@ -2136,7 +2138,7 @@ type identifiers separated by arbitrary tokens."
2136 pike '("array" "function" "int" "mapping" "multiset" "object" "program")) 2138 pike '("array" "function" "int" "mapping" "multiset" "object" "program"))
2137 2139
2138(c-lang-defconst c-paren-any-kwds 2140(c-lang-defconst c-paren-any-kwds
2139 t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds) 2141 t (cl-delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
2140 (c-lang-const c-paren-type-kwds)) 2142 (c-lang-const c-paren-type-kwds))
2141 :test 'string-equal)) 2143 :test 'string-equal))
2142 2144
@@ -2162,7 +2164,7 @@ assumed to be set if this isn't nil."
2162 2164
2163(c-lang-defconst c-<>-sexp-kwds 2165(c-lang-defconst c-<>-sexp-kwds
2164 ;; All keywords that can be followed by an angle bracket sexp. 2166 ;; All keywords that can be followed by an angle bracket sexp.
2165 t (delete-duplicates (append (c-lang-const c-<>-type-kwds) 2167 t (cl-delete-duplicates (append (c-lang-const c-<>-type-kwds)
2166 (c-lang-const c-<>-arglist-kwds)) 2168 (c-lang-const c-<>-arglist-kwds))
2167 :test 'string-equal)) 2169 :test 'string-equal))
2168 2170
@@ -2222,7 +2224,7 @@ Keywords here should also be in `c-block-stmt-1-kwds'."
2222 2224
2223(c-lang-defconst c-block-stmt-kwds 2225(c-lang-defconst c-block-stmt-kwds
2224 ;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'. 2226 ;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'.
2225 t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds) 2227 t (cl-delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
2226 (c-lang-const c-block-stmt-2-kwds)) 2228 (c-lang-const c-block-stmt-2-kwds))
2227 :test 'string-equal)) 2229 :test 'string-equal))
2228 2230
@@ -2326,7 +2328,7 @@ This construct is \"<keyword> <expression> :\"."
2326(c-lang-defconst c-expr-kwds 2328(c-lang-defconst c-expr-kwds
2327 ;; Keywords that can occur anywhere in expressions. Built from 2329 ;; Keywords that can occur anywhere in expressions. Built from
2328 ;; `c-primary-expr-kwds' and all keyword operators in `c-operators'. 2330 ;; `c-primary-expr-kwds' and all keyword operators in `c-operators'.
2329 t (delete-duplicates 2331 t (cl-delete-duplicates
2330 (append (c-lang-const c-primary-expr-kwds) 2332 (append (c-lang-const c-primary-expr-kwds)
2331 (c-filter-ops (c-lang-const c-operator-list) 2333 (c-filter-ops (c-lang-const c-operator-list)
2332 t 2334 t
@@ -2430,7 +2432,7 @@ Note that Java specific rules are currently applied to tell this from
2430 2432
2431(c-lang-defconst c-keywords 2433(c-lang-defconst c-keywords
2432 ;; All keywords as a list. 2434 ;; All keywords as a list.
2433 t (delete-duplicates 2435 t (cl-delete-duplicates
2434 (c-lang-defconst-eval-immediately 2436 (c-lang-defconst-eval-immediately
2435 `(append ,@(mapcar (lambda (kwds-lang-const) 2437 `(append ,@(mapcar (lambda (kwds-lang-const)
2436 `(c-lang-const ,kwds-lang-const)) 2438 `(c-lang-const ,kwds-lang-const))
@@ -3193,10 +3195,10 @@ accomplish that conveniently."
3193 ;; `c-lang-const' will expand to the evaluated 3195 ;; `c-lang-const' will expand to the evaluated
3194 ;; constant immediately in `cl-macroexpand-all' 3196 ;; constant immediately in `cl-macroexpand-all'
3195 ;; below. 3197 ;; below.
3196 (mapcan 3198 (cl-mapcan
3197 (lambda (init) 3199 (lambda (init)
3198 `(current-var ',(car init) 3200 `(current-var ',(car init)
3199 ,(car init) ,(cl-macroexpand-all 3201 ,(car init) ,(macroexpand-all
3200 (elt init 1)))) 3202 (elt init 1))))
3201 ;; Note: The following `append' copies the 3203 ;; Note: The following `append' copies the
3202 ;; first argument. That list is small, so 3204 ;; first argument. That list is small, so