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 16:38:40 -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 1418074758 15880 80.91.229.3 (8 Dec 2014 21:39:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2014 21:39:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Helmut Eller , Jorgen Schaefer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 08 22:39:11 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 1Xy61O-0000tr-3s for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 22:39:10 +0100 Original-Received: from localhost ([::1]:36263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xy61N-0003Lk-LC for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 16:39:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xy613-0003Kt-SI for emacs-devel@gnu.org; Mon, 08 Dec 2014 16:38:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xy60w-0006yH-DJ for emacs-devel@gnu.org; Mon, 08 Dec 2014 16:38:49 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:4506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xy60w-0006y9-9H for emacs-devel@gnu.org; Mon, 08 Dec 2014 16:38:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwPAOwQflRFxLi7/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCws0EhQYDSQBLYgcCdZZAQEBAQEFAQEBAQEdkG8HhEgFiwGSMY9zggqBeIQZIYJ3AQEB X-IPAS-Result: AjwPAOwQflRFxLi7/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCws0EhQYDSQBLYgcCdZZAQEBAQEFAQEBAQEdkG8HhEgFiwGSMY9zggqBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="99903037" 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 16:38:40 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id A9BF666125; Mon, 8 Dec 2014 16:38:40 -0500 (EST) In-Reply-To: (Helmut Eller's message of "Mon, 08 Dec 2014 20:58:47 +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:179480 Archived-At: > > What happened to the other contenders? > Nothing in particular. The competition is still open. Jorgen, what's your opinion? > The elisp backend code needs to define a subclass of xref-backend-class > and that can't be done without loading xref.el and eieio, I think. Yes, I saw that. I guess that's one advantage of the "plain function" API compared to the EIEIO-based API. > elisp-mode is needed to create the *scratch* buffer and it seemed to me > that loading xref.el so early increases startup time for no good reason. If it's needed for a normal "emacs -Q", then it should be preloaded. And as it currently stands, I'd rather not preload EIEIO, so indeed the elisp xref code can't be in elisp-mode.el. > find-func.el might be a reasonable place for the elisp-xref > backend code. Indeed, that sounds like a good solution, thanks. > The indirection makes it easier to autoload xref.el. Hmm... I don't see why that'd make a difference, unless by "xref.el" you mean "the file in which the elisp-xref-backend-function is defined". > If emacs-lisp-mode wants to create a backend object it has to load > xref.el first, which as I said above seems undesirable. Indeed, I see that this makes a significant difference. Another cosmetic issue I see with this EIEIO-based API is the need to define a new class with a new instance which is really just a dummy constant (no instance fields) and is only used to get the method-dynamic-dispatch working (I guess in CLOS we could circumvent this dummy class&instance by using an (eql ) as the "class" specializer). Stefan