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

[feature request] Honor completion-ignored-extensions #1092

Closed
SkySkimmer opened this Issue Jul 3, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@SkySkimmer

SkySkimmer commented Jul 3, 2017

counsel-find-file has counsel-find-file-ignore-regexp but emacs has a built in completion-ignored-extensions

Original value was 
(".o" "~" ".bin" ".lbin" ".so" ".a" ".ln" ".blg" ".bbl" ".elc" ".lof" ".glo" ".idx" ".lot" ".svn/" ".hg/" ".git/" ".bzr/" "CVS/" "_darcs/" "_MTN/" ".fmt" ".tfm" ".class" ".fas" ".lib" ".mem" ".x86f" ".sparcf" ".dfsl" ".pfsl" ".d64fsl" ".p64fsl" ".lx64fsl" ".lx32fsl" ".dx64fsl" ".dx32fsl" ".fx64fsl" ".fx32fsl" ".sx64fsl" ".sx32fsl" ".wx64fsl" ".wx32fsl" ".fasl" ".ufsl" ".fsl" ".dxl" ".lo" ".la" ".gmo" ".mo" ".toc" ".aux" ".cp" ".fn" ".ky" ".pg" ".tp" ".vr" ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs" ".pyc" ".pyo")


Documentation:
Completion ignores file names ending in any string in this list.
It does not ignore them if all possible completions end in one of
these strings or when displaying a list of completions.
It ignores directory names if they match any string in this list which
ends in a slash.

Language packages will add the appropriate object file extensions to this, eg https://github.com/ocaml/tuareg/blob/master/tuareg.el#L2412-L2416

It would be nice if counsel respected this ignore list, probably with a toggle akin to ido-ignore-extensions.

@abo-abo abo-abo closed this in bf0e438 Jul 3, 2017

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Jul 3, 2017

Thanks, let me know if this is good enough.

It would be nice if counsel respected this ignore list, probably with a toggle akin to ido-ignore-extensions.

I think juggling two variables at once isn't an optimal solution. I can add an option for counsel-find-file-ignore-regexp to be a custom function if necessary, but I think the regexp-opt should be enough.

@SkySkimmer

This comment has been minimized.

SkySkimmer commented Jul 4, 2017

That won't work with new packages modifying the completion-ignored-extensions will it?
Also if I have eg /tmp/foo.bbl.foo it should not be ignored.
Also I prefer writing in my init over using the customize system.

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Jul 4, 2017

That won't work with new packages modifying the completion-ignored-extensions will it?
Also if I have eg /tmp/foo.bbl.foo it should not be ignored.
Also I prefer writing in my init over using the customize system.

You'll have to add this to your config, preferably after completion-ignored-extensions is finalized:

(setq counsel-find-file-ignore-regexp (regexp-opt completion-ignored-extensions))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment