emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* adding file to agenda removes directories
@ 2015-12-31 19:52 Tyler Smith
  2015-12-31 23:54 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Tyler Smith @ 2015-12-31 19:52 UTC (permalink / raw)
  To: orgmode list

Hi again,

Continuing to play around with getting org files into my agenda, I run
into this:

I set up org-agenda-files to contain ~/org/, such that all files in that
directory are in my agenda. I then add an individual file from
elsewhere, via org-agenda-file-to-front. In the process, the entry for
the ~/org/ directory is removed, and replaced with explicit entries for
every org file in that directory. This leads to surprising behaviour,
where new org files in ~/org/ aren't detected by the agenda.

The help suggests that org-agenda-files can be a list of 'files and
directories', but this behaviour seems to suggest that it can be a list
of files, *or* a directory. Am I doing something wrong, or can I not
combine files and directories in org-agenda-files?

Thanks,

Tyler

-- 
http://plantarum.ca

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: adding file to agenda removes directories
  2015-12-31 19:52 adding file to agenda removes directories Tyler Smith
@ 2015-12-31 23:54 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2015-12-31 23:54 UTC (permalink / raw)
  To: Tyler Smith; +Cc: orgmode list

Tyler Smith <tyler@plantarum.ca> writes:

> I set up org-agenda-files to contain ~/org/, such that all files in that
> directory are in my agenda. I then add an individual file from
> elsewhere, via org-agenda-file-to-front. In the process, the entry for
> the ~/org/ directory is removed, and replaced with explicit entries for
> every org file in that directory. This leads to surprising behaviour,
> where new org files in ~/org/ aren't detected by the agenda.
>
> The help suggests that org-agenda-files can be a list of 'files and
> directories', but this behaviour seems to suggest that it can be a list
> of files, *or* a directory. Am I doing something wrong, or can I not
> combine files and directories in org-agenda-files?

Right, glancing at org-agenda-file-to-front's code, I don't think it's
currently possible to use it and keep directory entries from being
replaced with the Org files they contain at that time.

Like you, I'd expect the directory entries to stay intact, but I'm
guessing the behavior is the way it is because

* Doing otherwise would make the code more complicated.

* org-agenda-file-to-front moves a file to the front or end of the
  agenda list, but, if directories are left as is, calling
  org-agenda-file-to-front on a file within an agenda directory would
  duplicate that file in the return value of (org-agenda-files).  Just
  expanding the files avoids having to decide how to deal with this.

--
Kyle

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-31 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-31 19:52 adding file to agenda removes directories Tyler Smith
2015-12-31 23:54 ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).