Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory Sorting Order? #1546

Open
nmccamish opened this issue Sep 27, 2024 · 8 comments
Open

Directory Sorting Order? #1546

nmccamish opened this issue Sep 27, 2024 · 8 comments

Comments

@nmccamish
Copy link
Contributor

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 #'<.

@vindarel
Copy link
Collaborator

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? 🤔

what are other applications doing? (file manager or web app listing data, etc)

@nmccamish
Copy link
Contributor Author

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?

@vindarel
Copy link
Collaborator

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.

@nmccamish
Copy link
Contributor Author

So would it be good to create a separate sorting-direction, or merge that into sorting-method like Dirvish does?

@cxxxr
Copy link
Member

cxxxr commented Oct 1, 2024

@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?

(define-command test-context-menu () ()

@vindarel
Copy link
Collaborator

vindarel commented Oct 1, 2024

oh indeed it is useful +1 I forgot about it, it was for the mouse in my mind.

@vindarel
Copy link
Collaborator

vindarel commented Oct 1, 2024

So would it be good to create a separate sorting-direction, or merge that into sorting-method like Dirvish does?

not 100% sure what you mean, but giving an option to the user to choose the default sorting direction is always nice.

@nmccamish
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants