From: Eli Zaretskii Date: Sat, 9 Dec 2023 09:04:13 +0000 (+0200) Subject: ; Fix documentation of 'minibuffer-sort-by-history' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ec1244970a64b70f4bdbfd7ab03711e273fc12dd;p=emacs.git ; Fix documentation of 'minibuffer-sort-by-history' * etc/NEWS: * lisp/minibuffer.el (completions-sort): Doc fix. --- 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,