diff options
author | Alan Mackenzie <acm@muc.de> | 2022-01-14 19:28:07 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2022-01-14 19:28:07 +0000 |
commit | d87a34597c9f0be967f75ff8cfd0ace4392da63f (patch) | |
tree | c9474eb0156af143ce61a0c5bcec659546b56300 /lisp/emacs-lisp | |
parent | 57b698f15913385aec7bc9745016b961c0aa5c55 (diff) | |
parent | d29291d665e808307126bf52c3e748fef78f0f9c (diff) | |
download | emacs-d87a34597c9f0be967f75ff8cfd0ace4392da63f.tar.gz emacs-d87a34597c9f0be967f75ff8cfd0ace4392da63f.tar.bz2 emacs-d87a34597c9f0be967f75ff8cfd0ace4392da63f.zip |
Merge branch 'master' into scratch/correct-warning-pos
Merge branch:
commit d29291d665e808307126bf52c3e748fef78f0f9c (HEAD -> master,
origin/master, origin/HEAD)
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Fri Jan 14 12:26:30 2022 -0500
(macroexp--expand-all): Fix bug#53227 and bug#46636
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/ert.el | 17 | ||||
-rw-r--r-- | lisp/emacs-lisp/inline.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/macroexp.el | 8 | ||||
-rw-r--r-- | lisp/emacs-lisp/shortdoc.el | 3 |
5 files changed, 25 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 56e84ab339a..7bcb2f2936d 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -697,7 +697,11 @@ Valid keywords and arguments are: (defmacro easy-mmode-defmap (m bs doc &rest args) "Define a constant M whose value is the result of `easy-mmode-define-keymap'. The M, BS, and ARGS arguments are as per that function. DOC is -the constant's documentation." +the constant's documentation. + +This macro is deprecated; use `defvar-keymap' instead." + ;; FIXME: Declare obsolete in favor of `defvar-keymap'. It is still + ;; used for `gud-menu-map' and `gud-minor-mode-map', so fix that first. (declare (doc-string 3) (indent 1)) `(defconst ,m (easy-mmode-define-keymap ,bs nil (if (boundp ',m) ,m) ,(cons 'list args)) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index e31ebf5f7bb..9c6b0e15bbe 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -335,15 +335,20 @@ It should only be stopped when ran from inside `ert--run-test-internal'." (unless (eql ,value ',default-value) (list :value ,value)) (unless (eql ,value ',default-value) - (let ((-explainer- - (and (symbolp ',fn-name) - (get ',fn-name 'ert-explainer)))) - (when -explainer- - (list :explanation - (apply -explainer- ,args)))))) + (when-let ((-explainer- + (ert--get-explainer ',fn-name))) + (list :explanation + (apply -explainer- ,args))))) value) ,value)))))))) +(defun ert--get-explainer (fn-name) + (when (symbolp fn-name) + (cl-loop for fn in (cons fn-name (function-alias-p fn-name)) + for explainer = (get fn 'ert-explainer) + when explainer + return explainer))) + (defun ert--expand-should (whole form inner-expander) "Helper function for the `should' macro and its variants. diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el index 963e117ff34..de0112db631 100644 --- a/lisp/emacs-lisp/inline.el +++ b/lisp/emacs-lisp/inline.el @@ -71,7 +71,7 @@ (defmacro inline-quote (_exp) "Similar to backquote, but quotes code and only accepts , and not ,@." - (declare (debug backquote-form)) + (declare (debug (backquote-form))) (error "inline-quote can only be used within define-inline")) (defmacro inline-const-p (_exp) diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index faf0b1619e0..27a7a8f8cf1 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -382,14 +382,17 @@ Assumes the caller has bound `macroexpand-all-environment'." (macroexp--all-forms args) form) (macroexp--expand-all newform)))) - (`(funcall . ,(or `(,exp . ,args) pcase--dontcare)) + (`(funcall ,exp . ,args) (let ((eexp (macroexp--expand-all exp)) (eargs (macroexp--all-forms args))) ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo' ;; has a compiler-macro, or to unfold it. (pcase eexp - (`#',f (macroexp--expand-all `(,f . ,eargs))) + ((and `#',f + (guard (not (or (special-form-p f) (macrop f))))) ;; bug#46636 + (macroexp--expand-all `(,f . ,eargs))) (_ `(funcall ,eexp . ,eargs))))) + (`(funcall . ,_) form) ;bug#53227 (`(,func . ,_) (let ((handler (function-get func 'compiler-macro)) (funargs (function-get func 'funarg-positions))) @@ -430,7 +433,6 @@ Assumes the caller has bound `macroexpand-all-environment'." newform (macroexp--expand-all newform))) (macroexp--expand-all newform)))))) - (_ form))) (pop byte-compile-form-stack))) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 870d34527b0..658edd67527 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -1299,6 +1299,9 @@ If FUNCTION is non-nil, place point on the entry for FUNCTION (if any)." (text-property-search-forward 'shortdoc-function function t) (beginning-of-line))) +;;;###autoload +(defalias 'shortdoc #'shortdoc-display-group) + (defun shortdoc--display-function (data) (let ((function (pop data)) (start-section (point)) |