comparison lisp/wid-edit.el @ 18365:ceb9388fe67f

(widget-documentation-link-action): Use describe-function or describe-variable in simple cases.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Jun 1997 17:30:26 +0000
parents 01666331d10f
children 2aaa07c43738
comparison
equal deleted inserted replaced
18364:01666331d10f 18365:ceb9388fe67f
2635 "Tell what this link will describe." 2635 "Tell what this link will describe."
2636 (concat "Describe the `" (widget-get widget :value) "' symbol.")) 2636 (concat "Describe the `" (widget-get widget :value) "' symbol."))
2637 2637
2638 (defun widget-documentation-link-action (widget &optional event) 2638 (defun widget-documentation-link-action (widget &optional event)
2639 "Run apropos on WIDGET's value. Ignore optional argument EVENT." 2639 "Run apropos on WIDGET's value. Ignore optional argument EVENT."
2640 (apropos (concat "\\`" (regexp-quote (widget-get widget :value)) "\\'"))) 2640 (let* ((string (widget-get widget :value))
2641 (symbol (intern string)))
2642 (if (and (fboundp symbol) (boundp symbol))
2643 (apropos (concat "\\`" (regexp-quote string) "\\'"))
2644 (if (fboundp symbol)
2645 (describe-function symbol)
2646 (describe-variable symbol)))))
2641 2647
2642 (defcustom widget-documentation-links t 2648 (defcustom widget-documentation-links t
2643 "Add hyperlinks to documentation strings when non-nil." 2649 "Add hyperlinks to documentation strings when non-nil."
2644 :type 'boolean 2650 :type 'boolean
2645 :group 'widget-documentation) 2651 :group 'widget-documentation)