Function: emacs-lisp-macroexpand

emacs-lisp-macroexpand is an interactive and byte-compiled function defined in elisp-mode.el.gz.

Signature

(emacs-lisp-macroexpand)

Documentation

Macroexpand the form after point.

Comments in the form will be lost.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/elisp-mode.el.gz
(defun emacs-lisp-macroexpand ()
  "Macroexpand the form after point.
Comments in the form will be lost."
  (interactive)
  (let* ((start (point))
         (exp (read (current-buffer)))
         ;; Compute it before, since it may signal errors.
         (new (macroexpand-1 exp)))
    (if (equal exp new)
        (message "Not a macro call, nothing to expand")
      (delete-region start (point))
      (pp new (current-buffer))
      (if (bolp) (delete-char -1))
      (indent-region start (point)))))