From ae47601667e0d71344eae767c60f6d20ee69f999 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 19 Mar 2012 21:00:15 +0100 Subject: Little tweak --- org/jao-org-utils.el | 5 +++-- 1 file 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))) -- cgit v1.2.3