使用ido完成方式更改Emacs存储的recentf文件数量

3
我正在使用此页面上列出的ido方法: http://www.emacswiki.org/emacs/RecentFiles。我希望能够选择存储的最近文件数量。它似乎没有存储很多文件。是否有相应的设置或简单的方法可以实现?参考以下函数。干杯
    (defun recentf-interactive-complete ()
  "find a file in the recently open file using ido for completion"
  (interactive)
  (let* ((all-files recentf-list)
     (file-assoc-list (mapcar (lambda (x) (cons (file-name-nondirectory x) x)) all-files))
     (filename-list (remove-duplicates (mapcar 'car file-assoc-list) :test 'string=))
     (ido-make-buffer-list-hook
      (lambda ()
        (setq ido-temp-list filename-list)))
     (filename (ido-read-buffer "Find Recent File: "))
     (result-list (delq nil (mapcar (lambda (x) (if (string= (car x) filename) (cdr x))) file-assoc-list)))
     (result-length (length result-list)))
    (find-file 
     (cond 
      ((= result-length 0) filename)
      ((= result-length 1) (car result-list))
      ( t
    (let ( (ido-make-buffer-list-hook
        (lambda ()
          (setq ido-temp-list result-list))))
      (ido-read-buffer (format "%d matches:" result-length))))
      ))))
1个回答

9
也许您需要将recentf-max-saved-items设置为特定的值,例如:
(setq recentf-max-saved-items 30) ; or what ever you want

这似乎与旧版本中的 recentf-max-menu-items 发生了变化。 - Svante
2
不,recentf-max-menu-items 确定显示多少项,而不是保存多少项。例如,您可以保存最近的 500 个项目,仅显示前 30 个。 (然后,当您想利用更深的历史记录时,可以使用 ido 或其他工具) - PythonNut

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接