[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 82d0f42: * lisp/help-fns.el (describe-function): Mo
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] master 82d0f42: * lisp/help-fns.el (describe-function): More type checking. |
Date: |
Fri, 24 Apr 2015 18:44:38 +0000 |
branch: master
commit 82d0f42a4c52196d275470f69788dabf1141765b
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>
* lisp/help-fns.el (describe-function): More type checking.
(describe-function-1): Handle changed symbol-function. (Bug#20201)
---
lisp/help-fns.el | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 53f4b38..9020037 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -54,20 +54,22 @@ The functions will receive the function name as argument.")
(and fn (symbol-name fn))))
(list (if (equal val "")
fn (intern val)))))
- (if (null function)
- (message "You didn't specify a function")
- (help-setup-xref (list #'describe-function function)
- (called-interactively-p 'interactive))
- (save-excursion
- (with-help-window (help-buffer)
- (prin1 function)
- ;; Use " is " instead of a colon so that
- ;; it is easier to get out the function name using forward-sexp.
- (princ " is ")
- (describe-function-1 function)
- (with-current-buffer standard-output
- ;; Return the text we displayed.
- (buffer-string))))))
+ (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))
+ (help-setup-xref (list #'describe-function function)
+ (called-interactively-p 'interactive))
+ (save-excursion
+ (with-help-window (help-buffer)
+ (prin1 function)
+ ;; Use " is " instead of a colon so that
+ ;; it is easier to get out the function name using forward-sexp.
+ (princ " is ")
+ (describe-function-1 function)
+ (with-current-buffer standard-output
+ ;; Return the text we displayed.
+ (buffer-string)))))
;; Could be this, if we make symbol-file do the work below.
@@ -479,7 +481,8 @@ FILE is the file where FUNCTION was probably defined."
function))
;; Get the real definition.
(def (if (symbolp real-function)
- (symbol-function real-function)
+ (or (symbol-function real-function)
+ (signal 'void-function (list real-function)))
real-function))
(aliased (or (symbolp def)
;; Advised & aliased function.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 82d0f42: * lisp/help-fns.el (describe-function): More type checking.,
Glenn Morris <=