branch: elpa/boxquote
commit db9aa7d7d365a941357467982981db6fec4de1cb
Author: Dave Pearson <[email protected]>
Commit: Dave Pearson <[email protected]>

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

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

Reply via email to