After every OCaml programming session, my recentf list is polluted with directories such as


generated by ocamlformat. I want these to be hidden from the list, by blacklisting /private/var/folders/.

How can I achieve this? I have looked up functions starting with recentf-, but recentf seems to not provide any functions to do this.

  • @Drew Yes, it does! Thanks a lot. Commented Jul 20, 2021 at 22:34

1 Answer 1


Evaluate :

(add-to-list 'recentf-exclude "/private/var/folders/.*") 

To activate it permanently, save it in your init file (.emacs or .emacs.d/init.el).

Not the answer you're looking for? Browse other questions tagged or ask your own question.