From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li Subject: 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/)] Date: Tue, 12 Nov 2019 22:39:03 -0800 Message-ID: <80d0dwmgag.fsf@felesatra.moe> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55541) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUmJ2-0007hf-NT for emacs-orgmode@gnu.org; Wed, 13 Nov 2019 01:39:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUmJ1-0007vS-La for emacs-orgmode@gnu.org; Wed, 13 Nov 2019 01:39:08 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:42653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUmJ1-0007so-DH for emacs-orgmode@gnu.org; Wed, 13 Nov 2019 01:39:07 -0500 Received: by mail-pl1-x633.google.com with SMTP id j12so635928plt.9 for ; Tue, 12 Nov 2019 22:39:06 -0800 (PST) Received: from localhost ([2600:1700:7270:7d1f:fa59:71ff:fe00:10cc]) by smtp.gmail.com with ESMTPSA id g6sm1112899pfh.125.2019.11.12.22.39.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 22:39:04 -0800 (PST) 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" To: emacs-orgmode@gnu.org The docstring for org-agenda-skip-unavailable-files says: Non-nil means to just skip non-reachable files in =E2=80=98org-agenda-files= =E2=80=99. 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 cal= led, 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/)