Enable completion of directories when selecting a compose file
docker-compose-read-compose-file completes *.yaml and *.yml filenames but not directories, which must be manually typed if the desired compose file is not in the initial input.I use a custom function to get around this, which may warrant consideration as a feature in docker.el.
(defun docker-compose-read-compose-file (prompt &optional initial-input _history)
"Wrapper around `read-file-name' forwarding PROMPT and INITIAL-INPUT."
(read-file-name prompt nil nil t initial-input
(lambda (file-name)
(or (file-directory-p file-name)
(string-match ".*\\.yml\\|.*\\.yaml" file-name)))))
Hum. Are there drawbacks from replacing the current function with your implementation?
The main one I can think of is that there will be as many completion candidates to choose from as there are directories, rather than just one, or a few, yaml files; one of which is often the sought file.
I am also using vertico for the actual completion selection, and if the emacs window is small and the number of completions large then the sharing of minibuffer space between vertico candidates and the transient stuff above causes the prompt to disappear. But that sounds like a separate issue. Shown below.
Not too many candidates:
Too many candidates:
Sorry was very busy. Will try to work on this.