Directory Sorting Order?
Currently, one can sort a directory by one of the three members of type sort-method, but there currently doesn't appear to be a way to sort it ascending or descending. Perhaps we could add a type, sort-direction, and implement it? It could be as simple as changing the :test from #'> to #'<.
Hello, correct. I think we could have the capital S key for that.
but wait, for what exactly, let's think about usage carefully:
- "s" sorts successfully with a different method.
- would "S" simply invert the current order?
what about:
- current order starts at "ascending"
- "s" sorts
- "S" toggles the sort order to "descending" and changes the current file order.
- a repeated press to "S" only inverts the current file order.
- "s" sorts with the next method, respecting the current sord order.
or is "S" better suited to sort with the previous method, and we use another key to inverse the ordering? :thinking:
what are other applications doing? (file manager or web app listing data, etc)
In Doom Emacs, I press S (dirvish-quicksort), which pulls up a menu of options, with the lower-cased keys being one direction, and the upper-cased versions the other. Perhaps we could do something like that? Do we need a separate sorting-direction type & argument, or do we integrate that into sorting-method, or something else?
I think it's a good UX.
We don't have a text-based menu of options, we could shave the yaks and create it beforehand, or in the meantime we could rely on the prompt commands (prompt-for-string etc), in order to autocomplete a choice.
So would it be good to create a separate sorting-direction, or merge that into sorting-method like Dirvish does?
@vindarel
We don't have a text-based menu of options, we could shave the yaks and create it beforehand
What do you think of this? https://github.com/lem-project/lem/blob/0f178254ea848b29d6f40403e79a8fd90419ef6f/src/ext/context-menu.lisp#L76
oh indeed it is useful +1 I forgot about it, it was for the mouse in my mind.
So would it be good to create a separate
sorting-direction, or merge that intosorting-methodlike Dirvish does?
not 100% sure what you mean, but giving an option to the user to choose the default sorting direction is always nice.
not 100% sure what you mean
As in, we'd have a list of sort-methods like pathname-asc (for ascending order) and pathname-desc (for descending), instead of just one pathname sort-method and a separate parameter for sorting direction.