[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/backports-25.2 c9443ca 38/46: Make describe-variab
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] scratch/backports-25.2 c9443ca 38/46: Make describe-variable look up the variable in the current buffer |
Date: |
Sun, 2 Oct 2016 14:04:50 +0000 (UTC) |
branch: scratch/backports-25.2
commit c9443caaa162742c310eddf4b2d4381417ab4547
Author: Lars Ingebrigtsen <address@hidden>
Commit: Noam Postavsky <address@hidden>
Make describe-variable look up the variable in the current buffer
* lisp/help-fns.el (describe-variable): Get the variable
definition in the buffer we were called from (in case it only
exists there) (bug#21252).
(cherry picked from commit 032b05103136e6aa0a9640a3e3fa56fefebf7119)
---
lisp/help-fns.el | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index e701510..c2c45f9 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -701,17 +701,23 @@ it is displayed along with the global value."
(interactive
(let ((v (variable-at-point))
(enable-recursive-minibuffers t)
+ (orig-buffer (current-buffer))
val)
- (setq val (completing-read (if (symbolp v)
- (format
- "Describe variable (default %s): " v)
- "Describe variable: ")
- obarray
- (lambda (vv)
- (or (get vv 'variable-documentation)
- (and (boundp vv) (not (keywordp vv)))))
- t nil nil
- (if (symbolp v) (symbol-name v))))
+ (setq val (completing-read
+ (if (symbolp v)
+ (format
+ "Describe variable (default %s): " v)
+ "Describe variable: ")
+ obarray
+ (lambda (vv)
+ ;; In case the variable only exists in the buffer
+ ;; the command we switch back to that buffer before
+ ;; we examine the variable.
+ (with-current-buffer orig-buffer
+ (or (get vv 'variable-documentation)
+ (and (boundp vv) (not (keywordp vv))))))
+ t nil nil
+ (if (symbolp v) (symbol-name v))))
(list (if (equal val "")
v (intern val)))))
(let (file-name)
- [Emacs-diffs] scratch/backports-25.2 18f1ab7 30/46: Have describe-variable output multi-line values better, (continued)
- [Emacs-diffs] scratch/backports-25.2 18f1ab7 30/46: Have describe-variable output multi-line values better, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 f24a305 26/46: Make `undo' of `C-x r t' put point where it should be, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 33b69a1 37/46: Warning fix in jit-lock-mode, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 8fd0223 06/46: Make mail-extract-address-components return the user name more, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 7826f1f 32/46: Make ibuffer not break on newline-embedded buffer names, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 4af6945 39/46: Add `size-indication-mode' to the menu on `mouse-1' "Top", Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 5afea13 33/46: Rename "Directory Search" menu to "Servers", Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 d6f5232 34/46: Remove ": ?" from the read-face-name prompt, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 3713acd 36/46: Cancel the eldoc timer when switching off eldoc mode, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 90262cc 40/46: Allow `global-set-key' to bind keys under the `M-o' map, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 c9443ca 38/46: Make describe-variable look up the variable in the current buffer,
Noam Postavsky <=