Code Monkey home page Code Monkey logo

Comments (9)

kristijanhusak avatar kristijanhusak commented on June 12, 2024

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.

from orgmode.

seflue avatar seflue commented on June 12, 2024

Without ft='org' the plugin just doesn't load for the orgfile, until I type :set filetype=org which produces the very same error.

from orgmode.

kristijanhusak avatar kristijanhusak commented on June 12, 2024

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:

  1. Remove org_agenda_files and try opening some specific file, check if it works
  2. Do the thing you did in your last comment, but before that do :set debug=msg. This should print more errors.

from orgmode.

seflue avatar seflue commented on June 12, 2024

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.

from orgmode.

kristijanhusak avatar kristijanhusak commented on June 12, 2024

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.

from orgmode.

seflue avatar seflue commented on June 12, 2024

Thanks for the hints. I will try to find the cause as soon as I have some more time and give you an update.

from orgmode.

seflue avatar seflue commented on June 12, 2024

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.

from orgmode.

kristijanhusak avatar kristijanhusak commented on June 12, 2024

Thanks, I'll look into it.

from orgmode.

kristijanhusak avatar kristijanhusak commented on June 12, 2024

I pushed a fix. It will not warn you, it will just ignore everything that is not a file. That should fix the issue.

from orgmode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.