diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-05-29 11:17:12 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-05-29 11:17:12 -0400 |
commit | 8e399682a1f6298e1315cf799f30335abac78e4a (patch) | |
tree | d06c17744afa4b05968d68a556d3f3dc88cf5144 /lisp/emacs-lisp | |
parent | 33e249a259ae61d828d22f6df5546ac9ba70da36 (diff) | |
download | emacs-8e399682a1f6298e1315cf799f30335abac78e4a.tar.gz emacs-8e399682a1f6298e1315cf799f30335abac78e4a.tar.bz2 emacs-8e399682a1f6298e1315cf799f30335abac78e4a.zip |
* lisp/emacs-lisp/trace.el (trace--read-args): Provide a default.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/trace.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el index 42643bf2317..f605c2865c0 100644 --- a/lisp/emacs-lisp/trace.el +++ b/lisp/emacs-lisp/trace.el @@ -262,7 +262,17 @@ be printed along with the arguments in the trace." (defun trace--read-args (prompt) (cons - (intern (completing-read prompt obarray 'fboundp t)) + (let ((default (function-called-at-point)) + (beg (string-match ":[ \t]*\\'" prompt))) + (intern (completing-read (if default + (format + "%s (default %s)%s" + (substring prompt 0 beg) + default + (if beg (substring prompt beg) ": ")) + prompt) + obarray 'fboundp t nil nil + (if default (symbol-name default))))) (when current-prefix-arg (list (read-buffer "Output to buffer: " trace-buffer) |