From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: Re: Feature Request: attach link type Date: Fri, 04 Mar 2011 15:10:18 -0300 Message-ID: <4d712b0e.1838640a.4d18.ffffa691@mx.google.com> References: <4d5c35ef.0ae9640a.3fc9.0852@mx.google.com> <87mxlco6ch.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from [140.186.70.92] (port=43349 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvZSM-0001QN-IM for emacs-orgmode@gnu.org; Fri, 04 Mar 2011 13:10:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvZSK-0002pu-LP for emacs-orgmode@gnu.org; Fri, 04 Mar 2011 13:10:26 -0500 Received: from mail-gw0-f51.google.com ([74.125.83.51]:49112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvZSK-0002pq-HX for emacs-orgmode@gnu.org; Fri, 04 Mar 2011 13:10:24 -0500 Received: by gwb15 with SMTP id 15so1108875gwb.38 for ; Fri, 04 Mar 2011 10:10:23 -0800 (PST) In-Reply-To: <87mxlco6ch.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Orgmode Mailing List At Thu, 03 Mar 2011 11:18:06 +0100, Bastien wrote: > > Hi Darlan, > > Darlan Cavalcante Moreira writes: > > > Using the functions already provided by org-attach I could get > > #+LINK: attach elisp:(org-open-file (org-attach-expand "%s")) > > However, I always have to confirm the execution of the elisp code. > > You want to set `org-confirm-elisp-link-function' to nil. Thanks Bastien. I knew there was some variable to control this for all elisp links. I would prefer not to set this to nil, since I like the confirmation for other elisp links and since links for attached files are common for me I thought it could be a "built-in link". But that's OK. > > > Other useful things (just random thoughts) could be: > > - Perform some operation when a file is attached, such as replacing > > white-spaces in the file-name by underscores > > IMHO this goes beyond what org-attach.el should do: attach files. > Besides, that would require even more confirmation steps. My common use scenario for org-attach is to store files associated to a sub-tree. For instance, when I receive a file by E-mail that I need to read I create a task for it and attach the file. I usually need to change the file name, since I don't like spaces and If would be practical if I could attach the file as it is and know that org-attach would store it the way I like. Is there a hook I could use to do this myself then? (I'm not a lisp programmer, but think I can google tips about how to do this). > > > - When a file is attached a link to it could be stored in the kill ring, > > in case the user want to insert it in the current text. Alternatively, > > an interactive function to insert a link to an attached file (using the > > same completions we already get for opening attached files) would also > > be very handy. > > Yes, good idea. > > From latest git, set `org-attach-store-link-p' to `t' if you want a link > to be stored in `org-stored-links' when attaching a file. This is even better then storing it in the kill ring. I noticed that the link points to the location of the original file and not to the location where it was attached (which is what thought it would do). Is this what you intended? > > Thanks, > > -- > Bastien -- Darlan