From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to define xref-find-definitions for a new mode? Date: Mon, 11 Jun 2018 05:22:26 +0200 Message-ID: <87y3fm80st.fsf@mbork.pl> References: <87po105ufk.fsf@mbork.pl> <834lictkgm.fsf@gnu.org> <87muw4z5oh.fsf@mbork.pl> <83vaass334.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528687345 1309 195.159.176.226 (11 Jun 2018 03:22:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2018 03:22:25 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 11 05:22:21 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSDPQ-0000FS-4G for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jun 2018 05:22:20 +0200 Original-Received: from localhost ([::1]:46232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSDRX-0001Bc-5b for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jun 2018 23:24:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSDR0-0001BU-Ig for help-gnu-emacs@gnu.org; Sun, 10 Jun 2018 23:23:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSDQz-0006W6-GY for help-gnu-emacs@gnu.org; Sun, 10 Jun 2018 23:23:58 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:37366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSDQt-0006NL-ST; Sun, 10 Jun 2018 23:23:52 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 0AB91E68A2; Mon, 11 Jun 2018 05:23:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UVuDf5xnF4gy; Mon, 11 Jun 2018 05:23:40 +0200 (CEST) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 483CDE681B; Mon, 11 Jun 2018 05:23:40 +0200 (CEST) In-reply-to: <83vaass334.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.110.48.8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117097 Archived-At: On 2018-06-09, at 11:48, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: help-gnu-emacs@gnu.org >> Date: Sat, 09 Jun 2018 11:10:22 +0200 >> >> Thanks. Are there other places I could look into, like xref >> implementation for a concrete language? > > In the sources for the respective languages, notably Lisp. Search for > "xref-". > >> > (Btw, doesn't it already work? Etags is an existing back-end for >> > Xref, and 'etags' the program already supports TeX and its >> > derivatives, so it is able to create TAGS tables for LaTeX files.) >> >> Well, possibly, but I'd like it to work like for Elisp or JavaScript, >> without a TAGS table. > > Is this likely to happen? Lisp and JavaScript know where to find > functions and variables because they keep that information as part of > defining them. I don't think TeX does anything similar, does it? Why couldn't it (at least in theory)? If etags can do it, why not Emacs? Also, I'm not sure JS does that. >> Also, I want it to go to \label when on \ref, to \bib / \bibitem >> when on \cite etc. > > Are you sure it doesn't work already? E.g., if \label is tagged, then > "M-." on the tag's name at \ref should go to the label's definition. Well, apparently it doesn't without the TAGS file. And even with it, I couldn't make it to work. Also, amsrefs is not suppported. Best, -- Marcin Borkowski http://mbork.pl