11

I have always been bugged by the fact that when exiting with revive.el and windows.el enabled it opens a file and writes to it called .revive and .windows. These are saved so it goes in the recent files list. Is there anyway to make it ignore these files or any other files I desire.

J Spen
  • 2,614
  • 4
  • 26
  • 41

1 Answers1

18

A way to make recentf ignore some files is to add appropriate regexps to recentf-exclude list:

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

This will prevent any future entries of the above from being added to the recentf list. You need to delete the current entries in your recentf file for them to be permanently removed or wait until they are phased out from other entries.

johnny
  • 657
  • 7
  • 18
Victor Deryagin
  • 11,895
  • 1
  • 29
  • 38
  • That appeared not to work. Are those regexps right? Should they remove the \'. I don't know regexps very well. – J Spen Nov 06 '11 at 05:11
  • 1
    @J Spen: "\\'" just marks the end of the string, you may leave it out, of course. – Victor Deryagin Nov 06 '11 at 05:14
  • I even tried without using regexp already and just put ".windows". This didn't work either. How do I check in emacs what recentf-exclude current value is. Also, I thought it might be because save files is already has that saved in it. – J Spen Nov 06 '11 at 07:21
  • 2
    Sorted it out. It was the latter of what I said in the comment above. The ones already stored never got removed. Once I deleted them they didn't show back up. Cheers for the help. – J Spen Nov 06 '11 at 07:24
  • 12
    Running `M-x recentf-cleanup` will update your `recentf-list` with the new `recentf-exclude` rules. – Tom May 01 '13 at 23:18
  • 1
    @JSpen So the \\ at the beginning and the end of the regexps are pointless? – incandescentman Jun 23 '17 at 06:48
  • I hace tried this to exclude `__init__.py` file but it did not work @Victor Deryagin – alper Jun 05 '20 at 23:50
  • What should I write to ignore `Ibuffer*` buffer ? – alper Aug 15 '21 at 12:53