0

I would like to disable emacs lock files. Per this thread it is possible to do it with (setq create-lockfiles nil).

However, when I put this in my .emacs file and start up, the value of this variable (via describe-variable) is t. If I set it manually via set-variable then it sticks and works as expected.

I'm using GNU Emacs 24.5.1, via the Goulet installer for windows. For what it's worth, I tried a fresh install of Emacs on a brand new PC (Win10) and it has the same issue. I also tried commenting out everything except this line in my config file, and it still failed to work.

Why would it not work if put at the end of my .emacs file? Is some other emacs package overwriting this (perhaps ESS)? Is there a way to set it permanently, after everything else is loaded?

Thanks

Community
  • 1
  • 1
  • Yes, something else is overriding it. I would rgrep* your whole config for `create-lockfiles` (and failing that, the site-lisp directories) and see if anything turns up. Note that if you have ELPA packages installed, they will be enabled *after* your init file is processed. If that's where it's happening, you can use [`after-init-hook`](http://stackoverflow.com/a/18783152) as a workaround; but following up the actual cause would also be a good idea *(\*) or whatever your Windows equivalent is, if you don't have grep support set up for Emacs.* – phils Jul 10 '16 at 23:11
  • ESS is indeed the culprit here. It make `create-lockfiles` a local variable... – thisirs Jul 11 '16 at 08:47
  • Thanks for the info. I tried adding `(add-hook 'after-init-hook (lambda () (setq create-lockfiles nil)))` to my init file but that still doesn't work. Is this the wrong way to use `after-init-hook` in this case? – Cole Monnahan Jul 11 '16 at 15:29
  • @ColeMonnahan Better use `setq-default` now that it's buffer local. – thisirs Jul 11 '16 at 20:27
  • @thisirs This worked. I wasn't aware of the difference so thanks for the tip. Anyone having the same issue with ESS, add this to your .emacs: `(add-hook 'after-init-hook (lambda () (setq-default create-lockfiles nil)))` to stop the lockfiles (.#) from being created. – Cole Monnahan Jul 11 '16 at 21:46

0 Answers0