From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Attachments and refiling Date: Mon, 01 Aug 2011 23:02:27 -0500 Message-ID: <87bow8bgvg.fsf@fastmail.fm> References: <87ei1rrdzd.fsf@gnu.org> <4e21b345.c74cec0a.7e49.3340@mx.google.com> <87mxg3v32m.fsf@altern.org> <877h76u7l7.fsf@gnu.org> <4e2d91f9.8188ec0a.1582.1369@mx.google.com> <87vcum6d5p.fsf@altern.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo6Bc-0006Pl-NI for emacs-orgmode@gnu.org; Tue, 02 Aug 2011 00:02:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qo6Bb-0007kM-CY for emacs-orgmode@gnu.org; Tue, 02 Aug 2011 00:02:32 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:35675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo6Bb-0007k9-6g for emacs-orgmode@gnu.org; Tue, 02 Aug 2011 00:02:31 -0400 In-Reply-To: ("Gustav \=\?utf-8\?Q\?Wikstr\=C3\=B6m\=22's\?\= message of "Fri, 29 Jul 2011 09:27:34 +0200") 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: Gustav =?utf-8?Q?Wikstr=C3=B6m?= Cc: Bastien , emacs-orgmode@gnu.org Gustav Wikstr=C3=B6m writes: > However I think it also is nice to also be able to use custom names to > attachment folders. And it would be nice be able to use some logic with > this, like automatically setting the folder name to the same as the > heading it's attached to. And to allow properties on a file/heading/ > sub-tree=C2=A0basis which defines the base-path to where attachments to t= hat > particular file/heading/sub-tree=C2=A0should reside on the system, relati= ve > or non-relative. This would allow for more atomic solutions if i'm > writing a document on the side of my main setup and want to add some > attachments in the same path. > > But still, it is a really nice feature to have control over the > attachments.=C2=A0So from my point of view it seems sound to try to reason > about different solutions to this or at least keep it in mind for > future functionality. One possibility is to advise the function org-attach-dir to call org-attach-set-directory (and, optionally, org-attach-set-inherit) if the entry does not already have an ATTACH_DIR property: --8<---------------cut here---------------start------------->8--- (defadvice org-attach-dir (before my-org-attach-set-dir-before-attach activ= ate) "Prompt for attachment directory (thus preempting org-get-id)." (unless (org-entry-get nil "ATTACH_DIR" 'inherit) (org-attach-set-directory))) --8<---------------cut here---------------end--------------->8--- This allows one to enter the name of the directory *before* org attaches the file. This is the way I use org-attach, as I prefer human-readable directories to UUIDs. Best, Matt