aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/help-fns.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index e2cb9f82a1b..e17586c28fe 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -699,17 +699,23 @@ it is displayed along with the global value."
699 (interactive 699 (interactive
700 (let ((v (variable-at-point)) 700 (let ((v (variable-at-point))
701 (enable-recursive-minibuffers t) 701 (enable-recursive-minibuffers t)
702 (orig-buffer (current-buffer))
702 val) 703 val)
703 (setq val (completing-read (if (symbolp v) 704 (setq val (completing-read
704 (format 705 (if (symbolp v)
705 "Describe variable (default %s): " v) 706 (format
706 "Describe variable: ") 707 "Describe variable (default %s): " v)
707 obarray 708 "Describe variable: ")
708 (lambda (vv) 709 obarray
709 (or (get vv 'variable-documentation) 710 (lambda (vv)
710 (and (boundp vv) (not (keywordp vv))))) 711 ;; In case the variable only exists in the buffer
711 t nil nil 712 ;; the command we switch back to that buffer before
712 (if (symbolp v) (symbol-name v)))) 713 ;; we examine the variable.
714 (with-current-buffer orig-buffer
715 (or (get vv 'variable-documentation)
716 (and (boundp vv) (not (keywordp vv))))))
717 t nil nil
718 (if (symbolp v) (symbol-name v))))
713 (list (if (equal val "") 719 (list (if (equal val "")
714 v (intern val))))) 720 v (intern val)))))
715 (let (file-name) 721 (let (file-name)