From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Feature Request: attach link type Date: Sat, 05 Mar 2011 10:14:17 +0100 Message-ID: <87aahaj5ee.fsf@gnu.org> References: <4d5c35ef.0ae9640a.3fc9.0852@mx.google.com> <87mxlco6ch.fsf@gnu.org> <4d712b0e.1838640a.4d18.ffffa691@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=41495 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvnZI-00023n-1m for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 04:14:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvnZG-0004bQ-DV for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 04:14:31 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:53679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvnZG-0004bJ-80 for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 04:14:30 -0500 Received: by wwj40 with SMTP id 40so2977428wwj.30 for ; Sat, 05 Mar 2011 01:14:29 -0800 (PST) In-Reply-To: <4d712b0e.1838640a.4d18.ffffa691@mx.google.com> (Darlan Cavalcante Moreira's message of "Fri, 04 Mar 2011 15:10:18 -0300") 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: Darlan Cavalcante Moreira Cc: Orgmode Mailing List Hi Darlan, Darlan Cavalcante Moreira writes: > 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. I just introduced `org-confirm-elisp-link-not-regexp' which allows the user to avoid confirmation step for elisp code matching a regexp. Hope that helps in your case. > 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). I've been working a bit on your idea, it's possible to create a function and to use it to rename a file when the user is attaching it - but there are problems: for example, if this function changes, then there will be *several* attachements for the same file... we don't want that. So, renaming the file belongs elsewhere IMHO. >> > - 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? Yes. Since the file is now also available as an attachment, a link to the source file might be useful, while a link to the attached file is a bit redundant with what org-attach allows you to do (get the file). Does that make sense? Thanks, -- Bastien