aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2016-05-09 18:12:52 +0000
committerAlan Mackenzie2016-05-09 18:12:52 +0000
commite58f900e6d7e9118c8fd4783d87a4f122c0bccc1 (patch)
tree808c920eb1674abc50e11e9b2f5fa1b9efe87117
parent3b478989df59cc33886d260137c433da5cfe4863 (diff)
downloademacs-e58f900e6d7e9118c8fd4783d87a4f122c0bccc1.tar.gz
emacs-e58f900e6d7e9118c8fd4783d87a4f122c0bccc1.zip
Add some "safe-local-variable" declarations for compatibility with master.
These enable C files from the master repository to be visited in Emacs 25 without generating irritating questions about configuration variable safety. * lisp/progmodes/cc-vars.el: (c-string-list-p, c-string-or-string-list-p): New functions. (c-noise-macro-names, c-noise-macro-with-parens-names): give the safe-local-variable property c-string-list-p. (c-macro-names-with-semicolon): give the safe-local-variable property c-string-or-string-list-p.
-rw-r--r--lisp/progmodes/cc-vars.el21
1 files changed, 20 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 8cee733ec8e..b46b9b82704 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -229,7 +229,20 @@ See `c-offsets-alist'."
229 (setq offset (cdr offset))) 229 (setq offset (cdr offset)))
230 (null offset))))) 230 (null offset)))))
231 231
232 232(defun c-string-list-p (val)
233 "Return non-nil if VAL is a list of strings."
234 (and
235 (listp val)
236 (catch 'string
237 (dolist (elt val)
238 (if (not (stringp elt))
239 (throw 'string nil)))
240 t)))
241
242(defun c-string-or-string-list-p (val)
243 "Return non-nil if VAL is a string or a list of strings."
244 (or (stringp val)
245 (c-string-list-p val)))
233 246
234;;; User variables 247;;; User variables
235 248
@@ -1621,6 +1634,10 @@ names)."))
1621 1634
1622 1635
1623;; Non-customizable variables, still part of the interface to CC Mode 1636;; Non-customizable variables, still part of the interface to CC Mode
1637;; The following two are preparations for Emacs 25.2 (2016-05-09):
1638(put 'c-noise-macro-names 'safe-local-variable #'c-string-list-p)
1639(put 'c-noise-macro-with-parens-names 'safe-local-variable #'c-string-list-p)
1640
1624(defvar c-macro-with-semi-re nil 1641(defvar c-macro-with-semi-re nil
1625 ;; Regular expression which matches a (#define'd) symbol whose expansion 1642 ;; Regular expression which matches a (#define'd) symbol whose expansion
1626 ;; ends with a semicolon. 1643 ;; ends with a semicolon.
@@ -1647,6 +1664,8 @@ variables.
1647Note that currently \(2008-11-04) this variable is a prototype, 1664Note that currently \(2008-11-04) this variable is a prototype,
1648and is likely to disappear or change its form soon.") 1665and is likely to disappear or change its form soon.")
1649(make-variable-buffer-local 'c-macro-names-with-semicolon) 1666(make-variable-buffer-local 'c-macro-names-with-semicolon)
1667(put 'c-macro-names-with-semicolon 'safe-local-variable
1668 #'c-string-or-string-list-p)
1650 1669
1651(defun c-make-macro-with-semi-re () 1670(defun c-make-macro-with-semi-re ()
1652 ;; Convert `c-macro-names-with-semicolon' into the regexp 1671 ;; Convert `c-macro-names-with-semicolon' into the regexp