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: project.el semantics Date: Mon, 23 Nov 2015 01:43:30 -0600 Message-ID: <86a8q540v1.fsf@stephe-leake.org> References: <86pp1j4ejm.fsf@stephe-leake.org> <86h9ktah9x.fsf@stephe-leake.org> <56429025.3070008@yandex.ru> <86r3jw4yrf.fsf@stephe-leake.org> <564340DC.5020008@yandex.ru> <86wptob2v6.fsf@stephe-leake.org> <5643CEAA.6000103@yandex.ru> <86si4bemyw.fsf@stephe-leake.org> <564478CA.20108@yandex.ru> <86y4e3c90y.fsf@stephe-leake.org> <56450CDB.9050604@yandex.ru> <564D3223.1050705@yandex.ru> <86h9kf655z.fsf@stephe-leake.org> <56515443.70408@yandex.ru> <5651597B.5090303@yandex.ru> <5651F7CC.1030503@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448264651 27820 80.91.229.3 (23 Nov 2015 07:44:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Nov 2015 07:44:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 23 08:43:59 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 1a0ln3-0001Zc-Lp for ged-emacs-devel@m.gmane.org; Mon, 23 Nov 2015 08:43:57 +0100 Original-Received: from localhost ([::1]:59031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0ln3-0003dk-Qt for ged-emacs-devel@m.gmane.org; Mon, 23 Nov 2015 02:43:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0lmz-0003dX-Bv for emacs-devel@gnu.org; Mon, 23 Nov 2015 02:43:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0lmw-0002Bw-5W for emacs-devel@gnu.org; Mon, 23 Nov 2015 02:43:53 -0500 Original-Received: from gproxy4-pub.mail.unifiedlayer.com ([69.89.23.142]:42286) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1a0lmv-00029y-Tn for emacs-devel@gnu.org; Mon, 23 Nov 2015 02:43:50 -0500 Original-Received: (qmail 4737 invoked by uid 0); 23 Nov 2015 07:43:44 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy4.mail.unifiedlayer.com with SMTP; 23 Nov 2015 07:43:44 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw4 with id kvje1r00U2UdiVW01vjhPK; Mon, 23 Nov 2015 00:43:44 -0700 X-Authority-Analysis: v=2.1 cv=IekUBwaa c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=qtqOOiqGOCEA:10 a=pGLkceISAAAA:8 a=mpTySLUcQ5le8DJzV8oA:9 Original-Received: from [76.218.37.33] (port=55413 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1a0lmk-0003Mp-FD; Mon, 23 Nov 2015 00:43:38 -0700 In-Reply-To: (John Wiegley's message of "Sun, 22 Nov 2015 13:27:20 -0800") 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.23.142 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:195098 Archived-At: John Wiegley writes: > For convenience, the DEFINITION can often be determined from context, such as > by querying Git or VC. > > For convenience, the SELECTION can often be reduced to small set of options, > such as "all file paths" or "files and directory roots". > > For convenience, the QUERY can be reduced to a set of possibilities, like > "source code", or "ignored files", or "library files", etc. > > While the surface API might encode these conveniences as short-hands for what > are likely to be common uses, the underlying API should allow the general form > of a rich query. The project is, in a sense, a database of entities, and it's > hard to pre-determine all possible useful queries of such data. > > How these conveniences are implemented is completely open; `cl-defgeneric' > methods that encode the QUERY&SELECTION against an auto-determined DEFINITION > is just fine, and is how project.el is written today. > > What is presently missing is the lower-level query API, and the freedom to > specify the DEFINITION, QUERY and SELECTION in more flexible ways. > > *That said*, I'd be willing to postone such an API until a future version, > since, from the user's perpective, it could be seen as an implementation > detail behind the convenience APIs. > > So maybe this has come full circle, but if so, I hope it adds some clarity. Yes, I like this description. We are left with what set of convenience functions to implement in Emacs 25 project.el. We don't have a good process for determining that. I think it would be helpful to go back to one of your original suggestions, and collect a list of requirements for what we want project.el to be able to do. To that end, here is what the project features of ada-mode provide; they are all candidates for what project.el could provide: - Set `compilation-search-path' so `next-error' works correctly with compilation results. This is a non-recursive list of project directories, since the compiler default settings do not include the directory in the error messages. Some language compilers include the full directory in the error messages, so `compilation-search-path' is not needed at all; some include a relative path, so only the roots are needed. - Set `ff-search-directories' and other `ff-' variables so `ff-find-the-other-file' works correctly, both for body/header files and for "with" (similar to C "include"). For Ada, C, C++, `ff-search-directories' is a non-recursive list of project directories. For Java, it may be only the project roots (the core Emacs java-mode does not make this work for Java 'import'). - Set the xref backend so M-. finds multiple language definitions, and M-? finds multiple language references. (ada-mode does not yet use the actual xref.el, but it does the equivalent; the cross reference tool supports Ada, C, C++). - Implement find-file-in-project to find any file included by the build tool project definition files, with completion on the file name (not the directories). The implementation uses `locate-file' with a non-recursive list of project directories, as returned by the build tool. For other project backends, this could be replaced by a call to an external 'find' with directory roots and ignores, or to 'global', which has it's own search path. - Provide a menu of known projects, from which the user selects the currently active one. - Invoke the build tool to build the main executable in the project. This assumes there is only one main. I normally don't use this feature; I use Makefiles directly since they are much more powerful. But others, particularly newbies, find this feature useful. -- -- Stephe