From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: make project--find-in-file generic, add interactive filename to project-find-file Date: Sun, 31 Jan 2016 17:02:54 +0300 Message-ID: <56AE140E.2010901@yandex.ru> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1454248988 3160 80.91.229.3 (31 Jan 2016 14:03:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Jan 2016 14:03:08 +0000 (UTC) Cc: Stephen Leake , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 31 15:03:07 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 1aPsao-0008DQ-VB for ged-emacs-devel@m.gmane.org; Sun, 31 Jan 2016 15:03:07 +0100 Original-Received: from localhost ([::1]:41784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPsao-0000Zr-5M for ged-emacs-devel@m.gmane.org; Sun, 31 Jan 2016 09:03:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPsal-0000Zl-1N for emacs-devel@gnu.org; Sun, 31 Jan 2016 09:03:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPsag-0001y8-1M for emacs-devel@gnu.org; Sun, 31 Jan 2016 09:03:02 -0500 Original-Received: from mail-lf0-x235.google.com ([2a00:1450:4010:c07::235]:35858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPsaf-0001xU-Px for emacs-devel@gnu.org; Sun, 31 Jan 2016 09:02:57 -0500 Original-Received: by mail-lf0-x235.google.com with SMTP id 78so32987819lfy.3 for ; Sun, 31 Jan 2016 06:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=2IY157bxEcV41pJs8BIuY9kOeWVMh3V81rEumeyk3Hs=; b=RLog7dFCvB2+bL+ToYHuyicB7qTMtk8Vn2i6V6sTQ9cpMD99izbmhnDB10bRqDzlss OE2h3xiCWzgSaONK/9xJzBbinhitxGPiK1r3j2D213nP42Q9dtHQVDP/A/aXzkWDRBhD Yx2pestbLU37kAuxTSXyL92XqGwxOsw+dRBETBh1boMdu8AOdAXI+K6g2OdOfrmnqfaY DAPzhHQGGOg1GxcjbTS10yuLC9M2ONOEL5u/vdEoAcVWG/EefBAqSypRQ9kytCbkQh4j R/GM3tnwu5OulIWX3Bsv6tYK4ur0t5Fvxew0lNiyd64NI4E04exnZHllqo5YVaOfHBIC 39bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=2IY157bxEcV41pJs8BIuY9kOeWVMh3V81rEumeyk3Hs=; b=H5RD1kXPpHhfaVa5wp6bVAucKpJMPjw2XTf28YG6sQgvBfamIs24TgXAPLSL+i2W5w rSYHjezfHIXS+BjfDJG9jmKUbNNKjVc+d5HDbFc+JKbaIPPAfNY2Tmfa6YBBq/CeJwI1 oLIUYMqhWxJRDvBy5EMaWpQgl6a4KpC2QqHcr56WRW1Zu/KsCQ3iE0nQ+7Orv1kIFF/v UEJm/BAAjg1pZXALmYDZmkxRYM9B8W69lz8Parhzfj9ZrdFukvvDYBcqnarQn7NrKrR8 +mlsmuyYSJkh4Sj0D9eeyYrIDevTAFlveyk/CEmM8zlxOw5X1pO1K8Y0yLt39+k/7Pfz 0EEw== X-Gm-Message-State: AG10YORMYZ53xbAXmsYweM6mUaWvANxdw31EFVWpli6L27iIH2hytCtkmwv4a00rAI8e4A== X-Received: by 10.25.15.24 with SMTP id e24mr4122490lfi.159.1454248976867; Sun, 31 Jan 2016 06:02:56 -0800 (PST) Original-Received: from [192.168.1.190] ([178.252.127.222]) by smtp.googlemail.com with ESMTPSA id i1sm3310917lbs.38.2016.01.31.06.02.55 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 31 Jan 2016 06:02:55 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Thunderbird/44.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::235 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:199076 Archived-At: On 01/31/2016 09:18 AM, Stefan Monnier wrote: >> (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. > 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. But yes, we can do that (probably on master). > We could check `default' directly when we receive it, but I'd rather not > do that: > - it would ruin efforts to make completion tables more lazy. > - it's rarely useful, but in 99% of the cases, we already know that > the default is a valid value. > But yes, it should probably be considered "bad karma" for the caller to > provide an invalid `default'. Right, I already removed the advance checks on DEFAULT from project--completing-read-strict. We could document the "bad karma" consideration, and then the main missing thing would be to show the completions for DEFAULT, or the "no matches" message, right after the user presses RET.