Closed seflue closed 6 months ago
Does the issue happen when you do not use ft = 'org'
?
It does look like there is some file that is treated as a directory, but that should not happen because I use glob
function to find all the files. I also have directories in my orgfiles and lazy load my org plugin without any issues.
If this does not happen without ft = 'org'
, I'll need more info in the setup part. The minimal init you provided does not have anything.
Without ft='org'
the plugin just doesn't load for the orgfile, until I type :set filetype=org
which produces the very same error.
It doesn't work for any orgfile? Even if you open one that is outside of your agenda files? Here are few steps how you can debug it:
org_agenda_files
and try opening some specific file, check if it works:set debug=msg
. This should print more errors.When I edit an org-file outside of the agenda files, I get the error message on writing the file. If I change my agenda file folder to an empty one, the error message is gone - but the plugin only loads, if I set the filetype to "org".
So the ft option is not the source of the error but some unexpected file/folder in my agenda folders. I have also non-org files in my agenda folders but I used the pattern somefolder/**/*.org
in the past to configure my agenda files. Because of the error I changed that to somefolder/**/*
(according to the documentation) but this didn't remove the error.
Setting org
as extension in glob is not necessary since I filter out only valid ones anyway. https://github.com/nvim-orgmode/orgmode/blob/master/lua/orgmode/files/init.lua#L353-L356
You can do it if you have a lot of files just to speed up the glob.
I'm not sure which non-org files you have. I have images and those are not causing any issues.
Also, do you get these errors on 0.3.1
version (with nvim-treesitter dependency)? If not, I'd appreciate it if you could bisect and see where the issue happens. I'll introduce a better error message once I figure out what the issue is and how to reproduce it.
Thanks for the hints. I will try to find the cause as soon as I have some more time and give you an update.
Found the cause: A directory with somename.org
somehow sneaked into my agenda folders. It would be great, if you can catch this case somehow, because it could happen very easily, that someone creates a folder named something.org
by purpose or by mistake.
Thanks, I'll look into it.
I pushed a fix. It will not warn you, it will just ignore everything that is not a file. That should fix the issue.
Describe the bug
When I load orgmode as ftplugin when opening org-files, I get the following error:
There were a lot of changes in the last weeks. After poking around a little bit in the code, I have the feeling, that the behavior how agenda files are read in, has changed and I might have a folder in my agenda files, which the function tries to treat as a file.
In this case I would expect a bit more robust behavior and at least give a hint, which file/folder is causing the error.
Currently I don't have the time to do a deeper investigation. If you, @kristijanhusak have an idea, I would be thankful, but if not, I will come back to this issue as soon as I have enough time to find out, what the cause actually is.
Steps to reproduce
ft = "org",
to orgmode config (Lazy module)Expected behavior
Load my orgfile without complaining.
Emacs functionality
No response
Minimal init.lua
Screenshots and recordings
No response
OS / Distro
Ubuntu 22.04
Neovim version/commit
v0.9.5
Additional context
No response