emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make project--find-in-file generic, add interactive filename to proj


From: Stefan Monnier
Subject: Re: make project--find-in-file generic, add interactive filename to project-find-file
Date: Sun, 31 Jan 2016 09:23:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>>> (defun completing-read-strict (prompt
>>> collection &optional predicate
>>> hist default inherit-input-method)
>> I think `default' should come earlier, maybe even before `&optional'.
> We can't always provide a non-nil default value (such as in the case of
> project-find-file), and &optional is a good indicator that the parameters
> after it are null-able. I'd put DEFAULT after PREDICATE, or right before it.

The idea of putting it before &optional is to force people to try and
think if there'd be a good default.  Lots of packages use
completing-read without passing a default simply because the author
doesn't know about that feature.

>> You can probably get a cleaner behavior if you change
>> minibuffer-complete-and-exit so that it does most of the new work (but
>> only when called from completing-read-strict).
> That could improve completing-read-default's behavior, but wouldn't help
> when any other completing-read-function is used. Which was my main concern.

Other functions might still use minibuffer-complete-and-exit.
And for other functions we should just make sure that the behavior is
still correct (even if not perfect) and that they have enough info to
make the behavior "perfect".

> But yes, we can do that (probably on master).

All this discussion is obviously on master, yes.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]