Add function to remove non-existant files from file-name-history

This commit is contained in:
Adam Goldsmith 2021-01-04 13:29:09 -05:00
parent 0c123b0c74
commit f1e539139e
1 changed files with 9 additions and 1 deletions

View File

@ -61,7 +61,15 @@
(use-package savehist :demand
:config
(savehist-mode))
(savehist-mode)
(defun savehist-file-name-history-cleanup ()
"Delete all the files in file-name-history that don't exist anymore"
(interactive)
(setq file-name-history
(seq-filter
(lambda (file)
(or (file-remote-p file) (file-exists-p file)))
file-name-history))))
(use-package paren :demand
:config