首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何让Emacs ido-mode的最近文件列表忽略不感兴趣的文件?

如何让Emacs ido-mode的最近文件列表忽略不感兴趣的文件?
EN

Stack Overflow用户
提问于 2013-02-17 04:58:49
回答 1查看 1.2K关注 0票数 0

如何让Emacs ido-mode的recentf-list忽略不感兴趣的文件?

我在xSteve's function for ido recent files中使用ido-mode (函数见下文)。

但现在,它首先显示不感兴趣的文件,如下所示:

代码语言:javascript
复制
-> ~/.ido-last
   ~/Library/Application Support/Aquamacs Emacs/recent-addresses
   ~/Documents/journal.org

那么,如何让ido-mode忽略像~/.ido-last~/Library/Application Support/Aquamacs Emacs/recent-addresses这样的无用文件呢

附注:下面是该函数,供参考:

代码语言:javascript
复制
(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)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-17 05:20:13

一种让recentf忽略某些文件的方法,只需将适当的regexp添加到recentf-exclude列表中:

代码语言:javascript
复制
(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)

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14915033

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档