diff options
author | Mark Oteiza <mvoteiza@udel.edu> | 2016-03-31 19:34:05 -0400 |
---|---|---|
committer | Mark Oteiza <mvoteiza@udel.edu> | 2016-03-31 19:34:05 -0400 |
commit | a3daa34336da158555d96d670077eedb9eaeeb9c (patch) | |
tree | 8ad1456db0ee56b721cb759d6ae65c68ef998143 /lisp/emacs-lisp/disass.el | |
parent | e30c3e9a9cca3ae84d4da132f334f1b8b6df45ac (diff) | |
download | emacs-a3daa34336da158555d96d670077eedb9eaeeb9c.tar.gz |
Teach M-x disassemble a default argument.
Adopts default argument in the same way as `describe-function'.
* lisp/emacs-lisp/disass.el (disassemble): Default to function at point,
if any.
Diffstat (limited to 'lisp/emacs-lisp/disass.el')
-rw-r--r-- | lisp/emacs-lisp/disass.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index e67b0220e14..8506ed69669 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -54,9 +54,13 @@ OBJECT can be a symbol defined as a function, or a function itself \(a lambda expression or a compiled-function object). If OBJECT is not already compiled, we compile it, but do not redefine OBJECT if it is a symbol." - (interactive (list (intern (completing-read "Disassemble function: " - obarray 'fboundp t)) - nil 0 t)) + (interactive + (let* ((fn (function-called-at-point)) + (prompt (if fn (format "Disassemble function (default %s): " fn) + "Disassemble function: ")) + (def (and fn (symbol-name fn)))) + (list (intern (completing-read prompt obarray 'fboundp t nil nil def)) + nil 0 t))) (if (and (consp object) (not (functionp object))) (setq object `(lambda () ,object))) (or indent (setq indent 0)) ;Default indent to zero |