From e58f900e6d7e9118c8fd4783d87a4f122c0bccc1 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 9 May 2016 18:12:52 +0000 Subject: [PATCH 1/4] 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. --- lisp/progmodes/cc-vars.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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'." (setq offset (cdr offset))) (null offset))))) +(defun c-string-list-p (val) + "Return non-nil if VAL is a list of strings." + (and + (listp val) + (catch 'string + (dolist (elt val) + (if (not (stringp elt)) + (throw 'string nil))) + t))) +(defun c-string-or-string-list-p (val) + "Return non-nil if VAL is a string or a list of strings." + (or (stringp val) + (c-string-list-p val))) ;;; User variables @@ -1621,6 +1634,10 @@ names).")) ;; Non-customizable variables, still part of the interface to CC Mode +;; The following two are preparations for Emacs 25.2 (2016-05-09): +(put 'c-noise-macro-names 'safe-local-variable #'c-string-list-p) +(put 'c-noise-macro-with-parens-names 'safe-local-variable #'c-string-list-p) + (defvar c-macro-with-semi-re nil ;; Regular expression which matches a (#define'd) symbol whose expansion ;; ends with a semicolon. @@ -1647,6 +1664,8 @@ variables. Note that currently \(2008-11-04) this variable is a prototype, and is likely to disappear or change its form soon.") (make-variable-buffer-local 'c-macro-names-with-semicolon) +(put 'c-macro-names-with-semicolon 'safe-local-variable + #'c-string-or-string-list-p) (defun c-make-macro-with-semi-re () ;; Convert `c-macro-names-with-semicolon' into the regexp From 3c581d56ad36f744d6657b46ca6f1b4f23680aed Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 9 May 2016 20:39:36 +0200 Subject: [PATCH 2/4] ; Fix typo --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 785d14bf2ff..3031cab4782 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1588,7 +1588,7 @@ process filter, sentinel, etc., through keyword arguments (similar to 'make-network-process'). +++ -** Subprocesses are automatically told about changes in window dimensions +** Subprocesses are automatically told about changes in window dimensions. The new option 'window-adjust-process-window-size-function' controls how subprocesses are told to adapt their logical window sizes to changes in the Emacs window configuration. Its default value calls From 963541a6540c40559645c312cea7f35c3c649556 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 10 May 2016 01:15:12 +0300 Subject: [PATCH 3/4] Publicize cl--generic-all-functions * lisp/emacs-lisp/cl-generic.el (cl-generic-all-functions): Rename from cl--generic-all-functions. Update both callers. * lisp/cedet/semantic/db-el.el (semanticdb-find-tags-external-children-of-type-method): And use it here (bug#23042). --- lisp/cedet/semantic/db-el.el | 2 +- lisp/emacs-lisp/cl-extra.el | 2 +- lisp/emacs-lisp/cl-generic.el | 2 +- lisp/emacs-lisp/eieio-opt.el | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el index 83a268073b3..a85b9024eb0 100644 --- a/lisp/cedet/semantic/db-el.el +++ b/lisp/cedet/semantic/db-el.el @@ -336,7 +336,7 @@ Return a list of tags." (mapcar 'semanticdb-elisp-sym->tag ;; Fancy eieio function that knows all about ;; built in methods belonging to CLASS. - (eieio-all-generic-functions class))))) + (cl-generic-all-functions class))))) ) taglst)))) diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index b5dfe487d07..8bf0675f54b 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -822,7 +822,7 @@ including `cl-block' and `cl-eval-when'." (cl--describe-class-slots class) ;; Describe all the methods specific to this class. - (let ((generics (cl--generic-all-functions type))) + (let ((generics (cl-generic-all-functions type))) (when generics (insert (propertize "Specialized Methods:\n\n" 'face 'bold)) (dolist (generic generics) diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 7ad9f307f93..37edf45df38 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -937,7 +937,7 @@ MET-NAME is a cons (SYMBOL . SPECIALIZERS)." (setq applies t))) applies)) -(defun cl--generic-all-functions (&optional type) +(defun cl-generic-all-functions (&optional type) "Return a list of all generic functions. Optional TYPE argument returns only those functions that contain methods for TYPE." diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 8a4df0635c4..c1f8297b4a5 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el @@ -162,7 +162,7 @@ are not abstract." (defun eieio-display-method-list () "Display a list of all the methods and what features are used." (interactive) - (let* ((meth1 (cl--generic-all-functions)) + (let* ((meth1 (cl-generic-all-functions)) (meth (sort meth1 (lambda (a b) (string< (symbol-name a) (symbol-name b))))) From d0d9f55b632717fccb605e0a204ebdd5ffe8608f Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 10 May 2016 02:53:20 +0300 Subject: [PATCH 4/4] Allow newlines inside cl function arglists * lisp/help.el (help-add-fundoc-usage): Allow newlines inside ARGLIST (bug#21839). --- lisp/help.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/help.el b/lisp/help.el index 061daacfdd3..72893754e1e 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1395,7 +1395,7 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") "\n\n") (if (stringp arglist) - (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist) + (if (string-match "\\`[^ ]+\\(\\(?:.\\|\n\\)*\\))\\'" arglist) (concat "(fn" (match-string 1 arglist) ")") (error "Unrecognized usage format")) (help--make-usage-docstring 'fn arglist)))))