I find autocomplete features in Emacs very helpful. Every time I type a partial word, it infers what the word I have in mind based on some history it has seen so far. I am not exactly sure how. I've install abbrev-mode and probably several autocomplete packages (company-mode) for specific programming languages.

Currently, the order of the list of possible completion seems to be static and based on alphabetic/lexicographic order.

My question is:

Is there some mode in Emacs or way to configure Emacs such that the Most Recently Used (MRU) completions show up first in the selection list?

(This is with Emacs 27 under Ubuntu 20.04)

1 Answer 1


One way is modes based on prescient

The last few candidates you selected are displayed first, followed by the most frequently selected ones, and then the remaining candidates are sorted by length. If you don't like the algorithm used for filtering, you can choose a different one by customizing prescient-filter-method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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