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, 08 Dec 2014 09:33:25 -0500 Message-ID: References: <20141102151524.0d9c665c@forcix> <20141117211039.37f03409@forcix> <877fymghgb.fsf@bredband.net> <85ppc0qf9a.fsf@stephe-leake.org> <85zjb3o09d.fsf@stephe-leake.org> <85tx1amnyg.fsf@stephe-leake.org> <85egsem1u2.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418049245 25624 80.91.229.3 (8 Dec 2014 14:34:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2014 14:34:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 08 15:33:58 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 1XxzNt-0004nd-VH for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 15:33:58 +0100 Original-Received: from localhost ([::1]:34322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxzNt-0006w1-Ik for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 09:33:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxzNY-0006rK-1K for emacs-devel@gnu.org; Mon, 08 Dec 2014 09:33:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxzNO-0005XO-RU for emacs-devel@gnu.org; Mon, 08 Dec 2014 09:33:35 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:64228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxzNO-0005XG-OR for emacs-devel@gnu.org; Mon, 08 Dec 2014 09:33:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjsPAOwQflRFxLi7/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMQCzQSFBgNJIhKCdZZAQEBAQYBAQEBHpBvB4RIBYsBpC6BeIQZIYJ3AQEB X-IPAS-Result: AjsPAOwQflRFxLi7/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMQCzQSFBgNJIhKCdZZAQEBAQYBAQEBHpBvB4RIBYsBpC6BeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="99862576" Original-Received: from 69-196-184-187.dsl.teksavvy.com (HELO ceviche.home) ([69.196.184.187]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Dec 2014 09:33:25 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id B27AD66162; Mon, 8 Dec 2014 09:33:25 -0500 (EST) In-Reply-To: (Helmut Eller's message of "Sun, 07 Dec 2014 10:55:39 +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:179391 Archived-At: >> This said, I think the most urgent step is to get such a generalized >> find-definition into Emacs. > Here is a patch: What happened to the other contenders? > --- a/lisp/progmodes/elisp-mode.el > +++ b/lisp/progmodes/elisp-mode.el > @@ -231,6 +231,7 @@ Blank lines separate paragraphs. Semicolons start comments. > (setq imenu-case-fold-search nil) > (setq-local eldoc-documentation-function > #'elisp-eldoc-documentation-function) > + (setq-local xref-backend-function 'xref-elisp-backend-function) > (add-hook 'completion-at-point-functions > #'elisp-completion-at-point nil 'local)) Hmm, so xref-elisp-backend-function is not in elisp-mode.el? That's too bad. > +(defvaralias 'find-tag-marker-ring 'xref--marker-ring) > +(make-obsolete-variable 'find-tag-marker-ring nil "25.1") You can use define-obsolete-variable-alias. > +;; and `etags--xref-backend' classes for examples. > + > +(require 'cl-lib) You need a ";;; Code:" up there. Try C-u M-x checkdoc-current-buffer (you don't have to heed all its recommendations, tho). > +;; For now, make the etags backend the default. > +(defvar xref-backend-function 'etags-xref-backend-function) IIUC this is the main interface between xref and its backends, so it very much needs a good docstring. Also, I don't understand why it should be a function that returns a "backend object" rather than being the backend object itself. Stefan