From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Gustav_Wikstr=F6m?= Subject: Re: [RFC] Link-type for attachments, more attach options Date: Sun, 28 Jul 2019 20:39:39 +0000 Message-ID: References: <87muqo8o68.fsf@nicolasgoaziou.fr> <877eh8vd52.fsf_-_@nicolasgoaziou.fr> <87y39euadx.fsf@nicolasgoaziou.fr> <87pnnfnfio.fsf@nicolasgoaziou.fr> <87tvby4z01.fsf@nicolasgoaziou.fr> <87y30j34ry.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58293) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrpxK-0005N1-4V for emacs-orgmode@gnu.org; Sun, 28 Jul 2019 16:39:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hrpxJ-0008GS-0S for emacs-orgmode@gnu.org; Sun, 28 Jul 2019 16:39:46 -0400 Received: from mail-eopbgr10129.outbound.protection.outlook.com ([40.107.1.129]:54497 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hrpxI-0008Cn-NG for emacs-orgmode@gnu.org; Sun, 28 Jul 2019 16:39:44 -0400 In-Reply-To: <87y30j34ry.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> Content-Language: en-US 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" To: Ihor Radchenko Cc: "emacs-orgmode@gnu.org" , Nicolas Goaziou Hi Ihor, > -----Original Message----- > From: Ihor Radchenko > Sent: den 27 juli 2019 16:56 > To: Gustav Wikstr=F6m ; Nicolas Goaziou > Cc: emacs-orgmode@gnu.org > Subject: Re: [O] [RFC] Link-type for attachments, more attach options > I just found that removing ATTACH_DIR_INHERIT broke my current > configuration. I do not use ATTACH_DIR property - all the attachment > folders are created using ID. Also, I use ID property to store links to > entries. Therefore, inheriting ATTACH_DIR does nothing for me and > inheriting ID always gives the current entry's id value. At the end, I > cannot make a common attachment directory for the whole subtree, like I > was able to do with ATTACH_DIR_INHERIT. Ah, yes. That is an unfortunate side effect of ID properties having other use-cases outside of attachments. I thought about that for some time during the development but didn't get to implement any solution for it. The way I thought to do it was to create an algorithm that looks through the outline hierarchy at successively lower hierarchy for an ID property that has a corresponding attachment folder. If no folder exist for the ID attribute at the given level, the inherit functionality would continue to look at a lower level until a folder was found. I imagined the algorithm to look for both ID and DIR properties at each level and stop at the first property that had an existing attachment folder, with DIR taking precedence at each level if for some reason both ID and DIR based folders existed. Adding such functionality means going outside the scope of current property inheritance in Org mode. It adds some complexity but maybe it's warranted to do so here? But, as mentioned, I only got to the point of thinking about it, I didn't implement it. If someone wants to take up the challenge of implementing it then the starting point should be to modify org-attach-dir, replacing org-entry-get with something similar to the algorithm mentioned above. I might get to it at some point as well, but my motivation lies elsewhere right now (document-level stuff... see other threads by me). Kind regards Gustav