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: xref backends for elisp-related modes Was: Re: Bad moves with xref-find-definitions Date: Sun, 26 Apr 2015 22:20:06 -0400 Message-ID: References: <87h9s6c27z.fsf@gmail.com> <87zj5wnlyt.fsf@gmail.com> <553C285B.4070400@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430101236 21299 80.91.229.3 (27 Apr 2015 02:20:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Apr 2015 02:20:36 +0000 (UTC) Cc: Vitalie Spinu , emacs-devel@gnu.org, Dmitry Gutov To: joaotavora@gmail.com (=?windows-1252?B?Sm/jbyBU4XZvcmE=?=) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 27 04:20:20 2015 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 1YmYef-0007OS-R9 for ged-emacs-devel@m.gmane.org; Mon, 27 Apr 2015 04:20:17 +0200 Original-Received: from localhost ([::1]:52810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmYee-0004Mn-Tr for ged-emacs-devel@m.gmane.org; Sun, 26 Apr 2015 22:20:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmYec-0004Mi-Ai for emacs-devel@gnu.org; Sun, 26 Apr 2015 22:20:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmYeY-0000wd-70 for emacs-devel@gnu.org; Sun, 26 Apr 2015 22:20:14 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:37758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmYeY-0000wH-1B for emacs-devel@gnu.org; Sun, 26 Apr 2015 22:20:10 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t3R2K6bo024466; Sun, 26 Apr 2015 22:20:06 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 3930A2189; Sun, 26 Apr 2015 22:20:06 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Jo=E3o_T=E1?= =?windows-1252?Q?vora=22's?= message of "Sun, 26 Apr 2015 12:51:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5288=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5288> : inlines <2797> : streams <1429212> : uri <1916443> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:185923 Archived-At: > Additionally, if `add-function' allowed `:append' for its WHERE arg, > like Common Lisp's method combinations, it would be even cleaner to get > the behaviour desired by Eli (and Vitalie, I think), of multiple > backends. > (advice-add 'elisp-xref-find :append #'etags-xref-find) You can get that with (advice-add 'elisp-xref-find :around (lambda (orig-fun &rest args)) (append (apply #'etags-xref-find args) (apply orig-fun args))) tho it's obviously not as elegant. We could add a `:append' alternative. We just need to add the corresponding bytecode to advice--bytecodes. Sadly, these typically need to be handtweaked, since they need to use a particular layout in their constant vector. Stefan