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

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

[elpa] externals/clhs 5b6de9f 11/25: common-lisp-hyperspec: with prefix


From: Sam Steingold
Subject: [elpa] externals/clhs 5b6de9f 11/25: common-lisp-hyperspec: with prefix arg, insert the URL instead of visiting it
Date: Tue, 27 Apr 2021 20:38:54 -0400 (EDT)

branch: externals/clhs
commit 5b6de9f1df6f7e9363198fe7d510b8f7f11485e2
Author: Sam Steingold <sds@gnu.org>
Commit: Sam Steingold <sds@gnu.org>

    common-lisp-hyperspec: with prefix arg, insert the URL instead of visiting 
it
---
 clhs.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/clhs.el b/clhs.el
index 16e731b..6684b7b 100644
--- a/clhs.el
+++ b/clhs.el
@@ -118,7 +118,7 @@ Actually, `completing-read' in Emacs 22 accepts hash-tables 
natively."
                 (car res))))))
 
 ;;;###autoload
-(defun common-lisp-hyperspec (symbol-name)
+(defun common-lisp-hyperspec (symbol-name &optional insert)
   "Browse the Common Lisp HyperSpec documentation for SYMBOL-NAME.
 Finds the HyperSpec at `common-lisp-hyperspec-root'."
   (interactive (list (let ((sym (thing-at-point 'symbol))
@@ -126,12 +126,16 @@ Finds the HyperSpec at `common-lisp-hyperspec-root'."
                        (completing-read
                         "Look-up symbol in the Common Lisp HyperSpec: "
                         #'hash-table-complete (clhs-symbols)
-                        t sym 'clhs-history))))
+                        t sym 'clhs-history))
+                     current-prefix-arg))
   (unless (= ?/ (aref common-lisp-hyperspec-root
                       (1- (length common-lisp-hyperspec-root))))
     (setq common-lisp-hyperspec-root
           (concat common-lisp-hyperspec-root "/")))
-  (browse-url (concat common-lisp-hyperspec-root
-                      (gethash (upcase symbol-name) (clhs-symbols)))))
+  (let ((url (concat common-lisp-hyperspec-root
+                     (gethash (upcase symbol-name) (clhs-symbols)))))
+    (if insert
+        (insert url)
+      (browse-url url))))
 
 (provide 'clhs)



reply via email to

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