[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: project--completing-read-strict breaks ada-mode project completion t
From: |
Dmitry Gutov |
Subject: |
Re: project--completing-read-strict breaks ada-mode project completion table |
Date: |
Thu, 17 Jan 2019 05:21:39 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Thunderbird/65.0 |
Hi Stephen,
On 16.01.2019 22:02, Stephen Leake wrote:
Commit 8f9d93f3054 (Dmitry Gutov 2018-12-29 415) breaks my ada-mode
completion table.
I'm sorry to hear that, but:
That commit modifies the completion table by first calling the actual
completion table to get all the file names, then removing any common
prefix directory, then calling completing read with that file list.
Yup. It solved a valid user complaint, with a solution proposed by Stefan.
This violates assumptions made within the ada-mode completion table, and
breaks the expected completion style - it requires typing the remaining
directory names first; the ada-mode completion table allows completing
on the base name only.
TBH, I kind of struggling to understand how the previous version worked
for you. But I guess when a completion table comes with a strongly
coupled completion style, it's kind of possible.
I can understand the motivation behind removing common prefixes, but the
proper way to do that is to implement a completion style and/or table
that does that, and make that style/table the default for projects.
How exactly would you propose to do that?
I don't see a way. Styles are an entirely different thing (they don't
modify how completion strings are presented), and as for a table... for
one thing, if a table removes a common parent directory from the
strings, how would it pass that information to the command that's going
to use it? To expand the file name later on.
The ada-mode completion style and table eliminates all directories from
the visible completion string, except the minimum needed to make the
string unique. I think this is a better solution to the problem;
project.el should allow the user to choose their prefered solution, by
choosing a completion style and table.
The user is not choosing a table. The project backend does, and in your
case it presents an entirely different look for file names from the
other backends, with no way for the user to change it.
I think that's bad. Namely, that e.g. M-x project-find-file can look
drastically different for the same user when using different project
backends.
Far be it from me to criticize the exact "uniquified" look for the
entries, but I don't think it's a good place to produce them. If it's
not possible to implement them via a completion style or something like
that, that would apply to all project backends and their completion
tables if the user so chooses, maybe it should just be a different
command. E.g. named project-uniquify-find-file which would modify the
completion table returned by the project (or, more trivially, the list
of files). Whereas the completion tables should contain more or less the
same kind of entries.
IOW, to me this looks like an argument *against* having
project-file-completion-table be a generic. The project backend should
produce *data*, not formatting, in the same uniform format, for all
backends. The more differences there are, the harder it's going to be to
consume.
- Re: Making project-files the "canonical" generic, (continued)
- project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/16
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/16
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/18
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/19
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/20
- Re: project--completing-read-strict breaks ada-mode project completion table,
Dmitry Gutov <=
- Re: project--completing-read-strict breaks ada-mode project completion table, Stefan Monnier, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, John Yates, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Stefan Monnier, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/18
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/21
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/21
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/21
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/21
- Re: Making project-files the "canonical" generic, Dmitry Gutov, 2019/01/16