mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
fix: side-effects unset backup-directory-alist
This commit is contained in:
@ -159,7 +159,7 @@ tell you about it. Very annoying. This prevents that."
|
|||||||
(sha1 buffer-file-name))))
|
(sha1 buffer-file-name))))
|
||||||
(funcall fn)))
|
(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).
|
;; `make-backup-file-name-1' directly (like undo-tree).
|
||||||
(defadvice! doom-make-hashed-backup-file-name-a (fn file)
|
(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."
|
"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)
|
(let ((alist backup-directory-alist)
|
||||||
backup-directory)
|
backup-directory)
|
||||||
(while alist
|
(while alist
|
||||||
(let ((elt (pop alist)))
|
(let ((elt (car alist)))
|
||||||
(if (string-match (car elt) file)
|
(if (string-match (car elt) file)
|
||||||
(setq backup-directory (cdr elt)
|
(setq backup-directory (cdr elt)
|
||||||
alist nil))))
|
alist nil)
|
||||||
|
(setq alist (cdr alist)))))
|
||||||
(let ((file (funcall fn file)))
|
(let ((file (funcall fn file)))
|
||||||
(if (or (null backup-directory)
|
(if (or (null backup-directory)
|
||||||
(not (file-name-absolute-p backup-directory)))
|
(not (file-name-absolute-p backup-directory)))
|
||||||
|
Reference in New Issue
Block a user