1

I'm in a strange situation.

Emacs automatically backup all of my files except for some of my orgmode files. And I can't understand why.

Do you have any idea how I can investigate and fix this?

5
  • 2
    What does C-h v backup-inhibited say when evaluated in the buffer of one of the files that don't get backed up? What does it say in other buffers?
    – NickD
    Commented Jan 14, 2019 at 20:15
  • Ghah! Me too! I found that something had set backup-inhibited to t (thanks @NickD) The only place I can see that being set is in ./elpa/org-plus-contrib-20181230/ox-odt.el. Maybe that's the culprit?
    – wef
    Commented Jan 15, 2019 at 1:27
  • ... and I can't seem to set it to nil in Local Variables - there must be something setting it to t as org-mode starts up. Maybe I can set it in a late-executing hook - I'll have time to investigate a bit later. On the other hand, maybe there's a good reason for it to be t???
    – wef
    Commented Jan 15, 2019 at 1:40
  • Thanks @wef that's exactly it. Why on earth does org-plus-contrib set backup-inhibited to t? If you happen to find a fix let us know.
    – Rene
    Commented Jan 15, 2019 at 8:01
  • @Rene - not quite. I concluded that it was vc-checkin in my case (please refer to my answer below and see if it's your use-case).
    – wef
    Commented Jan 15, 2019 at 8:16

2 Answers 2

2

If your org files are under version control (which I would recommend) then vc-checkin sets backup-inhibited to t. This makes sense as my .org files are all under version control and don't need the ~ backup. (I use Version Control Always and SRC - Simple Revision Control

If you really want the ~ backups as well, then M-: (setq-local backup-inhibited nil).

1
  • Enable the vc-make-backup-files user option to get normal backups despite version-control.
    – phils
    Commented Mar 7, 2023 at 2:40
0

The last time I ran into similar problems was when some of my file or directory names matched a magic variable which is supposed to prevent saving of unwanted things. In my particular case, the project's directory was called something like com.example.githook and the .git? matched completion-ignored-extensions. It's been a while, though, so I'm not 100% it was that variable.

So, while I can't explain why your files are not backed up, maybe this gives you a hint at what to search for: do the filenames of the files which are not backed up look suspicious?

1
  • well not really. My files names: home1819.org and office1819.org
    – Rene
    Commented Jan 14, 2019 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.