From: Paul Eggert Date: Sun, 23 Oct 2016 09:50:48 +0000 (-0700) Subject: Merge from origin/emacs-25 X-Git-Tag: emacs-26.0.90~1446 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=394bdb8f2317e312d39e071b588581802dd3027a;p=emacs.git 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 --- 394bdb8f2317e312d39e071b588581802dd3027a diff --cc lisp/help-fns.el index e4e23330e37,7dfa6700b29..87e7d8f87bb --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@@ -106,24 -50,24 +106,25 @@@ 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: ") - obarray 'fboundp t nil nil ++ #'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' ;; expects (current-buffer) to be a help buffer when processing