word: Use sort with 'scandir' on Mes.

* gash/word.scm [mes]: Monkey patch 'scandir' to add sorting.
This commit is contained in:
Timothy Sample 2022-12-22 11:52:14 -06:00
parent 6c67d7b23d
commit 4b1aa935de
1 changed files with 10 additions and 0 deletions

View File

@ -37,6 +37,16 @@
;;;
;;; Code:
(cond-expand
(mes
;; We need to sort the results of 'scandir' when globbing, so we
;; monkey patch Mes' 'scandir' to do so.
(let ((core:scandir scandir))
(set! scandir
(lambda (name select?)
(sort (core:scandir name select?) string<)))))
(else))
(define (normalize-word word)
"Normalize @var{word} (which may be a word or a qword) so that it is
guaranteed to be a list."