使用ido完成方法更改emacs商店中的recentf文件数

时间:2011-11-05 22:11:55

标签: emacs elisp recent-file-list

我正在使用此页面上列出的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 个答案:

答案 0 :(得分:6)

也许您需要将recentf-max-saved-items设置为指定值,例如:

(setq recentf-max-saved-items 30) ; or what ever you want