From ec1244970a64b70f4bdbfd7ab03711e273fc12dd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 9 Dec 2023 11:04:13 +0200 Subject: [PATCH] ; Fix documentation of 'minibuffer-sort-by-history' * etc/NEWS: * lisp/minibuffer.el (completions-sort): Doc fix. --- etc/NEWS | 4 ++-- lisp/minibuffer.el | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 93cecfe2d32..17816e5f172 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -653,8 +653,8 @@ is t by default. *** New value 'historical' for user option 'completions-sort' When 'completions-sort' is set to 'historical', completion candidates -will be sorted by their chronological order in the minibuffer history, -with more recent candidates appearing first. +will be first sorted alphabetically, and then re-sorted by their order +in the minibuffer history, with more recent candidates appearing first. ** Pcomplete diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index d35a487a6cf..e5c5fd62f8c 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1323,7 +1323,9 @@ If it's nil, sorting is disabled. If it's the symbol `alphabetical', candidates are sorted by `minibuffer-sort-alphabetically'. If it's the symbol `historical', candidates are sorted by -`minibuffer-sort-by-history'. +`minibuffer-sort-by-history', which first sorts alphabetically, +and then rearranges the order according to the order of the +candidates in the minibuffer history. If it's a function, the function is called to sort the candidates. The sorting function takes a list of completion candidate strings, which it may modify; it should return a sorted list, -- 2.39.2