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: running EDE from a file that is not under a project root dir Date: Wed, 5 Aug 2015 02:18:32 +0300 Message-ID: <55C14848.8030904@yandex.ru> References: <861tfiexaz.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 1438730326 21272 80.91.229.3 (4 Aug 2015 23:18:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Aug 2015 23:18:46 +0000 (UTC) To: Stephen Leake , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 05 01:18:46 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 1ZMlTo-0000Ht-AI for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 01:18:44 +0200 Original-Received: from localhost ([::1]:38458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMlTn-0000ff-Ec for ged-emacs-devel@m.gmane.org; Tue, 04 Aug 2015 19:18:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMlTj-0000fG-FC for emacs-devel@gnu.org; Tue, 04 Aug 2015 19:18:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMlTf-00066D-Eq for emacs-devel@gnu.org; Tue, 04 Aug 2015 19:18:39 -0400 Original-Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:34303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMlTf-000667-6S for emacs-devel@gnu.org; Tue, 04 Aug 2015 19:18:35 -0400 Original-Received: by labow3 with SMTP id ow3so17566843lab.1 for ; Tue, 04 Aug 2015 16:18:34 -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=5vGjfHex3mFb83qAN3VXkvPriRg4vadwL9rrY2xcf7E=; b=r5lyf8fC/T7QkSEkXH/REB6gYt/uR2WxcLwVezYtFeg/205lxK2a4Y9y6O/52o2CuZ 6Xew6oYAnirQIrAdvkvUI0PXvADVnM8K2I/j+XenhGlSgu4HVDmwHQ5OVDf9D+ntNKJm 1x0lcV5BVvyFVRLYVbGV/f3n7oTBXfIwvgbVwagNlgwfMgPlQeYg2neZK8wD+JDAbrTW mvk/sIQQj2/EoqrF4T6TEfPC0HfFpUJMvb6zT+iscYEhbp9Mq6qZ+QLL9K6lfwfDhlsF x/j5k8XCO4rUVZ42GqFWF/l/s69DivXXXU8yjC91RKyY/0/ng7lg2Azzy4lcsS2EKzgf ZRQw== X-Received: by 10.112.61.132 with SMTP id p4mr6781062lbr.48.1438730314375; Tue, 04 Aug 2015 16:18:34 -0700 (PDT) Original-Received: from [192.168.1.190] ([178.252.127.222]) by smtp.googlemail.com with ESMTPSA id aw4sm159035lbc.17.2015.08.04.16.18.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 16:18:33 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 In-Reply-To: <861tfiexaz.fsf@stephe-leake.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22d 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:188417 Archived-At: 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. A hard dependency on EDE could even break the current usage of semantic-symref-find-references-by-name in xref-find-references. On the other hand, if we introduce project-source-file-patterns, xref-find-references could use it in the semantic-symref-filepattern-alist binding. And ede-source-file-patterns could be used by semantic-symref-symbol and semantic-symref-regexp. That issue aside, xref-find-references currently doesn't use project-ignores, nor does it use grep-find-ignored-directories and grep-find-ignored-files. Thought it still works reasonably quickly as long as the "uninteresting" files don't match the file name pattern we search for. > - 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.