diff options
author | Joakim Verona <joakim@verona.se> | 2011-11-09 14:05:54 +0100 |
---|---|---|
committer | Joakim Verona <joakim@verona.se> | 2011-11-09 14:05:54 +0100 |
commit | c8d4b74cfa26762d34fd1703a07463008b32be16 (patch) | |
tree | 6610ac356d47e328bb1094d9f5a0dcc15ed5fb6a /lisp/emacs-lisp | |
parent | 32db4845d5c433fd15c6665cbed169e5d8b94f05 (diff) | |
parent | 2cffd68198c4d574f073ab238dc12b1221005eab (diff) | |
download | emacs-c8d4b74cfa26762d34fd1703a07463008b32be16.tar.gz emacs-c8d4b74cfa26762d34fd1703a07463008b32be16.tar.bz2 emacs-c8d4b74cfa26762d34fd1703a07463008b32be16.zip |
upstream
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 08e73b32a15..070faca8d91 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -363,29 +363,23 @@ If TYPE is nil, insist on a symbol with a function definition. Otherwise TYPE should be `defvar' or `defface'. If TYPE is nil, defaults using `function-called-at-point', otherwise uses `variable-at-point'." - (let ((symb (if (null type) - (function-called-at-point) - (if (eq type 'defvar) - (variable-at-point) - (variable-at-point t)))) - (predicate (cdr (assq type '((nil . fboundp) (defvar . boundp) - (defface . facep))))) - (prompt (cdr (assq type '((nil . "function") (defvar . "variable") - (defface . "face"))))) - (enable-recursive-minibuffers t) - val) - (if (equal symb 0) - (setq symb nil)) - (setq val (completing-read - (concat "Find " - prompt - (if symb - (format " (default %s)" symb)) - ": ") - obarray predicate t nil)) - (list (if (equal val "") - symb - (intern val))))) + (let* ((symb1 (cond ((null type) (function-called-at-point)) + ((eq type 'defvar) (variable-at-point)) + (t (variable-at-point t)))) + (symb (unless (eq symb1 0) symb1)) + (predicate (cdr (assq type '((nil . fboundp) + (defvar . boundp) + (defface . facep))))) + (prompt-type (cdr (assq type '((nil . "function") + (defvar . "variable") + (defface . "face"))))) + (prompt (concat "Find " prompt-type + (and symb (format " (default %s)" symb)) + ": ")) + (enable-recursive-minibuffers t)) + (list (intern (completing-read + prompt obarray predicate + t nil nil (and symb (symbol-name symb))))))) (defun find-function-do-it (symbol type switch-fn) "Find Emacs Lisp SYMBOL in a buffer and display it. |