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: Generalizing find-definition Date: Fri, 07 Nov 2014 22:56:43 +0200 Message-ID: <86389uwwz8.fsf@yandex.ru> References: <20141102151524.0d9c665c@forcix> <20141102172944.0f7944e3@forcix> <20141103084433.12117c03@forcix> <20141103192853.2702fe7a@forcix> <20141103215526.28edeb27@forcix> <86bnokgx8g.fsf@yandex.ru> <85mw845d91.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415393830 28243 80.91.229.3 (7 Nov 2014 20:57:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2014 20:57:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 07 21:57:03 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 1Xmqac-0001Xk-OE for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2014 21:57:02 +0100 Original-Received: from localhost ([::1]:33886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmqac-0005g2-DD for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2014 15:57:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmqaU-0005fe-1s for emacs-devel@gnu.org; Fri, 07 Nov 2014 15:57:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmqaN-00080F-Qx for emacs-devel@gnu.org; Fri, 07 Nov 2014 15:56:53 -0500 Original-Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:41442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmqaN-0007zu-Jp for emacs-devel@gnu.org; Fri, 07 Nov 2014 15:56:47 -0500 Original-Received: by mail-wi0-f170.google.com with SMTP id r20so5523721wiv.3 for ; Fri, 07 Nov 2014 12:56:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=DWLPtoaw4kaEobqADriOi5prLNoJrBs1ePPFYxjWP2k=; b=uNA7FGI5FiFwRodJcG7ct+t2TW2TmdZTvoPc6pNjzKJKKYryjRm6tiqmqrJPmBVzQ+ ZKFT18vGR9Um05usjX5DiUku7zXY1WBwh1TX4tVH2JX0TKuPBb8HvzZoF+xS870r+CG6 6iQ8k4gE0Dam6EQZOG298ALDbWwBxOngR0od1p63SDJ/pHNrWs3bI3dqI+nHqMvRSGCD kYdIGkw787ijYoIG1f/R8TAQub8a65l6s81zc4jhkwEKSKNeF94q/qFSIAn1/4nmthm2 VBkxMClYp6A2n4hi1HtM84XB9WHHdWrLM92ydZ6sBH3KOOW+ZnYOV7elNt+8MGPc4W46 CgxQ== X-Received: by 10.180.74.76 with SMTP id r12mr8827397wiv.6.1415393805970; Fri, 07 Nov 2014 12:56:45 -0800 (PST) Original-Received: from axl ([82.102.116.197]) by mx.google.com with ESMTPSA id w10sm13159368wje.10.2014.11.07.12.56.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 07 Nov 2014 12:56:45 -0800 (PST) In-Reply-To: <85mw845d91.fsf@stephe-leake.org> (Stephen Leake's message of "Thu, 06 Nov 2014 13:40:26 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22a 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:176559 Archived-At: Stephen Leake writes: >> I think it should return "baz" here, if we want to go this way at all. >> And then that value could be passed to a "search-definition-function", >> which will perform a full non-precise scan. > > When would that be useful? In general? In situations similar to whenever a user would call `apropos' when working with ELisp. Sometimes you don't actually know what you're looking for, so you try one or several keywords. >> It apparent that we won't be able to do precise searches for identifiers >> in most cases, > > It requires support from the compiler/backend, but that should always be > available (presumably you have the compiler if you are editing the > code). So why do you think we can't do precise searches in most cases? You're assuming a statically typed language. Arguably, people writing in dynamic languages are at least a significant portion of Emacs users, if not the majority. And C/C++ users will also be at a disadvantage here, unless they use a Clang-based tool, which we won't support in Emacs proper at least in the near future. Or GCC developers deliver on that front. > Hmm, maybe you won't have the compiler installed if you are just reading > someone else's code. I'm not sure that's an important use case. If we don't have a tool which can respond to a search-definition-function request, this is not an interesting situation anyway, even if a plausible one.