* question about org-agenda-files
@ 2010-08-01 17:50 Rustom Mody
2010-08-06 8:30 ` Bastien
0 siblings, 1 reply; 5+ messages in thread
From: Rustom Mody @ 2010-08-01 17:50 UTC (permalink / raw
To: emacs-orgmode
Why is it that if org-agenda-files is a list the list should have
absolute file names whereas when it (points to) a single file
containing the names those names are allowed to be relative to
org-directory?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: question about org-agenda-files
2010-08-01 17:50 question about org-agenda-files Rustom Mody
@ 2010-08-06 8:30 ` Bastien
2010-08-06 10:42 ` Carsten Dominik
0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2010-08-06 8:30 UTC (permalink / raw
To: emacs-orgmode
Rustom Mody <rustompmody@gmail.com> writes:
> Why is it that if org-agenda-files is a list the list should have
> absolute file names whereas when it (points to) a single file
> containing the names those names are allowed to be relative to
> org-directory?
I guess this is a small historical contingency. We might indeed allow
relative filenames when `org-agenda-files' is a list.
--
Bastien
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: question about org-agenda-files
2010-08-06 8:30 ` Bastien
@ 2010-08-06 10:42 ` Carsten Dominik
2010-08-06 14:14 ` [PATCH] " Noorul Islam
0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2010-08-06 10:42 UTC (permalink / raw
To: Bastien; +Cc: emacs-orgmode
On Aug 6, 2010, at 10:30 AM, Bastien wrote:
> Rustom Mody <rustompmody@gmail.com> writes:
>
>> Why is it that if org-agenda-files is a list the list should have
>> absolute file names whereas when it (points to) a single file
>> containing the names those names are allowed to be relative to
>> org-directory?
>
> I guess this is a small historical contingency. We might indeed allow
> relative filenames when `org-agenda-files' is a list.
I agree and would welcome a patch for this.
- Carsten
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] question about org-agenda-files
2010-08-06 10:42 ` Carsten Dominik
@ 2010-08-06 14:14 ` Noorul Islam
2010-08-07 6:18 ` Carsten Dominik
0 siblings, 1 reply; 5+ messages in thread
From: Noorul Islam @ 2010-08-06 14:14 UTC (permalink / raw
To: Carsten Dominik; +Cc: emacs-orgmode, Bastien
[-- Attachment #1.1: Type: text/plain, Size: 1441 bytes --]
On Fri, Aug 6, 2010 at 4:12 PM, Carsten Dominik
<carsten.dominik@gmail.com>wrote:
>
> On Aug 6, 2010, at 10:30 AM, Bastien wrote:
>
> Rustom Mody <rustompmody@gmail.com> writes:
>>
>> Why is it that if org-agenda-files is a list the list should have
>>> absolute file names whereas when it (points to) a single file
>>> containing the names those names are allowed to be relative to
>>> org-directory?
>>>
>>
>> I guess this is a small historical contingency. We might indeed allow
>> relative filenames when `org-agenda-files' is a list.
>>
>
> I agree and would welcome a patch for this.
>
>
Changing this behavior is going to be a significant one as far as the
current users are concerned. I started working towards a patch for this and
now I am thinking how not to break existing functionality. Or should we
force everyone to be relative to org-directory?
Here is the simple patch which straight away expands the file names with
org-directory.
* org.el:
+ org-expand-file-list ()
Expand the list of agenda files in "org-agenda-files" with
"org-directory" as base directory.
+ org-agenda-files ()
Call org-expand-file-list() if "org-agenda-files" is a list.
Thanks and Regards
Noorul
> - Carsten
>
>
>
> _______________________________________________
> 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
>
[-- Attachment #1.2: Type: text/html, Size: 2631 bytes --]
[-- Attachment #2: org-agenda-files.txt --]
[-- Type: text/plain, Size: 1110 bytes --]
diff --git a/lisp/org.el b/lisp/org.el
index 19b28a3..532da83 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15379,7 +15379,7 @@ used by the agenda files. If ARCHIVE is `ifmode', do this only if
(cond
((and (not unrestricted) (get 'org-agenda-files 'org-restrict)))
((stringp org-agenda-files) (org-read-agenda-file-list))
- ((listp org-agenda-files) org-agenda-files)
+ ((listp org-agenda-files) (org-expand-file-list))
(t (error "Invalid value of `org-agenda-files'")))))
(setq files (apply 'append
(mapcar (lambda (f)
@@ -15468,6 +15468,16 @@ un-expanded file names."
e)))
(org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*")))))
+(defun org-expand-file-list ()
+ "Expand the list of agenda files in `org-agenda-files' with
+`org-directory' as base directory."
+ (when (listp org-agenda-files)
+ (mapcar
+ (lambda (f)
+ (let ((e (expand-file-name
+ (substitute-in-file-name f) org-directory)))
+ e)) org-agenda-files)))
+
;;;###autoload
(defun org-cycle-agenda-files ()
"Cycle through the files in `org-agenda-files'.
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] question about org-agenda-files
2010-08-06 14:14 ` [PATCH] " Noorul Islam
@ 2010-08-07 6:18 ` Carsten Dominik
0 siblings, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2010-08-07 6:18 UTC (permalink / raw
To: Noorul Islam; +Cc: emacs-orgmode, Bastien
On Aug 6, 2010, at 4:14 PM, Noorul Islam wrote:
>
>
> On Fri, Aug 6, 2010 at 4:12 PM, Carsten Dominik <carsten.dominik@gmail.com
> > wrote:
>
> On Aug 6, 2010, at 10:30 AM, Bastien wrote:
>
> Rustom Mody <rustompmody@gmail.com> writes:
>
> Why is it that if org-agenda-files is a list the list should have
> absolute file names whereas when it (points to) a single file
> containing the names those names are allowed to be relative to
> org-directory?
>
> I guess this is a small historical contingency. We might indeed allow
> relative filenames when `org-agenda-files' is a list.
>
> I agree and would welcome a patch for this.
>
>
> Changing this behavior is going to be a significant one as far as
> the current users are concerned. I started working towards a patch
> for this and now I am thinking how not to break existing
> functionality. Or should we force everyone to be relative to org-
> directory?
Hmm, indeed, it might not be as simple, because there are a number of
commands
that manipulate these files.
Let's not do this for now - it needs a careful look.
- Carsten
>
> Here is the simple patch which straight away expands the file names
> with org-directory.
>
> * org.el:
> + org-expand-file-list ()
> Expand the list of agenda files in "org-agenda-files" with "org-
> directory" as base directory.
> + org-agenda-files ()
> Call org-expand-file-list() if "org-agenda-files" is a list.
>
> Thanks and Regards
> Noorul
>
> - Carsten
>
>
>
> _______________________________________________
> 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
>
> <org-agenda-files.txt>
- Carsten
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-07 6:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-01 17:50 question about org-agenda-files Rustom Mody
2010-08-06 8:30 ` Bastien
2010-08-06 10:42 ` Carsten Dominik
2010-08-06 14:14 ` [PATCH] " Noorul Islam
2010-08-07 6:18 ` Carsten Dominik
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.