]> git.eshelyaron.com Git - emacs.git/commitdiff
(widget-documentation-link-action):
authorRichard M. Stallman <rms@gnu.org>
Sat, 21 Jun 1997 17:30:26 +0000 (17:30 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 21 Jun 1997 17:30:26 +0000 (17:30 +0000)
Use describe-function or describe-variable in simple cases.

lisp/wid-edit.el

index f7926ba3d450191d3a30f8fbba395445b07dac6b..ec9fdcdc596dc2b7c30a01f268e3369473fb63f1 100644 (file)
@@ -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."