I extensively use links to refer to different org files/ headings. All my links are created using IDs.

But it might happen that in the course of work, some links might get broken --- the reference is deleted. It also might happen that an ID was created for the heading but the linking never happened.

org-lint can identify broken links. But in my case, it identified some working links also as broken links. Secondly, it works only on the current buffer.

Is it possible to generate a list of all the broken links and list of all the unused IDs across all files in directory (including sub-directories)?

  • Tyler wrote-up a broken-links check function: emacs.stackexchange.com/a/5431/2287 I modified it a bit for my own needs, but my recollection is that he gave me a really good head-start with the linked answer. I have not looked-up unused ID's ... – lawlist Apr 8 at 4:44
  • @lawlist Thanks. I also discovered org-lint. But two problems. org-lint identified some working links as broken links with high trust. Secondly, these only check the current buffer. I wanted a solution that traverses a directory tree. I have edited the question for this. – deshmukh Apr 8 at 5:24
  • If you can create a minimal example with working links that org-lint identifies as broken (or you can trace the code and explain why it is wrong), please post a bug on the Org mode mailing list. – NickD Apr 8 at 6:07
  • @NickD Unfortunately, I am not able to create a minimal working example. Here is the output produced by org-lint: 7 high Unknown ID "4da2fd15-3343-4d2b-9962-4c85492de415" 7 high Unknown ID "ef0f88ce-fcab-4220-afda-bc53f22181b4" 7 high Unknown ID "5e9ae306-4720-4a3a-a7ce-727cba55399c" 20 high Unknown ID "0708d77f-6c4e-4051-9adb-9bcb687efff3" 27 high Unknown ID "f0b505b9-6433-42bf-8a18-6ed67eefeb12" 54 high Unknown ID "5e9ae306-4720-4a3a-a7ce-727cba55399c" I have checked all these links. They work without error. – deshmukh Apr 8 at 12:06
  • @NickD Also, org-roam-doctor on the same file produces no error! – deshmukh Apr 8 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.