1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00

Fix cl-prettyexpand in the non-FULL case

* lisp/emacs-lisp/cl-extra.el (cl-prettyexpand): This function has
apparently not worked for at least a couple of decades
(bug#38206) unless supplied with a FULL parameter.  Make the FULL
parameter obsolete and make the function always work as it did
with a non-nil FULL.
This commit is contained in:
Lars Ingebrigtsen 2019-11-18 11:02:27 +01:00
parent ccb8bbd581
commit 2e92f176a3

View file

@ -693,17 +693,15 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
(forward-sexp))) (forward-sexp)))
;;;###autoload ;;;###autoload
(defun cl-prettyexpand (form &optional full) (defun cl-prettyexpand (form &optional _full)
"Expand macros in FORM and insert the pretty-printed result. "Expand macros in FORM and insert the pretty-printed result."
Optional argument FULL non-nil means to expand all macros, (declare (advertised-calling-convention (form) "27.1"))
including `cl-block' and `cl-eval-when'."
(message "Expanding...") (message "Expanding...")
(let ((cl--compiling-file full) (let ((byte-compile-macro-environment nil))
(byte-compile-macro-environment nil)) (setq form (macroexpand-all form))
(setq form (macroexpand-all form
(and (not full) '((cl-block) (cl-eval-when)))))
(message "Formatting...") (message "Formatting...")
(prog1 (cl-prettyprint form) (prog1
(cl-prettyprint form)
(message "")))) (message ""))))
;;; Integration into the online help system. ;;; Integration into the online help system.