J Spen
J Spen

Reputation: 2674

Change number of files recentf in emacs stores using ido completion method

I'm using the ido method listed on this page: http://www.emacswiki.org/emacs/RecentFiles. I want to be able to select the number of recent files it stores. It seems to not store very many. Is there a setting for this or an easy way to do so. Function listed below for reference. Cheers

    (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))))
      ))))

Upvotes: 3

Views: 988

Answers (1)

Tao Peng
Tao Peng

Reputation: 2718

Maybe you need set recentf-max-saved-items to a specified value, for example:

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

Upvotes: 9

Related Questions