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: progmodes/project.el and search paths Date: Wed, 12 Aug 2015 08:49:00 -0500 Message-ID: <86tws4wrar.fsf@stephe-leake.org> References: <55BE209F.1000009@siege-engine.com> <55BE509B.2080307@yandex.ru> <55BEC1B5.6060204@gmail.com> <86twsgfiuc.fsf@stephe-leake.org> <87mvy2kjxa.fsf@esperi.org.uk> <86si7t11li.fsf@stephe-leake.org> <87lhdkzmdv.fsf@isaac.fritz.box> <86pp2wzcaa.fsf@stephe-leake.org> <877fp3z8i7.fsf@isaac.fritz.box> <86bnefyu0b.fsf@stephe-leake.org> <87k2t0yfz9.fsf@isaac.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1439387402 19137 80.91.229.3 (12 Aug 2015 13:50:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2015 13:50:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 12 15:49:53 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 1ZPWPd-0004bR-5u for ged-emacs-devel@m.gmane.org; Wed, 12 Aug 2015 15:49:49 +0200 Original-Received: from localhost ([::1]:38763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPWPc-0004OL-CD for ged-emacs-devel@m.gmane.org; Wed, 12 Aug 2015 09:49:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPWPJ-0004MW-31 for emacs-devel@gnu.org; Wed, 12 Aug 2015 09:49:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPWPE-0000el-Vw for emacs-devel@gnu.org; Wed, 12 Aug 2015 09:49:29 -0400 Original-Received: from gproxy4-pub.mail.unifiedlayer.com ([69.89.23.142]:60829) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZPWPE-0000eZ-O5 for emacs-devel@gnu.org; Wed, 12 Aug 2015 09:49:24 -0400 Original-Received: (qmail 3007 invoked by uid 0); 12 Aug 2015 13:49:22 -0000 Original-Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy4.mail.unifiedlayer.com with SMTP; 12 Aug 2015 13:49:22 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by CMOut01 with id 3ppJ1r00w2UdiVW01ppMns; Wed, 12 Aug 2015 07:49:21 -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=8L5dHgqbrxVl44eykhYA:9 Original-Received: from [76.218.37.33] (port=55507 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1ZPWP9-0000y7-0B for emacs-devel@gnu.org; Wed, 12 Aug 2015 07:49:19 -0600 In-Reply-To: <87k2t0yfz9.fsf@isaac.fritz.box> (David Engster's message of "Wed, 12 Aug 2015 12:10:34 +0200") 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:188754 Archived-At: David Engster writes: > Stephen Leake writes: >> Depends on the use case; the user might want to see: >> >> - "all (overloaded) definitions of "foo", in all projects " >> >> Perhaps to check whether current occurance could be using a >> different definition. Or to see if the different definitions could >> be combined, or further refactored. >> >> This is more useful in languages that explicitly support overloaded >> symbols (Ada has many definitions of "Put" in its standard library). >> >> - "the definition for _this_ use of "foo", in some project " >> >> To see what it actually does. >> >> - "all methods for this generic function" >> >> Similar to the first use case, but limited to one generic function. >> >> So the question now is: what does EDE do for these use cases? > > AFAIK, you can only search in the current project. However, your use > cases involve more than just a project system. If you want to search for > overloads or methods, you need a parser as well. Yes. > This also applies to the most important feature (at least for me): > show all definitions of 'foo' that are currently in scope. EDE has no > notions of symbols, scope, overloading, methods, etc. Yes, I'm beginning to realize that. Semantic provides those things. And it can use different backends, so it can serve as the Emacs standard interface to such things (although I'd want to make significant changes to use it for Ada mode). In that sense, Semantic competes with xref in the same way EDE competes with project.el. > It gets much more complicated when you're not only interested in > definitions, but any occurance of a symbol. For instance, you want all > places where 'foo' gets called, but not any 'foo', but the method 'foo' > from class 'bar' and not from any other class. Right; that's name resolution; best done by the compiler. So hopefully it can output cross reference information (or provide access to it in some way). > I can't really say much about xref since I haven't really worked with it > yet. The semantic-symref feature is also pretty limited in this > regard. So in the end, I often ended up calling grep or global > directly. Right. > All this stuff is highly dependent on the language you're using. The backend may be, but at the API level, there are some things that all object oriented languages support: - Search for all implementations of this method. That's the language used by elisp cl-generic and eieio defclass. I just made this the default behavior for xref-find-definitions. Although that's not tested on eieio classes; I'll add that to my list. In Ada, it's called "functions that override primitive operations". In C++, it's "functions that override a virtual function". The terminology is different, but the underlying notion of runtime dispatch is the same. We might want to customize the menu entry depending on the current programming language. - Search for the parents of this type. "Type" is the Ada word; other languages use "class" here. - Search for all functions that overload this one. Ada and C++ (at least) support this. - Search for all references to this function. In C, these searches are simpler; the first three only return one result. -- -- Stephe