Add function to remove non-existant files from file-name-history
This commit is contained in:
parent
0c123b0c74
commit
f1e539139e
@ -61,7 +61,15 @@
|
|||||||
|
|
||||||
(use-package savehist :demand
|
(use-package savehist :demand
|
||||||
:config
|
: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
|
(use-package paren :demand
|
||||||
:config
|
:config
|
||||||
|
Loading…
Reference in New Issue
Block a user