feat(lib): add doom/remove-recent-file

To interactively remove a file from your recentf list. (Perhaps similar
could be added to embark for consult-recent-files?)
This commit is contained in:
Henrik Lissner 2021-10-09 19:36:00 +02:00
parent 6bd9c7c880
commit 281ee1d27b

View file

@ -335,3 +335,13 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."
(with-current-buffer origin
(revert-buffer t t))))
(user-error "Unable to open %S" file))))
;;;###autoload
(defun doom/remove-recent-file (file)
"Remove FILE from your recently-opened-files list."
(interactive
(list (completing-read "Remove recent file: " recentf-list
nil t)))
(setq recentf-list (delete file recentf-list))
(recentf-save-list)
(message "Removed %S from `recentf-list'" (abbreviate-file-name file)))