diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-10-23 02:50:48 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-10-23 02:50:48 -0700 |
commit | 394bdb8f2317e312d39e071b588581802dd3027a (patch) | |
tree | 159fc5496fbecff8760a3c434e82f95f67e99e61 /lisp/help-fns.el | |
parent | 46288dd6321e2ff4028781383660786050933304 (diff) | |
parent | 50fa7d64d36c3f2d6ab11e7136575fbca7012cae (diff) | |
download | emacs-394bdb8f2317e312d39e071b588581802dd3027a.tar.gz |
Merge from origin/emacs-25
50fa7d6 ;* src/w32heap.c: Fix typo and wording of the comments.
6f1325e electric-quote mode no longer worries about coding
c2a1792 * src/regex.c (re_search_2): Make new code safe for -Wjump-mi...
f6134bb Port to GCC 6.2.1 + --enable-gcc-warnings
b2ba630 Explain how to debug emacsclient lisp errors
9da53e2 Let describe-function work for lambda again
5c2da93 Fix kill-line's docstring
ad66b3f Fix handling of allocation in regex matching
5a26c9b * lisp/electric.el (electric-quote-mode): Improve doc (Bug#24...
3877c91 vc-region-history: Search just on lines intersecting the region
8988327 Fix documentation of 'alist-get'
b6998ea * src/regex.h (re_match_object): Improve commentary.
# Conflicts:
# etc/NEWS
# lisp/help-fns.el
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r-- | lisp/help-fns.el | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e4e23330e37..87e7d8f87bb 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -106,23 +106,24 @@ to get buffer-local values.") ;;;###autoload (defun describe-function (function) - "Display the full documentation of FUNCTION (a symbol)." + "Display the full documentation of FUNCTION (a symbol). +When called from lisp, FUNCTION may also be a function object." (interactive - (let ((fn (function-called-at-point)) - (enable-recursive-minibuffers t) - val) - (setq val (completing-read (if fn - (format "Describe function (default %s): " fn) - "Describe function: ") - #'help--symbol-completion-table - #'fboundp - t nil nil (and fn (symbol-name fn)))) - (list (if (equal val "") - fn (intern val))))) - (or (and function (symbolp function)) - (user-error "You didn't specify a function symbol")) - (or (fboundp function) - (user-error "Symbol's function definition is void: %s" function)) + (let* ((fn (function-called-at-point)) + (enable-recursive-minibuffers t) + (val (completing-read + (if fn + (format "Describe function (default %s): " fn) + "Describe function: ") + #'help--symbol-completion-table #'fboundp t nil nil + (and fn (symbol-name fn))))) + (unless (equal val "") + (setq fn (intern val))) + (unless (and fn (symbolp fn)) + (user-error "You didn't specify a function symbol")) + (unless (fboundp fn) + (user-error "Symbol's function definition is void: %s" fn)) + (list fn))) ;; We save describe-function-orig-buffer on the help xref stack, so ;; it is restored by the back/forward buttons. 'help-buffer' |