I store a link such as [[file:~/path/to/dir/some file.txt::# heading]], either manually or through org-capture. A few days later, Org has converted all spaces to the HTML entity %20: [[file:~/path/to/dir/some%20file.txt::#%20heading]], and the link now fails.

The file on disk does not change, rather Org (or some other process) changes the link to that file, replacing spaces with %20.

Why is this happening, and how can I prevent it?

  • 1
    So you enter the link in the file and let the file sit for a few days and then you open it again and it has changed? Have you determined what time the change occurred? How frequent the change is? Try changing it back and checking on it every so oftern with ls -l to figure out when it changes. My suspicion is a cron job (or an emacs timer) going off and doing the damage. Knowing how often and when it changes might help narrow down the suspects. – NickD Oct 8 '20 at 0:05
  • @NickD: the file does not change on disk, rather the link to the file in the Org buffer changes, replacing spaces with %20. I edited the question to clarify, thanks for the pointer. – miguelmorin Oct 12 '20 at 13:17
  • 1
    I don't care about the target of the link, I care about the Org mode file that contains the link. Can you please explain what happens to it? If you kill the buffer and cat the Org mode file, has the link changed? If you revisit the file, has the link changed? If you keep the buffer open, does the link change? – NickD Oct 12 '20 at 13:24
  • The link does not change when I close the Org buffer and open it again. I programmed a timer to warn me when it does and will provide an update here. – miguelmorin Oct 13 '20 at 16:33

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.