summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-26 06:20:45 +0300
committerdefanor <defanor@uberspace.net>2017-12-26 06:20:45 +0300
commitf5802da979adddf7952cbbc1c6983639c88d6218 (patch)
tree507ed7ad07db9ffbcd77883dda943f5013b15051
parent5d53b9a572de78968d09b29da77d1bcf5c8f7236 (diff)
Put pancake-uri-at-point URIs into the kill ring
When called interactively.
-rw-r--r--pancake.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/pancake.el b/pancake.el
index 199121c..413eee5 100644
--- a/pancake.el
+++ b/pancake.el
@@ -199,14 +199,15 @@ while avoiding code duplication."
(symbol-name attr))))
(defun pancake-uri-at-point (&optional print-uri)
- "Returns an absolute URI at point. Prints it when called
-interactively."
+ "Returns an absolute URI at point. Prints it and puts into the
+kill ring when called interactively."
(interactive "p")
(let* ((button (button-at (point)))
(uri (and button (button-get button 'pancake-absolute-uri))))
(when print-uri
(if uri
- (message "%s" uri)
+ (progn (message "%s" uri)
+ (kill-new uri))
(message "No URI found at point.")))
uri))