emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/boxquote 3da429f64d 16/31: Rewrite boxquote-describe-varia


From: ELPA Syncer
Subject: [nongnu] elpa/boxquote 3da429f64d 16/31: Rewrite boxquote-describe-variable
Date: Sat, 1 Jan 2022 01:58:26 -0500 (EST)

branch: elpa/boxquote
commit 3da429f64d56a4c717c3d232934e406012bc6336
Author: Dave Pearson <davep@davep.org>
Commit: Dave Pearson <davep@davep.org>

    Rewrite boxquote-describe-variable
    No more dumpster-diving the input history just to get the variable name.
    See #3 for more information.
---
 boxquote.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/boxquote.el b/boxquote.el
index 1c1725161d..619ace8a61 100644
--- a/boxquote.el
+++ b/boxquote.el
@@ -426,17 +426,20 @@ ITEM is a function for retrieving the item to get help 
on."
     (boxquote-title (format boxquote-describe-function-title-format function)))
 
 ;;;###autoload
-(defun boxquote-describe-variable ()
+(defun boxquote-describe-variable (variable)
   "Call `describe-variable' and boxquote the output into the current buffer."
-  (interactive)
-  (boxquote-quote-help-buffer
-   #'(lambda ()
-       (call-interactively #'describe-variable))
-   boxquote-describe-variable-title-format
-   #'(lambda ()
-       (car (if (boxquote-xemacs-p)
-                (symbol-value 'variable-history)
-              minibuffer-history)))))
+  (interactive
+   (list
+    (completing-read "Describe variable: " obarray
+                     #'(lambda (v)
+                         (or (get v 'variable-documentation)
+                             (and (boundp v) (not (keywordp v)))))
+                     t nil nil)))
+  (boxquote-text
+   (save-window-excursion
+     (substring-no-properties
+      (describe-variable (intern variable)))))
+  (boxquote-title (format boxquote-describe-variable-title-format variable)))
 
 ;;;###autoload
 (defun boxquote-describe-key (key)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]