如何让Emacs ido-mode的recentf-list忽略不感兴趣的文件?
我在xSteve's function for ido recent files中使用ido-mode (函数见下文)。
但现在,它首先显示不感兴趣的文件,如下所示:
-> ~/.ido-last
~/Library/Application Support/Aquamacs Emacs/recent-addresses
~/Documents/journal.org那么,如何让ido-mode忽略像~/.ido-last和~/Library/Application Support/Aquamacs Emacs/recent-addresses这样的无用文件呢
附注:下面是该函数,供参考:
(defun xsteve-ido-choose-from-recentf ()
"Use ido to select a recently opened file from the `recentf-list'"
(interactive)
(let ((home (expand-file-name (getenv "HOME"))))
(find-file
(ido-completing-read "Recentf open: "
(mapcar (lambda (path)
(replace-regexp-in-string home "~" path))
recentf-list)
nil t))))
(global-set-key [(meta f11)] 'xsteve-ido-choose-from-recentf)发布于 2013-02-17 05:20:13
一种让recentf忽略某些文件的方法,只需将适当的regexp添加到recentf-exclude列表中:
(add-to-list 'recentf-exclude "\\.windows\\'")
(add-to-list 'recentf-exclude "\\.revive\\'")这将防止上述的任何未来条目被添加到最近列表中。需要删除recentf文件中的当前条目才能永久删除它们,或者直到它们从其他条目中逐步删除。
来源:Force emacs recent files using recentf to ignore specified files (.windows and .revive for example)
https://stackoverflow.com/questions/14915033
复制相似问题