emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Tyler Smith <tyler@plantarum.ca>
Cc: orgmode list <emacs-orgmode@gnu.org>
Subject: Re: adding file to agenda removes directories
Date: Thu, 31 Dec 2015 18:54:31 -0500	[thread overview]
Message-ID: <87lh8a6uo8.fsf@kyleam.com> (raw)
In-Reply-To: <87mvsq4cr5.fsf@plantarum.ca> (Tyler Smith's message of "Thu, 31 Dec 2015 14:52:14 -0500")

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

      reply	other threads:[~2015-12-31 23:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-31 19:52 adding file to agenda removes directories Tyler Smith
2015-12-31 23:54 ` Kyle Meyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lh8a6uo8.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tyler@plantarum.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).