diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-15 16:26:40 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-15 16:26:45 +0200 |
commit | c6ecf6428e8d4848a633782ed0605ddbacfcebee (patch) | |
tree | 317a0381683676b710ec589c0c9b038dedcee60b /lisp/emacs-lisp/pp.el | |
parent | 1117366d030fd8eb0ed7c8285ca7d763ac9edc98 (diff) | |
download | emacs-c6ecf6428e8d4848a633782ed0605ddbacfcebee.tar.gz emacs-c6ecf6428e8d4848a633782ed0605ddbacfcebee.tar.bz2 emacs-c6ecf6428e8d4848a633782ed0605ddbacfcebee.zip |
Make `C-x C-e' work more like `C-M-x' on defvar etc
* doc/emacs/building.texi (Lisp Eval): Document it.
* lisp/emacs-lisp/pp.el (pp-eval-last-sexp): Ditto.
* lisp/progmodes/elisp-mode.el (elisp--eval-last-sexp): Work more
like `eval-defun': Re-evaluate defvar/defcustom/defface forms.
Diffstat (limited to 'lisp/emacs-lisp/pp.el')
-rw-r--r-- | lisp/emacs-lisp/pp.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 3df7b0e368e..eb2ee94be3b 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -164,8 +164,11 @@ With argument, pretty-print output into current buffer. Ignores leading comment characters." (interactive "P") (if arg - (insert (pp-to-string (eval (pp-last-sexp) lexical-binding))) - (pp-eval-expression (pp-last-sexp)))) + (insert (pp-to-string (eval (elisp--eval-defun-1 + (macroexpand (pp-last-sexp))) + lexical-binding))) + (pp-eval-expression (elisp--eval-defun-1 + (macroexpand (pp-last-sexp)))))) ;;;###autoload (defun pp-macroexpand-last-sexp (arg) |