]> code.delx.au - gnu-emacs/blobdiff - lisp/wid-edit.el
Merge branch 'master' into cairo
[gnu-emacs] / lisp / wid-edit.el
index e901431bfcd988a993f9414d413773c46af072d0..0a9578391e0e686da7644d66667e3b444983fd40 100644 (file)
@@ -1,6 +1,6 @@
 ;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t; lexical-binding:t -*-
 ;;
-;; Copyright (C) 1996-1997, 1999-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 1999-2015 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: emacs-devel@gnu.org
@@ -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."