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: Unified project interface Date: Tue, 28 Jul 2015 19:25:49 +0300 Message-ID: <55B7AD0D.6070403@yandex.ru> References: <557039DB.4060607@yandex.ru> <85d21bbkqf.fsf@stephe-leake.org> <5570E86B.8070200@yandex.ru> <85iob2a2mm.fsf@stephe-leake.org> <55B2CDA4.8020207@yandex.ru> <868ua5caz6.fsf@stephe-leake.org> <55B441DD.9060806@yandex.ru> <86zj2jb1tx.fsf@stephe-leake.org> <55B517AC.5020401@yandex.ru> <86oaiybvbf.fsf@stephe-leake.org> <55B62B53.5060003@yandex.ru> <861tftaxgx.fsf@stephe-leake.org> <86si88a6ex.fsf@stephe-leake.org> <55B792D3.8070000@yandex.ru> <86d1zc9tgt.fsf@stephe-leake.org> 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 1438100777 30452 80.91.229.3 (28 Jul 2015 16:26:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jul 2015 16:26:17 +0000 (UTC) To: Stephen Leake , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 28 18:26:12 2015 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 1ZK7hj-0003Af-Py for ged-emacs-devel@m.gmane.org; Tue, 28 Jul 2015 18:26:11 +0200 Original-Received: from localhost ([::1]:59883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK7hi-00042h-Tu for ged-emacs-devel@m.gmane.org; Tue, 28 Jul 2015 12:26:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK7hV-00042a-H1 for emacs-devel@gnu.org; Tue, 28 Jul 2015 12:25:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZK7hR-0007h6-GS for emacs-devel@gnu.org; Tue, 28 Jul 2015 12:25:57 -0400 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:34039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK7hR-0007gq-8X for emacs-devel@gnu.org; Tue, 28 Jul 2015 12:25:53 -0400 Original-Received: by wibud3 with SMTP id ud3so188079244wib.1 for ; Tue, 28 Jul 2015 09:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=nhnDi/Vt8oWa5lMOXoJfZypqDZMGKo3CqztIFd21RY0=; b=wiVvk30qbQj0cW/jUz9E3FsW3FPlu8EorhE/kcPVPXq6qWlmmCXB6qtjGrDHnBnr9f /n+ND+IIdiv/ntwuvvEPTCLJHhdBIyoKJzPi+8b12B+H5m4r1Y2HdmaTXsyd/ZOyX3/D kjft78U+ABRwnLBLWGKs/a1MvnZ4YVgebquxEqjNf7VAkQ2opkYdRxfZvRudN7Rrqon+ Zo3Ui+i8NziySuQvm7UHtf7GEJ66UtPC4puqYwJhHf9o35YXY7bV2z1TpLs0OWgyxYiN gcjH7PHhC3y5VYEIOLkkLFibNNd6xLMswEYsedAzWiJJvUOLN8RWyQIoXgceUxWUQ5Fd qdOg== X-Received: by 10.194.81.137 with SMTP id a9mr8395330wjy.155.1438100752651; Tue, 28 Jul 2015 09:25:52 -0700 (PDT) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id fs8sm34029962wjb.7.2015.07.28.09.25.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 09:25:51 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <86d1zc9tgt.fsf@stephe-leake.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22b 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:188138 Archived-At: On 07/28/2015 06:45 PM, Stephen Leake wrote: > 'project-roots'; return a list of related project roots. > > That's what renaming 'project-directories' to 'project-roots' gives us. > Although some will object to the small name difference between > 'project-root' and 'project-roots'. If project-roots does not include project-root (so we limit the notion of "current project" to just one directory tree), it would be better to rename that to project-related-projects, and return project instances in there. This way, the consumer can inquire about each related project's dependencies, as well as call project-ignores on each of them. But that becomes more complex, because then you'd expect the consumer to call project-related-projects on each related project ask well, and traverse the whole tree, handle loops, etc. I think it'll be better to incorporate all related projects into the notion of the current project, return all project roots on equal rights, give project-ignores an argument (one of the roots), and introduce project-relativize which, like described previously, will return (ROOT . RELATIVE-PATH). In this scheme, project-root is not needed, because we want to treat all roots somewhat equally, and also because project-root shouldn't use default-directory, or buffer-file-name. > Are you agreeing that the default implementation should not include > project-root-directories? Yes. > The point is that if you only customize by setting > project-search-path-function, you can't exclude project-directories. > > And I thought we agreed that project-search-path is disjoint from > project-directories. Like I said, "allowed not to include". Not matter if emacs-lisp-mode sets project-search-path-function, or provides a specialized implementation of project-search-path, it doesn't know the current project roots, so it can't exclude them. > As with all such optimizations, it can only be justified by actual > measurement. It's an easy one, though. > It would be less confusing if the default definition of > project-search-path did _not_ call project--prune-directories, but > elisp-search-path _did_. Some caller up the stack will have to call project--prune-directories anyway, because we don't want to guarantee that search-path and project-roots don't mix (see above). However, we could provide a public function in project.el that will combine both. I having hard time coming up with the name, though: project-full-search-path doesn't sound too good. > Then project--prune-directories should be> renamed without the '--'. I've been waiting for a better name: there are several -prune-directories function in Emacs already, in different packages, all with different semantics. > The doc string for project-search-path says "source directories", not > "source root directories". That needs to be fixed. All right. To me, the two sound equivalent, and I meant it like that.