]> code.delx.au - gnu-emacs/commitdiff
Fix following doc-links in `widget-documentation-link-action'
authorMartin Rudalics <rudalics@gmx.at>
Thu, 23 Apr 2015 07:11:59 +0000 (09:11 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Thu, 23 Apr 2015 07:11:59 +0000 (09:11 +0200)
* lisp/wid-edit.el (widget-documentation-link-action): Make
following doc-links less simplistic (Bug#20398).

lisp/wid-edit.el

index 04a900f23c095f2dbfb7311f12def2ddc5ba4a06..0a9578391e0e686da7644d66667e3b444983fd40 100644 (file)
@@ -2846,9 +2846,17 @@ The following properties have special meanings for this widget:
     (if (and (fboundp symbol) (boundp symbol))
        ;; If there are two doc strings, give the user a way to pick one.
        (apropos (concat "\\`" (regexp-quote string) "\\'"))
-      (if (fboundp symbol)
-         (describe-function symbol)
-       (describe-variable symbol)))))
+      (cond
+       ((fboundp symbol)
+       (describe-function symbol))
+       ((facep symbol)
+       (describe-face symbol))
+       ((featurep symbol)
+       (describe-package symbol))
+       ((or (boundp symbol) (get symbol 'variable-documentation))
+       (describe-variable symbol))
+       (t
+       (message "No documentation available for %s" symbol))))))
 
 (defcustom widget-documentation-links t
   "Add hyperlinks to documentation strings when non-nil."