emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-agenda-skip-unavailable-files removes files instead of skipping [9.2.6 (9.2.6-5-g9c611f-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20191111/)]
@ 2019-11-13  6:39 Allen Li
  0 siblings, 0 replies; only message in thread
From: Allen Li @ 2019-11-13  6:39 UTC (permalink / raw)
  To: emacs-orgmode

The docstring for org-agenda-skip-unavailable-files says:

Non-nil means to just skip non-reachable files in ‘org-agenda-files’.
A nil value means to remove them, after a query, from the list.

However, doing a grep over the org mode code, the only place where this
variable is checked is in org-agenda-files (it is also let bound in
exactly two places):

    (when org-agenda-skip-unavailable-files
      (setq files (delq nil
			(mapcar (function
				 (lambda (file)
				   (and (file-readable-p file) file)))
				files))))

The behavior appears to be contrary to the docstring: A non-nil value means
silently remove non-reachable files and a nil value means do nothing.

Or so it appears.  Actually, the querying for removal happens in
org-check-agenda-file.  It looks like the "just skip non-reachable
files" is implemented by filtering them out so we don't call
org-check-agenda-file on them later.

The problem is that when org-agenda-file-to-front or org-remove-file is called, any
non-reachable files get filtered out from org-agenda-files and then
saved back to the user's customizations.  The result is that setting
org-agenda-skip-unavailable-files to t ends up remove the user's
un-reachable agenda files rather than skipping them, contrary to the
docstring.

If a user did not realize this, they may end up missing important items
on their agenda, if they have some agenda files that are sometimes
missing and get removed from org-agenda-files (e.g., mounted via a
network drive), so in my opinion this is a serious bug.

Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
 of 2019-08-29
Package: Org mode version 9.2.6 (9.2.6-5-g9c611f-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20191111/)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-13  6:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  6:39 Bug: org-agenda-skip-unavailable-files removes files instead of skipping [9.2.6 (9.2.6-5-g9c611f-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20191111/)] Allen Li

Code repositories for project(s) associated with this 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).