From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: [feature request] use relative path in the file set by org-agenda-files Date: Wed, 24 Mar 2010 13:00:09 +0100 Message-ID: <4D4BCB95-CFF9-4FA1-B346-07B55F8CBA82@gmail.com> References: <87sk7rnxe8.fsf@eee.lan> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuWrI-0000CX-BJ for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 16:07:20 -0400 Received: from [140.186.70.92] (port=35957 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuWrG-0000Bm-LS for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 16:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuWrF-0004FZ-4x for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 16:07:18 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:43521) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuWrE-0004FT-UC for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 16:07:17 -0400 Received: by ewy8 with SMTP id 8so48223ewy.8 for ; Wed, 24 Mar 2010 13:07:16 -0700 (PDT) In-Reply-To: <87sk7rnxe8.fsf@eee.lan> 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: Mikael Fornius Cc: emacs-orgmode@gnu.org, zwz Hi Mikael, thanks for the patch, I have applied it. It is incomplete in the following sense: When I add another file with `C-c [', the the expanded file names will be written back to the file. So maybe it would be useful to implement an inverse operation in `org-store-new-agenda-file-list'. I guess you cannot get back environment variables because you don't know which ones to use. But getting back "~", and removing org-directory might be nice. Such a file could then be kept, for example in the drop box and could work on different machines. - Carsten On Mar 23, 2010, at 11:30 AM, Mikael Fornius wrote: > > I have made a small patch implementing the following behavior: > > With org-agenda-files = "/home/mfo/org/agenda", a filename. > > | Line in agenda-file | Expands to: | > |------------------------+------------------------------| > | $HOME/org/org-mode.org | "/home/mfo/org/org-mode.org" | > | td/td.org | "/home/mfo/org/td/td.org" | > | ~/org/test.org | "/home/mfo/org/test.org" | > | scratch.org | "/home/mfo/org/scratch.org" | > | /home/mfo/org/wep.org | "/home/mfo/org/wep.org" | > | ../te.org | "/home/mfo/te.org" | > |------------------------+------------------------------| > > Here is the patch to current git-head: > > diff --git a/lisp/org.el b/lisp/org.el > index 84bec4c..dad9293 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -14672,8 +14672,10 @@ the buffer and restores the previous window > configuration." > (when (stringp org-agenda-files) > (with-temp-buffer > (insert-file-contents org-agenda-files) > - (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r > \n]*")))) > - > + (mapcar (lambda (f) > + (expand-file-name (substitute-in-file-name f) > + (file-name-directory org-agenda-files))) > + (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r > \n]*"))))) > > ;;;###autoload > (defun org-cycle-agenda-files () > > -- > Mikael Fornius > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten