Search code examples
emacselisp

emacs: force ido-mode to forget history


I wonder if I can keep ido from not remembering my history and only show completions for files that are in the current directory when I am searching for a file. I understand that this history feature is useful at times, but I often end up editing the incorrect file because I think I am editing file called 'abc.txt' in the current directory but in fact I am editing the file by the same name in another one that I previously visited (often happens when there is not an 'abc.txt' in the current directory, as I mistakenly assume). From reading the ido.el file I thought to set in my .emacs file (also evaluated these expressions in running emacs instance):

(custom-set-variables
 '(ido-enable-last-directory-history nil)
 '(ido-record-commands nil)
)

and deleted a file called .ido.last in ~/, but still it remembers some previous files I've visited before making these changes. How can I purge my previous history, and I am not entirely sure what the difference between the two variables above are but seems to have done the trick to keep ido from remembering files I visit in the future?

Thanks for your help!


Solution

  • Deleting ~/.ido.last and setting the variables as above appears to keep ido from searching files visited in the past.

    Edit: Actually, the full customization for this task would be

    (custom-set-variables
     '(ido-enable-last-directory-history nil)
     '(ido-record-commands nil)
     '(ido-max-work-directory-list 0)
     '(ido-max-work-file-list 0))