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: running EDE from a file that is not under a project root dir Date: Wed, 05 Aug 2015 02:48:00 -0500 Message-ID: <86wpxab2hb.fsf@stephe-leake.org> References: <861tfiexaz.fsf@stephe-leake.org> <55C14848.8030904@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438760917 14599 80.91.229.3 (5 Aug 2015 07:48:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Aug 2015 07:48:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 05 09:48:27 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 1ZMtR4-00034f-B8 for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 09:48:26 +0200 Original-Received: from localhost ([::1]:39493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMtR3-0006l7-Rc for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 03:48:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMtQy-0006kQ-FJ for emacs-devel@gnu.org; Wed, 05 Aug 2015 03:48:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMtQt-0003Ia-BJ for emacs-devel@gnu.org; Wed, 05 Aug 2015 03:48:20 -0400 Original-Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:45360) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZMtQt-0003IO-4k for emacs-devel@gnu.org; Wed, 05 Aug 2015 03:48:15 -0400 Original-Received: (qmail 26795 invoked by uid 0); 5 Aug 2015 07:48:11 -0000 Original-Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy5.mail.unifiedlayer.com with SMTP; 5 Aug 2015 07:48:11 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by CMOut01 with id 0vo51r00g2UdiVW01vo8l1; Wed, 05 Aug 2015 01:48:10 -0600 X-Authority-Analysis: v=2.1 cv=NJxGpSKg 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=y7kgw_RnJtkA:10 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=uRRa74qj2VoA:10 a=vaJtXVxTAAAA:8 a=h1ROpmvOlw_wQKBYb78A:9 Original-Received: from [76.218.37.33] (port=56168 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1ZMtQk-0006Xy-Gk for emacs-devel@gnu.org; Wed, 05 Aug 2015 01:48:06 -0600 In-Reply-To: <55C14848.8030904@yandex.ru> (Dmitry Gutov's message of "Wed, 5 Aug 2015 02:18:32 +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: 67.222.38.55 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:188431 Archived-At: Dmitry Gutov writes: > On 08/04/2015 09:13 PM, Stephen Leake wrote: > >> But then it uses semantic-symref-derive-find-filepatterns to get the >> file patterns to pass to grep. Since I'm starting from a text-mode >> buffer, that returns (*.letter *.article *.te?xt). Which is _not_ what I >> want; I want *.el. > > If we don't want to change too much code, I suppose > xref-collect-references could bind semantic-symref-filepattern-alist > to a list of one element: > > `((,major-mode "*")) > > Though that will search in all files. To refine it further, indeed we > could make the choice based on what the project tells us. > >> My question is this; what is the minimum change I should make to EDE to >> support these use cases? >> >> I think I need three things: >> >> - add a "file patterns" element to the EDE project (or target?) data >> structure, and have semantic-symref-derive-find-filepatterns check that >> before the alists. > > That's cool, but won't help xref-find-references if EDE isn't used. Right; I'm exploring using an EDE elisp project via the project.el API. I'm also implementing a separate elisp project that supports only the project.el API. > On the other hand, if we introduce project-source-file-patterns, > xref-find-references could use it in the > semantic-symref-filepattern-alist binding. Yes, I think that would be appropriate. > And ede-source-file-patterns That's not a currently defined function. Did you mean project-source-file-patterns? Or are you agreeing with me that EDE needs to add this? > could be used by semantic-symref-symbol and semantic-symref-regexp. > > That issue aside, xref-find-references currently doesn't use > project-ignores, Right; it should. > nor does it use grep-find-ignored-directories and > grep-find-ignored-files. It should not use these directly; only via project-ignores. >> - add an ede-global-project variable that I can set to my current >> project, to bypass the project root detection. >> >> I've proposed the same change to project.el; there, it can be used >> by one of the project-find functions. > > project.el doesn't need that variable. The variable can just as well > live in the package you're writing. I don't understand. Surely the concept "a project that is active in all buffers" is independent of the actual project type? I will want it for elisp, Ada, Java, ... If it's not in project.el, I'll have to add it to every new project type I write; that will be a name conflict, at the very least. -- -- Stephe