spacemacs
spacemacs copied to clipboard
Putting "TODO" in the name of an .org file removes it from the *Spacemacs* buffer
Took me forever to figure this out, because there's some filter that only catches some files with TODO in the name and removes them from the *Spacemacs* buffer. The archive file for the files in question do show up in the *Spacemacs* buffer. The expected behavior should be that either or both files show up in the list, not the least used one while filtering the most used one.
How to recreate:
Create a file, e.g. ~/TODO.WORK.org. (~/WORK.TODO.org, and versions with all lowercase act the same)
Open it in spacemacs [spc] f f
Populate it with data, save it. :w
Archive some of the data. C-c C-x C-s
This should create a file ~/TODO.WORK.org_archive.
Open this file in spacemacs. [spc] f f
Restart spacemacs.
NOTE: the primary file TODO.WORK.org is NOT in the recent files list in the *Spacemacs* buffer, but the TODO.WORK.org_archive file is. This is suboptimal.
However, if you open ~/.emacs.d/.cache/recentf, both files are clearly listed in the recentf file, which causes confusion, because there's no obvious documentation of a filter being applied after the recentf file is read in by Spacemacs. The files are clearly listed, the documentation says that this is the list that the *Spacemacs* buffer populates from, yet some files that clearly should be are explicitly not showing up in the buffer.
Resolution Suggestion:
- Mention the filter in the comments in
~/.emacs.d/.cache/recentfand give a short explanation on how to modify it AND/OR, - Rewrite the filter such that user-generated TODO files are not filtered out, but optionally their associated .org_archive files are
I am sorry but I cannot really reproduce your issue. I have made some new files with TODO in their names and worked with them, then restarted emacs and found the file on my home buffer. As far as I know there is no specific filter for this list to be honest. Maybe thats a side effect of org's archive function?
it might be the presence of the word TODO in the file itself then? I'm not entirely sure, but it's definitely happening, and my Spacemacs instance is nearly stock, with only some very basic customization in the .spacemacs file. I've got no custom written functions. Here's what I'm seeing. The file definitely exists, and I've been using it for a few weeks, so it should be on the list. Notice how the archive file is on the list, but the actual working file isn't?
it could be related to this: https://github.com/syl20bnr/spacemacs/issues/4973 ?
I do believe that you are having this issue, however I am still not able to reproduce it following your reproduction steps.
I have double checked whether Spacemacs edits recentf-exclude and it does but so do a lot of packages too. Please post whats the content of recentf-exclude in your Spacemacs session, also your org config could be important, i.e. in my case everything is archieved into a single file however this does not remove it from the recent file list however its not in home either.
Contents of the recentf-exclude variable. Apologies for the (very) extended delay!
("~/.emacs.d/.cache/.custom-settings" "COMMIT_EDITMSG\\'" "~/.emacs.d/elpa/29.2/develop/" "~/.emacs.d/.cache/" "/git-rebase-todo\\'" "/\\(\\(\\(COMMIT\\|NOTES\\|PULLREQ\\|MERGEREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\\|\\(BRANCH\\|EDIT\\)_DESCRIPTION\\)\\'")
Further testing: created a TEST.org file, which shows up. Just in the case that it's filtering on something inside the file, I copied my local #+STARTUP: and #+TAGS: headers - no effect, it still appears properly
Copied WORK.org to WORK2.org in the same directory, and WORK2.org shows up, but WORK.org does not.
M-x recentf-open shows the WORK.org file as expected.
The filtering seems to be coming at the level of spacemacs populating the spacemacs buffer.
Notice in the screenshot the following:
- WORK.org does not show up in the Recent Files list on the spacemacs homepage. WORK2.org does. TEST.org does.
- WORK.org does show up in
M-x recentf-open - WORK.org does show up in the Agenda portion of the spacemacs homepage, so it's clearly recognized.
This is the weirdest thing. It's like Spacemacs doesn't like the phrase "WORK.org" and refuses to recognize it as a valid Recent Files entry.
EDIT: tested one more thing:
Copied the WORK.org file from ~/Documents/org-files/ to ~/Documents/ and it showed up.
So, the file WORK.org only refuses to show up when it's:
- Named precisely WORK.org (renaming it WORK2.org caused the file to act properly)
- In the following directory structure:
~/Documents/org-files/(moving it up a level caused it to act properly)
Again, bizarre.
Spacemacs deliberately removes org agenda files from the spacemacs buffer even if they are in the recentf list. Is this perhaps the behavior you are observing?
See #15307 (and spacemacs-buffer//insert-recent-files for the current implementation).
That's probably it. Thank you! I don't see an easy way to configure Spacemacs to allow agenda entries, I'll just edit the file referenced by the commit locally and be happy.
Off topic but tangentially relevant: Why would someone consider agenda files in recent files a problem? It's literally one of the main reasons for using org-mode in the first place. An agenda file is a controlling org document for organizing things by date, it's no different, and considerably more important at a high level than, say, your average code document., considering what it does. Removing it from recent files seems suboptimal. I don't know about anyone else's use cases, but mine is that that document is the very first thing I encounter every day, to organize the rest of my day/week/month, so having it in recent files seems like the place it should be.
It's easy enough to open all of your agenda files by just running org-agenda-list (e.g., SPC a o a). Meanwhile, it's often the case that for a user with lots of agenda files, that basically always takes over the whole homepage list and no other recent files get displayed.
FYI you can also set dotspacemacs-startup-lists in your .spacemacs to add agenda items to the home buffer if you like.