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 21:34:07 -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 1418092470 24566 80.91.229.3 (9 Dec 2014 02:34:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Dec 2014 02:34:30 +0000 (UTC) Cc: emacs-devel@gnu.org, Jorgen Schaefer To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 09 03:34:23 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 1XyAd5-0007dw-L1 for ged-emacs-devel@m.gmane.org; Tue, 09 Dec 2014 03:34:23 +0100 Original-Received: from localhost ([::1]:37413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyAd5-0005FG-8N for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 21:34:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyAcw-0005F4-Gh for emacs-devel@gnu.org; Mon, 08 Dec 2014 21:34:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyAcq-0002jZ-GM for emacs-devel@gnu.org; Mon, 08 Dec 2014 21:34:14 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:4339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyAcq-0002jV-Bu for emacs-devel@gnu.org; Mon, 08 Dec 2014 21:34:08 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am8PAOwQflRFxLi7/2dsb2JhbABbgweBK4I1hVrFHQQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCzQSFBgNJBMbiBwJ1lkBAQEBBgEBAQEekG8HhEgFiwGSMY9zggqBeIQZITCCRwEBAQ X-IPAS-Result: Am8PAOwQflRFxLi7/2dsb2JhbABbgweBK4I1hVrFHQQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCzQSFBgNJBMbiBwJ1lkBAQEBBgEBAQEekG8HhEgFiwGSMY9zggqBeIQZITCCRwEBAQ X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="99919899" 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 21:34:07 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 9B7A76610C; Mon, 8 Dec 2014 21:34:07 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Mon, 08 Dec 2014 16:38:40 -0500") 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:179514 Archived-At: Alright, let's go ahead with this. Can you send a "latest and greatest" version of your code so I can install it into master? Stefan >>>>> "Stefan" == Stefan Monnier writes: >> > 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