From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: Re: Attachments and refiling Date: Mon, 25 Jul 2011 12:55:31 -0300 Message-ID: <4e2d91f9.8188ec0a.1582.1369@mx.google.com> References: <87ei1rrdzd.fsf@gnu.org> <4e21b345.c74cec0a.7e49.3340@mx.google.com> <87mxg3v32m.fsf@altern.org> <877h76u7l7.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlNVN-00006K-IJ for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 11:55:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlNVM-0000rc-6b for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 11:55:41 -0400 Received: from mail-yi0-f41.google.com ([209.85.218.41]:40672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlNVM-0000rX-46 for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 11:55:40 -0400 Received: by yia13 with SMTP id 13so2647233yia.0 for ; Mon, 25 Jul 2011 08:55:38 -0700 (PDT) In-Reply-To: <877h76u7l7.fsf@gnu.org> 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: Bastien Cc: Gustav =?UTF-8?B?V2lrc3Ryw7Zt?= , emacs-orgmode@gnu.org As I see changing the attach directory to point to the original one is the easiest solution that has no chances of breaking anything and would keep attachments working in the refiled/archived sub-trees. Maybe a org-attach-move-files function could also be implemented to easily move an attachment directory to a different place. It should move the directory and automatically set the ATTACH_DIR property to the appropriated value. Of course org could try to find out if this attach directory is also used in a different file/sub-tree (maybe search in the agenda files and in the current directory for org-files using this attach directory) and change ATTACH_DIR in that file/sub-tree or warn the user before moving the files. This won't be bullet proof but if the users only set the same attach directory for headings in the same file, for instance (I do this), then it would work perfectly. Then, when the user wants the refiling/archiving process to also move the attached files it could pass an argument before refiling/archiving and org-attach-move-files would be called appropriately. -- Darlan At Mon, 25 Jul 2011 09:45:24 +0200, Bastien wrote: > > Gustav Wikström writes: > > > I'm leaning towards not moving my archive to a different folder. I > > like having the attachments relative. > > Okay. > > But as Darlan pointed out, moving the attached files when refiling the > entry might be dangerous, because files in this attached directory can > also be attached in a different subtree. > > I don't have a good general solution to this -- if someone has, please > share. > > > Are archive- and refile-hooks implemented b.t.w.? > > C-h v org-archive-*-hook TAG > C-h v org-refile-*-hook TAG > > helps. > > There is `org-after-refile-insert-hook' but there is no > `org-archive-hook'. I'll consider adding this. > > > This would make it > > possible to hack a personal setting, or am I wrong? > > You're probably right. Code is proof. > > -- > Bastien