From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Generalizing find-definition Date: Mon, 03 Nov 2014 15:09:40 -0500 Message-ID: References: <20141102151524.0d9c665c@forcix> <20141102172944.0f7944e3@forcix> <20141103084433.12117c03@forcix> <20141103192853.2702fe7a@forcix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415045414 15063 80.91.229.3 (3 Nov 2014 20:10:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2014 20:10:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jorgen Schaefer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 03 21:10:04 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 1XlNwv-0001dg-MR for ged-emacs-devel@m.gmane.org; Mon, 03 Nov 2014 21:10:01 +0100 Original-Received: from localhost ([::1]:37152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNwv-0007dD-7m for ged-emacs-devel@m.gmane.org; Mon, 03 Nov 2014 15:10:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNwl-0007Zh-Cg for emacs-devel@gnu.org; Mon, 03 Nov 2014 15:09:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlNwc-0004TJ-5v for emacs-devel@gnu.org; Mon, 03 Nov 2014 15:09:51 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:29447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNwc-0004TE-2O for emacs-devel@gnu.org; Mon, 03 Nov 2014 15:09:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQNAOatTlRFpY87/2dsb2JhbABcgw5UWII2hn7EBIdPBAICgRwXAQF8hAMBAQMBViMFCwsOJhIUGA0kiEsJy3IBAQEBBgEBAQEekQgHhEsFi2SKa5tRgW+EFh8vgksBAQE X-IPAS-Result: AhQNAOatTlRFpY87/2dsb2JhbABcgw5UWII2hn7EBIdPBAICgRwXAQF8hAMBAQMBViMFCwsOJhIUGA0kiEsJy3IBAQEBBgEBAQEekQgHhEsFi2SKa5tRgW+EFh8vgksBAQE X-IronPort-AV: E=Sophos;i="5.04,797,1406606400"; d="scan'208";a="95874508" Original-Received: from 69-165-143-59.dsl.teksavvy.com (HELO pastel.home) ([69.165.143.59]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Nov 2014 15:09:40 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 416C58597; Mon, 3 Nov 2014 15:09:40 -0500 (EST) In-Reply-To: <20141103192853.2702fe7a@forcix> (Jorgen Schaefer's message of "Mon, 3 Nov 2014 19:28:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:176308 Archived-At: > For Python, there is nothing suitable for "identifier at point" that I Yet, you say that you offer a tab-completable selection of identifiers. So obviously, there is a suitable "identifier at point". Do you mean by the above not that the concept is meaningless but that it's difficult to write a function that reliably returns the appropriate identifier at point? If so, I can definitely agree that for some modes it can be difficult, and it should not be necessary to write such a function if the backend can use a buffer-position instead (and delegate the hard work to some external tool). But having such an identifier-at-point-function can be useful for all kinds of things (typically default for minibuffer inputs of various commands), so it makes a lot of sense to standardize it. > For Python, I do provide a tab-completable list of identifiers > (currently only for pydoc, but the code should be reusable for this), > but it is not a simple list of identifiers, but a tree. The tab > completion starts with top-level modules (like "json"), but when you > add a ".", it will continue to complete attributes of the module or > class etc.. Providing the full list of possible completions right > away would take a very long time. Of course. But such completion is nothing new. File names are completed this way. Bzr revision names are completed this way as well. No need for a special completion command, you can do that just fine with just a completion-table (and then partial-completion style will let you complete "js.fo" to anything that matches "js*.fo*"). Note that such completion tables are clearly not lists of strings, but they're functions (actually, they're objects represented as functions, for lack of an object system). > This is getting extremely complex and I do not see how this would > benefit the user much. As long as the "set of use-kinds" and the "set of identifier categories" is determined by the backend itself, I don't think it increases complexity of the backends or the backend API very much. And there are clearly example of existing systems which do provide such refinements (e.g. find-variable vs find-function on Elisp, and the C-c C-w s versus C-c C-w b versus C-c C-w r in SLIME), so it makes sense to include it in the design of the backend API. > There are definitions of an identifier, and uses of an identifier. Yes, clearly this is the main distinction and we should focus on this functionality w.r.t designing the UI. Stefan