0

I have noticed that, using vertico, some files are not displayed in the minibuffer by default when executing find-file, and I'm not sure to understand why.

Say that I have three files in a given directory:

.
├── landmarks2.tps
├── landmarks.tps
└── script.R
  1. I launch Emacs in this folder with emacs -Q.
  2. I load vertico.
  3. I do M-x vertico-mode RET.
  4. I do C-x C-f and type nothing in the minibuffer. vertico proposes only one candidate in the minibuffer: script.R, and says that it displays all files corresponding to the pattern it searches (*/1). But since I gave no pattern at all, why is script.R a match, whereas landmarks.tps and landmarks2.tps are not?

I tried to customize several variables (either vertico-sort-function, or other variables related to completion styles), but I found nothing to fix this behaviour.

Drew
  • 75,699
  • 9
  • 109
  • 225
Philopolis
  • 1,094
  • 8
  • 14
  • 1
    From using `emacs -q` it looks to me that this is actually the underlying Emacs `read-file-name-default`/`read-file-internal` behavior. When first typing an `l` for landmarks, then vertico does list them, Emacs seems to behave similarly when not using any completion framework; when completing without completion framework, while completing without input, Emacs always automatically picks `script.R`, while it should show the 3 possibilities. I am not sure if it is a bug, because e.g. Ivy behaves correctly. But I guess you could certainly report it as a bug (using `M-x` `report-emacs-bug`). – dalanicolai Jan 20 '23 at 11:40

1 Answers1

1

Self-answer, just in case it would be useful to someone else:

Actually, this is not a bug and this is not related to vertico, as @dalanicolai said in a comment. TPS files are ignored by Emacs in completion, just like some other file extensions.

Solution: customize the variable completion-ignored-extensions, which specifies those file extensions that must be ignored.

Philopolis
  • 1,094
  • 8
  • 14