From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: org-map-entries calls org-agenda-prepare-buffers unnecessarily? Date: Sun, 24 Jun 2018 23:07:59 -0500 Message-ID: <878t73jyow.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXInT-0006K8-SN for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 00:08:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXInQ-0008HX-MN for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 00:08:11 -0400 Received: from [195.159.176.226] (port=37581 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXInQ-0008HE-F1 for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 00:08:08 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fXIlH-0007bH-7r for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 06:05:55 +0200 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 Hi, I've noticed that org-map-entries calls org-agenda-prepare-buffers whenever its SCOPE argument is nil. According to the docstring, a nil SCOPE means, "The current buffer, respecting the restriction if any," so it doesn't seem necessary to call org-agenda-prepare-buffers. I noticed this because I have a function in my org-mode-hook that runs org-map-entries (applying a read-only property to entries with a read_only tag), and whenever I find-file on a non-existent Org file, I'm prompted, "Non-existent agenda file %s. [R]emove from list or [A]bort?", which is caused by org-map-entries being called with a nil SCOPE, which calls org-agenda-prepare-buffers, which calls org-check-agenda-file on the not-yet-existent file. So if this behavior is indeed unnecessary, it would be nice to fix it. Is this a bug, or am I missing something? Thanks.