Apologies for the delay on this, between kids and massive internet-wide
security incidents it's been a hectic couple of weeks. I've been digging
around the related functions to better understand them and I think that
this may also need to be handled in `org-agenda-file-to-front' because it
actually expands whatever the current list is to just filenames here (using
the github mirror because Savannah CGIT has not worked for me for weeks):

https://github.com/emacs-straight/org-mode/blob/main/lisp/org.el#L16105

`org-store-new-agenda-file-list' really just clobbers whatever is already
there with whatever list is passed in. The current function doc doesn't
really provide much meaningful intent:

"Set new value for the agenda file list and save it correctly."

(I guess it's better than saving it incorrectly 😂)

In terms of how we actually want to fix this, I'd like some input on what a
proper "move to front" would look like when one or more entries in the
`org-agenda-files' custom var are directories. For example, if the current
list is

("~/some-file.org" "~/some-directory")

and someone calls org-agenda-file-to-front on "~/some-directory/myfile.org",
do we want to promote the existing parent directory since it's already in
the list:

("~/some-directory" "~/some-file.org")

or would we want to explicitly only promote the current file:

("~/some-directory/myfile.org" "~/some-file.org" "~/some-directory")

I'm not sure which of this is more "correct" (second one seems more
explicit, at least), but either way I think it's hard to handle *after* the
existing org-agenda-files is expanded out into discrete files.

Cheers,

Derek



On Tue, Oct 13, 2026 at 10:14 AM Ihor Radchenko <[email protected]> wrote:

> Derek Chen-Becker <[email protected]> writes:
>
> > Ihor, if you're not already looking at this one I can investigate and put
> > together a patch.
>
> No, I am not looking at this one. Feel free to work on the patch.
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---------------------------------------------------------------+
| Derek Chen-Becker                                             |
| GPG Key available at https://keybase.io/dchenbecker and       |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---------------------------------------------------------------+

Reply via email to