【问题标题】:How do I get Emacs ido-mode's recent file list to ignore uninteresting files?如何获取 Emacs ido-mode 的最近文件列表以忽略不感兴趣的文件?
【发布时间】:2013-02-16 20:58:49
【问题描述】:

如何让 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)

【问题讨论】:

标签: emacs ido-mode recent-file-list


【解决方案1】:

一种使recentf 忽略某些文件的方法,只需将适当的正则表达式添加到recentf-exclude 列表中:

(add-to-list 'recentf-exclude "\\.windows\\'")
(add-to-list 'recentf-exclude "\\.revive\\'")

这将防止上述任何以后的条目被添加到recentf 列表中。需要删除您的 recentf 文件中的当前条目,以便将它们永久删除,或者直到它们从其他条目中逐步淘汰。

来源:Force emacs recent files using recentf to ignore specified files (.windows and .revive for example)

【讨论】:

    猜你喜欢
    • 2013-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-09
    • 1970-01-01
    • 2012-07-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多