Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Bastien <bzg <at> altern.org>
Subject: Re: Function: Extract link location to killring
Newsgroups: gmane.emacs.orgmode
Date: Saturday 2nd July 2011 09:29:31 UTC (over 5 years ago)
Memnon, Eric,

Memnon Anon <[email protected]> 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  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
 
CD: 3ms