summaryrefslogtreecommitdiff
path: root/lisp/wid-edit.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-21 17:30:26 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-21 17:30:26 +0000
commit0b9620f3adf1cc3cf7112fb5ed430fc17b24ef75 (patch)
tree3ebe02a9b4c611bde1daa09cb80d40185ccd7fb6 /lisp/wid-edit.el
parent7834cad1a70a1e674652ab454ea989751fe3efb8 (diff)
downloademacs-0b9620f3adf1cc3cf7112fb5ed430fc17b24ef75.tar.gz
(widget-documentation-link-action):
Use describe-function or describe-variable in simple cases.
Diffstat (limited to 'lisp/wid-edit.el')
-rw-r--r--lisp/wid-edit.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index f7926ba3d45..ec9fdcdc596 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -2637,7 +2637,13 @@ when he invoked the menu."
(defun widget-documentation-link-action (widget &optional event)
"Run apropos on WIDGET's value. Ignore optional argument EVENT."
- (apropos (concat "\\`" (regexp-quote (widget-get widget :value)) "\\'")))
+ (let* ((string (widget-get widget :value))
+ (symbol (intern string)))
+ (if (and (fboundp symbol) (boundp symbol))
+ (apropos (concat "\\`" (regexp-quote string) "\\'"))
+ (if (fboundp symbol)
+ (describe-function symbol)
+ (describe-variable symbol)))))
(defcustom widget-documentation-links t
"Add hyperlinks to documentation strings when non-nil."