emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Human-readable file sorting


From: John Wiegley
Subject: Re: Human-readable file sorting
Date: Fri, 19 Feb 2016 22:17:30 -0800
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin)

>>>>> Lars Ingebrigtsen <address@hidden> writes:

> (defun file-string-lessp (s1 s2)
>   (pcase file-sorting-method
>     (,unicode
>      (string-lessp s1 s2))
>     (,human
>      (human-string-lessp s1 s2)))
>     ..)

> (Hey!  Did I get the pcase syntax right?  Bonus points!)

Exception that you picked an instance better suited to `cl-case'. :)

>> But having the extensibility does sound nice.

> If the proposed method sounds fine, I can start implementing...

It sounds reasonable to me. So for changing a single invocation of
`directory-files', would I rely on `file-sorting-method' being a dynamic
variable?

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]