]> code.delx.au - gnu-emacs/blobdiff - lisp/wid-edit.el
* lisp/emacs-lisp/package.el: Fix warnings
[gnu-emacs] / lisp / wid-edit.el
index 04a900f23c095f2dbfb7311f12def2ddc5ba4a06..f7d8964c9fc78ae8c63a83ce65ad59f9b46b0fca 100644 (file)
@@ -2846,16 +2846,24 @@ 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."
   :type 'boolean
   :group 'widget-documentation)
 
-(defcustom widget-documentation-link-regexp "`\\([^\n`' ]+\\)'"
+(defcustom widget-documentation-link-regexp "['`‘]\\([^\n `'‘’]+\\)['’]"
   "Regexp for matching potential links in documentation strings.
 The first group should be the link itself."
   :type 'regexp
@@ -3311,7 +3319,7 @@ It reads a directory name from an editable text field."
            ;; Avoid a confusing end-of-file error.
            (skip-syntax-forward "\\s-")
            (if (eobp)
-               (setq err "Empty sexp -- use `nil'?")
+               (setq err "Empty sexp -- use nil?")
              (unless (widget-apply widget :match (read (current-buffer)))
                (setq err (widget-get widget :type-error))))
            ;; Allow whitespace after expression.