From 4b1aa935dec63df4c2f9369159552ca6c8c7ee4c Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Thu, 22 Dec 2022 11:52:14 -0600 Subject: [PATCH] word: Use sort with 'scandir' on Mes. * gash/word.scm [mes]: Monkey patch 'scandir' to add sorting. --- gash/word.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gash/word.scm b/gash/word.scm index 3dbe9fc..8dc30aa 100644 --- a/gash/word.scm +++ b/gash/word.scm @@ -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."