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: Generalizing find-definition Date: Tue, 04 Nov 2014 09:54:18 -0600 Message-ID: <851tpjrmfp.fsf@stephe-leake.org> References: <20141102151524.0d9c665c@forcix> <85a949utmn.fsf@stephe-leake.org> <20141103083143.646fb3e0@forcix> <20141103185857.4178b438@forcix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415116494 31632 80.91.229.3 (4 Nov 2014 15:54:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Nov 2014 15:54:54 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 04 16:54:47 2014 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 1XlgRS-0003SM-Q1 for ged-emacs-devel@m.gmane.org; Tue, 04 Nov 2014 16:54:46 +0100 Original-Received: from localhost ([::1]:41308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlgRS-0000i2-GS for ged-emacs-devel@m.gmane.org; Tue, 04 Nov 2014 10:54:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlgR8-0000hN-W3 for emacs-devel@gnu.org; Tue, 04 Nov 2014 10:54:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlgR2-0005EO-2S for emacs-devel@gnu.org; Tue, 04 Nov 2014 10:54:26 -0500 Original-Received: from dnvrco-outbound-snat.email.rr.com ([107.14.73.230]:24301 helo=dnvrco-oedge-vip.email.rr.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlgR1-0005E9-TS for emacs-devel@gnu.org; Tue, 04 Nov 2014 10:54:20 -0500 Original-Received: from [70.94.38.149] ([70.94.38.149:50024] helo=TAKVER) by dnvrco-oedge03 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id B5/D0-23829-AA6F8545; Tue, 04 Nov 2014 15:54:19 +0000 In-Reply-To: <20141103185857.4178b438@forcix> (Jorgen Schaefer's message of "Mon, 3 Nov 2014 18:58:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt) X-RR-Connecting-IP: 107.14.64.142:25 X-Authority-Analysis: v=2.1 cv=YJMRyH2x c=1 sm=1 tr=0 a=AppmJ/7ZOOFWL/q6u6u93g==:117 a=AppmJ/7ZOOFWL/q6u6u93g==:17 a=ayC55rCoAAAA:8 a=fNEgcOh0sVsA:10 a=9i_RQKNPAAAA:8 a=pGLkceISAAAA:8 a=EWsD7Iv14YtizizJwWIA:9 X-Cloudmark-Score: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 107.14.73.230 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:176348 Archived-At: Jorgen Schaefer writes: > On Mon, 03 Nov 2014 09:13:45 +0100 > Helmut Eller wrote: > >> On Mon, Nov 03 2014, Jorgen Schaefer wrote: >> >> >> I have my own hack for this; It requires me to distinguish between >> >> variable and defun names and invoke separate keys; I hope you can >> >> remove that annoyance. >> > >> > I'm not sure how I can remove that annoyance - is that not >> > language-dependent? What kind of functionality would you require >> > there? >> >> One way to solve this is to merge the list of candidates for functions >> and variables. At least that's what we do in SLIME. In elisp-mode >> M-. could combine the candidates of find-function and find-variable. >> Most of the time the merged list would only contain a single >> candidate. > > Why would the proposed find-definition interface make a distinction > between variables and functions at all? So far, there has been none > proposed? I agree, it should not. > Does that mean that this is not an issue? No, the problem is the backend functions currently provided by elisp; function-called-at-point vs variable-at-point. There is no current elisp function that provides 'identifier-at-point'. In addition, symbol-file requires 'defun or 'defvar to return the appropriate file name. The proposed solution for the elisp backend for find-definition-function is to call both function-called-at-point and variable-at-point; if only one gives a result, go there. Otherwise, show the list of two locations. That's still not quite right; if point is on an argument to a function, function-called-at-point will return the function symbol, not the argument. So we really need just identifier-at-point, which is the first portion of variable-at-point and function-called-at-point. -- -- Stephe