aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-11-02 01:46:04 -0400
committerStefan Monnier2014-11-02 01:46:04 -0400
commit4a48e97cf905468d6e09c3dd7a5ae7f7489badd5 (patch)
tree13288fde709c55b57562bc69824b956124594d11
parentee17a97bea5ed7315c85f1ca2bcd862f84dc5dd8 (diff)
downloademacs-4a48e97cf905468d6e09c3dd7a5ae7f7489badd5.tar.gz
emacs-4a48e97cf905468d6e09c3dd7a5ae7f7489badd5.zip
* lisp/emacs-lisp/pp.el (pp-macroexpand-expression): Use macroexpand-1.
* lisp/progmodes/elisp-mode.el (emacs-lisp-macroexpand): Idem. Fixes: debbugs:18821
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/macroexp.el2
-rw-r--r--lisp/emacs-lisp/pp.el4
-rw-r--r--lisp/progmodes/elisp-mode.el2
4 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d0256ff94b2..63663e878b9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-11-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/pp.el (pp-macroexpand-expression): Use macroexpand-1
4 (bug#18821).
5 * progmodes/elisp-mode.el (emacs-lisp-macroexpand): Idem.
6
12014-11-01 Michael R. Mauger <michael@mauger.com> 72014-11-01 Michael R. Mauger <michael@mauger.com>
2 8
3 * sql.el (sql-mode-oracle-font-lock-keywords): Correct regexp 9 * sql.el (sql-mode-oracle-font-lock-keywords): Correct regexp
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 3ce369fd5fd..a96a7af77e8 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -394,7 +394,7 @@ symbol itself."
394 (or (symbolp exp) (macroexp-const-p exp))) 394 (or (symbolp exp) (macroexp-const-p exp)))
395 395
396(defun macroexp-quote (v) 396(defun macroexp-quote (v)
397 "Returns an expression E such that `(eval E)' is V. 397 "Return an expression E such that `(eval E)' is V.
398 398
399E is either V or (quote V) depending on whether V evaluates to 399E is either V or (quote V) depending on whether V evaluates to
400itself or not." 400itself or not."
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index dd012fab9da..c18b049020a 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -137,7 +137,7 @@ Also add the value to the front of the list in the variable `values'."
137 "Macroexpand EXPRESSION and pretty-print its value." 137 "Macroexpand EXPRESSION and pretty-print its value."
138 (interactive 138 (interactive
139 (list (read--expression "Macroexpand: "))) 139 (list (read--expression "Macroexpand: ")))
140 (pp-display-expression (macroexpand expression) "*Pp Macroexpand Output*")) 140 (pp-display-expression (macroexpand-1 expression) "*Pp Macroexpand Output*"))
141 141
142(defun pp-last-sexp () 142(defun pp-last-sexp ()
143 "Read sexp before point. Ignores leading comment characters." 143 "Read sexp before point. Ignores leading comment characters."
@@ -175,7 +175,7 @@ With argument, pretty-print output into current buffer.
175Ignores leading comment characters." 175Ignores leading comment characters."
176 (interactive "P") 176 (interactive "P")
177 (if arg 177 (if arg
178 (insert (pp-to-string (macroexpand (pp-last-sexp)))) 178 (insert (pp-to-string (macroexpand-1 (pp-last-sexp))))
179 (pp-macroexpand-expression (pp-last-sexp)))) 179 (pp-macroexpand-expression (pp-last-sexp))))
180 180
181;;; Test cases for quote 181;;; Test cases for quote
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 900e859b54a..2be81a57ebe 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -204,7 +204,7 @@ Comments in the form will be lost."
204 (let* ((start (point)) 204 (let* ((start (point))
205 (exp (read (current-buffer))) 205 (exp (read (current-buffer)))
206 ;; Compute it before, since it may signal errors. 206 ;; Compute it before, since it may signal errors.
207 (new (macroexpand exp))) 207 (new (macroexpand-1 exp)))
208 (if (equal exp new) 208 (if (equal exp new)
209 (message "Not a macro call, nothing to expand") 209 (message "Not a macro call, nothing to expand")
210 (delete-region start (point)) 210 (delete-region start (point))