I'd like some kind of visual feedback in the mode-line, saying whether the current buffer is a file that is added to the org-agenda. Is there some way to do that?;)
I recommend always avoiding unnecessary dynamic evaluations in the mode line, so I suggest you do the look-up in
find-file-hook. The simplest approach to that means that you won't automatically see mode line 'corrections' to existing buffers if you update
org-agenda-files (you would need to revisit the file), but the benefit is that the mode line rendering is very cheap.
(require 'org) (defvar-local my-org-agenda-file-p nil "Whether this buffer's file is a member of `org-agenda-files'.") (defun my-org-agenda-file-check () "Update `my-org-agenda-file-p'." (when (member buffer-file-name (org-agenda-files t)) (setq my-org-agenda-file-p t))) (add-hook 'find-file-hook #'my-org-agenda-file-check) (add-to-list 'global-mode-string '(my-org-agenda-file-p "Agenda"))
I can't guess whether you want to pass the ARCHIVES argument to
org-agenda-files, so you should check that yourself.
(org-agenda-files &optional UNRESTRICTED ARCHIVES)