From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: adding file to agenda removes directories Date: Thu, 31 Dec 2015 18:54:31 -0500 Message-ID: <87lh8a6uo8.fsf@kyleam.com> References: <87mvsq4cr5.fsf@plantarum.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEn3I-0007SC-O6 for emacs-orgmode@gnu.org; Thu, 31 Dec 2015 18:54:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEn3F-00068S-I8 for emacs-orgmode@gnu.org; Thu, 31 Dec 2015 18:54:40 -0500 Received: from pb-smtp0.int.icgroup.com ([208.72.237.35]:51586 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEn3F-00068O-Bk for emacs-orgmode@gnu.org; Thu, 31 Dec 2015 18:54:37 -0500 In-Reply-To: <87mvsq4cr5.fsf@plantarum.ca> (Tyler Smith's message of "Thu, 31 Dec 2015 14:52:14 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tyler Smith Cc: orgmode list Tyler Smith 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