Skip to content

Add a dired-narrow command that uses completion-styles #169

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

noctuid
Copy link

@noctuid noctuid commented May 9, 2020

Use user's completion filtering setup for narrowing.

@Fuco1
Copy link
Owner

Fuco1 commented Mar 21, 2024

I'm sorry to not going through this pull request sooner (much sooner!). I tried the code and I can't make it work, it's giving me some nil errors.

The way this package works is that it calls the filter function on each line, expecting it to give true or false for that particular file. How does this interact with a completion framework? That one takes a list of all options and returns some possible options based on the filter. So I think it's not a good fit here.

@Fuco1 Fuco1 added the waiting label Mar 21, 2024
@noctuid noctuid force-pushed the dired-narrow-completion-styles branch from e97b1a0 to b63639f Compare March 21, 2024 12:15
@noctuid noctuid force-pushed the dired-narrow-completion-styles branch from b63639f to 6754ce2 Compare March 21, 2024 12:26
@noctuid
Copy link
Author

noctuid commented Mar 21, 2024

How does this interact with a completion framework?

It doesn't interact with a completion framework like helm/ivy/vertico if that's what you mean; it interacts with the builtin completion-styles and related settings. Emacs has flex/initials/etc. matching as builtin options, so you could set completion-styles to include flex and "drd" would match "dired". I'm using orderless which allows for much more customization. If you haven't seen it, it supports any combination of literal, flex, regexp, initials, etc. and allows incrementally building a query with multiple e.g. space-separated patterns, changing pattern rules based on the input, negative patterns like !.org, etc. So this new function lets you use something like orderless patterns to narrow, not something like helm.

That one takes a list of all options and returns some possible options based on the filter.

Yes, how the completion functions work doesn't match dired-narrow filtering one at at time, but I don't think that really matters. You can just pass one item in the table, and the performance is the same as the already existing commands from what I've seen.

it's giving me some nil errors.

Updated so it should work with the default available completion-styles. Try now.

@Fuco1
Copy link
Owner

Fuco1 commented Mar 21, 2024

Thank you so much for the comment and explanation. This must be some new(ish) feature because I have never heard of it 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants