From 3bcee249d3e814ff15ddd59add491625d308352e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 9 Oct 2021 19:56:40 +0200 Subject: [PATCH] fix: side-effects unset backup-directory-alist --- core/core-editor.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 061597818..16aee9a81 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -159,7 +159,7 @@ tell you about it. Very annoying. This prevents that." (sha1 buffer-file-name)))) (funcall fn))) -;; HACK Does the same for Emacs backup files, but also packages that use +;; HACK ...does the same for Emacs backup files, but also packages that use ;; `make-backup-file-name-1' directly (like undo-tree). (defadvice! doom-make-hashed-backup-file-name-a (fn file) "A few places use the backup file name so paths don't get too long." @@ -167,10 +167,11 @@ tell you about it. Very annoying. This prevents that." (let ((alist backup-directory-alist) backup-directory) (while alist - (let ((elt (pop alist))) + (let ((elt (car alist))) (if (string-match (car elt) file) (setq backup-directory (cdr elt) - alist nil)))) + alist nil) + (setq alist (cdr alist))))) (let ((file (funcall fn file))) (if (or (null backup-directory) (not (file-name-absolute-p backup-directory)))