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

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

[elpa] externals/clhs 537a263 13/25: common-lisp-hyperspec: with prefix


From: Sam Steingold
Subject: [elpa] externals/clhs 537a263 13/25: common-lisp-hyperspec: with prefix arg, save URL in kill-ring
Date: Tue, 27 Apr 2021 20:38:54 -0400 (EDT)

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

    common-lisp-hyperspec: with prefix arg, save URL in kill-ring
---
 clhs.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/clhs.el b/clhs.el
index 25a34a4..3cd328a 100644
--- a/clhs.el
+++ b/clhs.el
@@ -118,10 +118,11 @@ Actually, `completing-read' in Emacs 22 accepts 
hash-tables natively."
                 (car res))))))
 
 ;;;###autoload
-(defun common-lisp-hyperspec (symbol-name &optional insert)
+(defun common-lisp-hyperspec (symbol-name &optional kill)
   "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))
+Finds the HyperSpec at `common-lisp-hyperspec-root'.
+With prefix arg, save the URL in the `kill-ring' instead."
+  (interactive (list (let ((sym (thing-at-point 'symbol t))
                            (completion-ignore-case t))
                        (completing-read
                         "Look-up symbol in the Common Lisp HyperSpec: "
@@ -134,8 +135,8 @@ Finds the HyperSpec at `common-lisp-hyperspec-root'."
           (concat common-lisp-hyperspec-root "/")))
   (let ((url (concat common-lisp-hyperspec-root
                      (gethash (upcase symbol-name) (clhs-symbols)))))
-    (if insert
-        (insert url)
+    (if kill
+        (kill-new url)
       (browse-url url))))
 
 (provide 'clhs)



reply via email to

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