From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: make project--find-in-file generic, add interactive filename to project-find-file Date: Sun, 31 Jan 2016 09:23:15 -0500 Message-ID: References: <86wpqu8qf9.fsf@stephe-leake.org> <56A9DDA8.9080504@yandex.ru> <86si1i813n.fsf@stephe-leake.org> <56A9EF4B.7020406@yandex.ru> <56AA6CCA.10103@yandex.ru> <56AA8698.9050805@yandex.ru> <56AACA20.1050000@yandex.ru> <56AAE899.3010509@yandex.ru> <56ABDF5F.30404@yandex.ru> <56AE140E.2010901@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454250226 21389 80.91.229.3 (31 Jan 2016 14:23:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Jan 2016 14:23:46 +0000 (UTC) Cc: Stephen Leake , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 31 15:23:37 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aPsuf-0008Tn-56 for ged-emacs-devel@m.gmane.org; Sun, 31 Jan 2016 15:23:37 +0100 Original-Received: from localhost ([::1]:41854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPsue-0006LW-Hc for ged-emacs-devel@m.gmane.org; Sun, 31 Jan 2016 09:23:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPsuS-0006Il-Fw for emacs-devel@gnu.org; Sun, 31 Jan 2016 09:23:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPsuN-0007SD-Ju for emacs-devel@gnu.org; Sun, 31 Jan 2016 09:23:24 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:5036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPsuN-0007OM-78 for emacs-devel@gnu.org; Sun, 31 Jan 2016 09:23:19 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A+FgA731xV/3+SCkxcgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtBYwwkmeGaY0/gUUjgWZVgVsggngBAQE X-IPAS-Result: A0A+FgA731xV/3+SCkxcgxCEAoVVwwsEAgKBPD0QAQEBAQEBAYEKQQWDXQEBAwFWIwULCw4mEhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtBYwwkmeGaY0/gUUjgWZVgVsggngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="192034224" Original-Received: from 76-10-146-127.dsl.teksavvy.com (HELO ceviche.home) ([76.10.146.127]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Jan 2016 09:23:16 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id EA82D661AA; Sun, 31 Jan 2016 09:23:15 -0500 (EST) In-Reply-To: <56AE140E.2010901@yandex.ru> (Dmitry Gutov's message of "Sun, 31 Jan 2016 17:02:54 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199079 Archived-At: >>> (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