2 Jul 2011 11:29
Re: Function: Extract link location to killring
Bastien <bzg <at> altern.org>
2011-07-02 09:29:31 GMT
2011-07-02 09:29:31 GMT
Memnon, Eric,
Memnon Anon <gegendosenfleisch <at> googlemail.com> 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 <e.fraga <at> ucl.ac.uk> 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
RSS Feed