From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: make project--find-in-file generic, add interactive filename to project-find-file Date: Thu, 28 Jan 2016 04:11:56 -0600 Message-ID: <86si1i813n.fsf@stephe-leake.org> References: <86wpqu8qf9.fsf@stephe-leake.org> <56A9DDA8.9080504@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1453975978 23446 80.91.229.3 (28 Jan 2016 10:12:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jan 2016 10:12:58 +0000 (UTC) Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 28 11:12:48 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 1aOjZ4-0008Ap-Vs for ged-emacs-devel@m.gmane.org; Thu, 28 Jan 2016 11:12:35 +0100 Original-Received: from localhost ([::1]:55040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjZ4-00068e-8x for ged-emacs-devel@m.gmane.org; Thu, 28 Jan 2016 05:12:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjYq-00068K-N2 for emacs-devel@gnu.org; Thu, 28 Jan 2016 05:12:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOjYn-0000cl-9L for emacs-devel@gnu.org; Thu, 28 Jan 2016 05:12:20 -0500 Original-Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:34653) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aOjYn-0000cZ-2N for emacs-devel@gnu.org; Thu, 28 Jan 2016 05:12:17 -0500 Original-Received: (qmail 1043 invoked by uid 0); 28 Jan 2016 10:12:12 -0000 Original-Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy2.mail.unifiedlayer.com with SMTP; 28 Jan 2016 10:12:11 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw3 with id BVC51s00L2UdiVW01VC8ep; Thu, 28 Jan 2016 10:12:09 -0700 X-Authority-Analysis: v=2.1 cv=bej4Do/B c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=7aQ_Q-yQQ-AA:10 a=vaJtXVxTAAAA:8 a=8Lc0p94XIZ6dErLgNagA:9 Original-Received: from [76.218.37.33] (port=64121 helo=TAKVER3) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1aOjYd-0001Ra-J5; Thu, 28 Jan 2016 03:12:07 -0700 In-Reply-To: <56A9DDA8.9080504@yandex.ru> (Dmitry Gutov's message of "Thu, 28 Jan 2016 12:21:44 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 76.218.37.33 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 69.89.18.3 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:198937 Archived-At: Dmitry Gutov writes: > On 01/28/2016 04:04 AM, Stephen Leake wrote: >> Any objections to the attached patch? > > A couple: > > - IIRC, using INITIAL-INPUT argument is semi-deprecated. Using DEFAULT > is preferable, I was not aware of M-n (more below). > and then you don't need to make that value depend on > current-prefix-arg. Actually, I did not intend to make it depend on current-prefix-arg, as the doc string does not mention that; I forgot to fix that when I copied from my current code. On the other hand, it makes sense to give the user some control over whether the file at point is used. In any case, we can call `thing-at-point' in the completing-read call for either INITIAL-INPUT or DEFAULT. > We can always set the default input, and if the user wants to use it, > they will press M-n. I was not aware of that use of M-n; that is a good alternative to current-prefix-arg. However, the default still does not show anywhere; we should add it to the prompt. > And I see no good reason to thread it through the command's function > arguments. Why not do it like in the patch at the bottom? Because there are also times when calling `project-find-file' from lisp with a filename makes sense. But that code can call project--find-file-in, instead of project-find-file. > - More importantly, the new generic function should not do too much. > It should return a completion table, which can dispatch to ede, > ada-mode, or any other facility. I believe we've went over this a > couple of times already. So instead of computing `table' in project--find-file-in, it would call (project--file-completion-table dirs project). The default implementation of `project--file-completion-table' would be the code using `find-program'. I'll give that a try. -- -- Stephe