reddit / emacs

To create lockfiles outside of the working directory

john_smith_007 · 2022-07-25 09:59
I want lockfiles to be created outside of the working directory, and so I have added the following part into my `init.el`, right from the manual: ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Locks.html (setq lock-file-name-transforms '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/lockfiles/\\1" t))) ;; just in case... (make-directory "~/.emacs.d/lockfiles/" t) However, it doesn't work. Lockfiles (`.#file.ext`) are still created in the same directory where I edit the file itself. Why?
eli-zaretskii · 2022-07-25 12:07
What Emacs version are you using? And on what OS?
john_smith_007 · 2022-07-25 12:28
Emacs 27.1 on Windows 7, 32-bit GNU Emacs 27.1 (build 1, i686-w64-mingw32) of 2020-08-21 Newer Emacs versions simply aren't supported on my system, if I recall correctly.
eli-zaretskii · 2022-07-25 16:28
> Emacs 27.1 on Windows 7, 32-bit The example in the manual is for Unix, because it assumes absolute file names begin with a slash. (It is generally a good idea to understand the examples before copy-pasting them, yes?) > Newer Emacs versions simply aren't supported on my system, if I recall correctly. Only the "official" binaries, but you can build it yourself. I'm running a 32-bit build of Emacs 28 on Windows 10, FWIW.