Ignore in recentf all files from the elpa dir and the savefile dir

This commit is contained in:
Bozhidar Batsov 2014-04-30 12:46:32 +03:00
parent 3bed971d1a
commit 0c93a1c542

View file

@ -153,6 +153,15 @@ Will only occur if prelude-whitespace is also enabled."
(setq recentf-save-file (expand-file-name "recentf" prelude-savefile-dir) (setq recentf-save-file (expand-file-name "recentf" prelude-savefile-dir)
recentf-max-saved-items 500 recentf-max-saved-items 500
recentf-max-menu-items 15) recentf-max-menu-items 15)
(defun prelude-recentf-exclude-p (file)
"A predicate to decide whether to exclude FILE from recentf."
(let ((file-dir (file-truename (file-name-directory file))))
(-any-p (lambda (dir)
(string-prefix-p dir file-dir))
(mapcar 'file-truename (list prelude-savefile-dir package-user-dir)))))
(add-to-list 'recentf-exclude 'prelude-recentf-exclude-p)
(recentf-mode +1) (recentf-mode +1)
;; use shift + arrow keys to switch between visible buffers ;; use shift + arrow keys to switch between visible buffers