emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Function: Extract link location to killring


From: Bastien
Subject: Re: [O] Function: Extract link location to killring
Date: Sat, 02 Jul 2011 11:29:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Memnon, Eric,

Memnon Anon <address@hidden> writes:

> (defun my-extract-link ()
>   "Extract the link location at point and put it on the killring."
>   (interactive)
>   (when (org-in-regexp org-bracket-link-regexp 1)
>     (kill-new (org-link-unescape (org-match-string-no-properties 1)))))

Eric S Fraga <address@hidden> writes:

> And if you do this, saving it as a kmacro, you can generate code that
> does this:
>
> #+begin_src emacs-lisp
> (fset 'getlink
>       (lambda (&optional arg) 
>         "Keyboard macro." 
>         (interactive "p") 
>         (kmacro-exec-ring-item (quote ("\C-c\C-l\C-a\C-k\C-g" 0 "%d")) arg)))
> #+end_src
>
> You can then bind /getlink/ to a key or execute it directly with 
> M-x getlink RET

These two snippets could live on Worg -- can anyone add this to
org-hacks.el (or any relevant place)?

Thanks in advance!

-- 
 Bastien



reply via email to

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