How do I configure a dedicated location for lock files and auto-save files that works on MS-Windows, GNU/Linux, and macOS? I'm using GNU Emacs 28.2
The following works on GNU/Linux but not on MS-Windows for me:
(setq lock-file-name-transforms
'(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/backup/\\1" t))
auto-save-file-name-transforms
'(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/backup/\\1" t)))
However, my backup directory setting does work for both GNU/Linux and MS-Windows:
(setq backup-directory-alist '((".*" . "~/.emacs.d/backup/")))