From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Function: Extract link location to killring Date: Sat, 02 Jul 2011 11:29:31 +0200 Message-ID: <871uy9ghdw.fsf@gnu.org> References: <4E0307D5.8080105@christianmoe.com> <4E031D7C.4080104@christianmoe.com> <87oc1ozqzu.fsf@mean.albasani.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcwVd-0003yj-U0 for emacs-orgmode@gnu.org; Sat, 02 Jul 2011 05:29:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcwVb-0000rl-Ve for emacs-orgmode@gnu.org; Sat, 02 Jul 2011 05:29:05 -0400 Received: from mail-fx0-f52.google.com ([209.85.161.52]:50529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcwVb-0000rf-JQ for emacs-orgmode@gnu.org; Sat, 02 Jul 2011 05:29:03 -0400 Received: by fxd18 with SMTP id 18so3492743fxd.39 for ; Sat, 02 Jul 2011 02:29:02 -0700 (PDT) In-Reply-To: <87oc1ozqzu.fsf@mean.albasani.net> (Memnon Anon's message of "Thu, 23 Jun 2011 12:17:24 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Memnon Anon Cc: emacs-orgmode@gnu.org Memnon, Eric, Memnon Anon 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