summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--org/jao-org-utils.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/org/jao-org-utils.el b/org/jao-org-utils.el
index ea87ec5..aa41143 100644
--- a/org/jao-org-utils.el
+++ b/org/jao-org-utils.el
@@ -1,13 +1,14 @@
(require 'org)
;;; links
-(defun jao-org-link-at-point ()
+(defun jao-org-link-at-point (&optional copy)
(when (thing-at-point-looking-at "\\[\\[\\([^]]+\\)\\]\\[[^]]+\\]\\]")
+ (when copy (kill-ring-save (match-beginning 1) (match-end 1)))
(match-string-no-properties 1)))
(defun jao-org-copy-link-at-point ()
(interactive)
- (message "%s" (or (jao-org-link-at-point) "No link at point")))
+ (message "%s" (or (jao-org-link-at-point t) "No link at point")))
(defun jao-org-insert-link (url title)
(insert (format "[[%s][%s]]" url title)))