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: [SPAM UNSURE] Re: Unified project interface Date: Sun, 07 Jun 2015 20:35:59 -0500 Message-ID: <854mmjc77k.fsf@stephe-leake.org> References: <557039DB.4060607@yandex.ru> <85d21bbkqf.fsf@stephe-leake.org> <5570E86B.8070200@yandex.ru> <85iob2a2mm.fsf@stephe-leake.org> <85eglq9ujn.fsf@stephe-leake.org> <5574D244.1050203@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433727390 3949 80.91.229.3 (8 Jun 2015 01:36:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Jun 2015 01:36:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 08 03:36:17 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 1Z1lz6-0005em-Ui for ged-emacs-devel@m.gmane.org; Mon, 08 Jun 2015 03:36:17 +0200 Original-Received: from localhost ([::1]:55587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1lz6-0004vy-9K for ged-emacs-devel@m.gmane.org; Sun, 07 Jun 2015 21:36:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1lz2-0004vt-Oh for emacs-devel@gnu.org; Sun, 07 Jun 2015 21:36:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1lyy-0008NL-R9 for emacs-devel@gnu.org; Sun, 07 Jun 2015 21:36:12 -0400 Original-Received: from gproxy6-pub.mail.unifiedlayer.com ([67.222.39.168]:44481) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Z1lyy-0008Mv-Jr for emacs-devel@gnu.org; Sun, 07 Jun 2015 21:36:08 -0400 Original-Received: (qmail 15077 invoked by uid 0); 8 Jun 2015 01:36:06 -0000 Original-Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy6.mail.unifiedlayer.com with SMTP; 8 Jun 2015 01:36:06 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw2 with id ddUT1q00L2UdiVW01dUWVA; Sun, 07 Jun 2015 19:28:30 -0600 X-Authority-Analysis: v=2.1 cv=efyuId0H c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=2wGvvwaKUHMA:10 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=rMLPtTzFGpYA:10 a=XAFQembCKUMA:10 a=vaJtXVxTAAAA:8 a=4PNjG_SC7juw__C_kYEA:9 Original-Received: from [12.52.181.2] (port=49463 helo=TAKVER) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1Z1lys-0007cz-V6 for emacs-devel@gnu.org; Sun, 07 Jun 2015 19:36:03 -0600 In-Reply-To: <5574D244.1050203@yandex.ru> (Dmitry Gutov's message of "Mon, 8 Jun 2015 02:22:44 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 12.52.181.2 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.39.168 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:187085 Archived-At: Dmitry Gutov writes: > On 06/05/2015 04:03 PM, Stephen Leake wrote: > >> 1) You are editing a LaTeX file containing documentation for a Python >> module implemented in Python and C++. You want to find all mentions/references >> related to feature "foo", in LaTeX, Python, and C++ source files. So you >> invoke project-find-regexp, which searches for *.tex, *.py, *.hhp, *.cpp >> in project-source-directories. > > project-find-regexp? Do you imagine we'll need a separate command like > that? Yes, that's the point. That's how you distinuish between multi-language and single-language searches. >> There are a couple of implementation options here: >> >> - implement project-source-directories as the union of >> xref-source-directories for all backends listed in a project file > > This sounds like you envision a one-backend-per-language kind of > situation. Yes, for xref. > I think that there should be just one backend there, set in > a minor mode, that knows enough about this mixed project's structure, > to know where to search. I don't see how that would be better; that minor mode would end up doing what I'm suggesting the "project" code do. >> - implement xref-source-directories as a subset of >> project-source-directories for each backend. >> >> I'm inclined to the latter; it's closer to what ada-mode does now. > > Could you explain what that means exactly? How is it implemented? I don't have a working example of this precise structure now. What I'm imagining is a "project file" that lists source directories without regard to language. To be concrete, imagine a project with the following structure: /root src *.c files doc *.tex files build foo.prj -- the project file *.make files foo.prj contains (among other things): src_dir=../src src_dir=../doc src_dir=. So project-source-directories is the list ("root/src" "root/doc" "root/build"). If we are in a .c buffer, and we request xref-source-directories, the code looks thru project-source-directories for directories that contain c files, and returns only ("root/src"). This could be an expensive check, so we'd want to cache the results. Alternately, foo.prj could have: language=c language=tex language=make src_dir(c)=../src src_dir(tex)=../doc src_dir(make)=. (You could get fancier and use "latex" as a language name, and have another statement that maps that to ".tex". Which is needed for C and Ada anyway, since they use two file extensions; .h/.c, .ads/.adb). That imposes the requirement on the user that they know what files are where. Note that the directories do not have to be language exclusive; they are here just for clarity. -- -- Stephe