emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: [feature request] use relative path in the file set by org


From: Mikael Fornius
Subject: [Orgmode] Re: [feature request] use relative path in the file set by org-agenda-files
Date: Tue, 23 Mar 2010 11:30:07 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.92 (gnu/linux)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]