From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers Date: Mon, 28 Feb 2022 14:05:38 +0100 Message-ID: <87wnhf9m59.fsf@gmail.com> References: <87pmnad7n3.fsf@gmail.com> <87czj9dhfx.fsf@gmail.com> <864k4k2lsg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38911"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: 53749@debbugs.gnu.org, Arash Esbati To: David Fussner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 28 14:06:59 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nOfju-0009uc-JO for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Feb 2022 14:06:58 +0100 Original-Received: from localhost ([::1]:55516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOfjt-0006PL-7w for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Feb 2022 08:06:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOfj7-0006NJ-4j for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 08:06:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOfj0-0001j5-Iy for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 08:06:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOfj0-0005B7-Dr for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 08:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Feb 2022 13:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53749 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 53749-submit@debbugs.gnu.org id=B53749.164605354919885 (code B ref 53749); Mon, 28 Feb 2022 13:06:02 +0000 Original-Received: (at 53749) by debbugs.gnu.org; 28 Feb 2022 13:05:49 +0000 Original-Received: from localhost ([127.0.0.1]:60473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOfim-0005Af-Fo for submit@debbugs.gnu.org; Mon, 28 Feb 2022 08:05:48 -0500 Original-Received: from mail-ed1-f42.google.com ([209.85.208.42]:33622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOfik-0005AR-E2 for 53749@debbugs.gnu.org; Mon, 28 Feb 2022 08:05:46 -0500 Original-Received: by mail-ed1-f42.google.com with SMTP id s14so17549440edw.0 for <53749@debbugs.gnu.org>; Mon, 28 Feb 2022 05:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=49H0wRYpOluU+MRv3P538YcwV03c6qfYnHcDghI3il4=; b=oOAvMH5kT4KT36vpFPIaCM4fgdZxuCbJR4r1TpW3k1lvEv0NZgkQ59N/dLLPvqFi3q WvTrwDveDRgU5oP24bsprqZwY/GthYSHNTHWYym6PNL2V0tmfmuKWUFuu4n1OExn/8rT fNMxEL8bENZ68AuRO9P0CW/ADJYa5svijSsAq/2ROcwMvvHqEiqL0QZ/vAnBuHidLlUO A8lkDp5t7qDsnmK/X4qzbPVu561P3MEfUZ72g7URZpRBha/VlHDFv9SX5UgQFz7ieXpu EecObhuRR5bglfF9cjR0OFolXjta55cg3BNjy62k99UZn/5W/lFcycAvMBVIG5ICuIqN u1xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=49H0wRYpOluU+MRv3P538YcwV03c6qfYnHcDghI3il4=; b=gOSe8z7gRO+f2wKZfww2iGLN91LpMWWqpXGOREvxAWKukJRcNsHWom+7NBB5r3JKVF 2CuqNq0l03I9g94aK2GQUn0MSC33cD2PTqag27cpxUm4QYEbGXZmsLaDcG4p+yPbi6fC dKJsiOPp0jK7YIcURJTPkmxw3oWYZ7dI0LYxczXg3GfK9uzM95m0+zlZ+pg/DR/tofpv txnN77WvFu7Bej6L62tLwnUWsl2Wp3DxQfvRJGQa7cG9woXXNHSW8g3+7KhFoZ/jct1d D68bG7II0iaECqOX3mUU0zJsrnkusw5SKufVC6PxxUSGzklTn1djxOJ41k5VBc1ee0+F xZ4Q== X-Gm-Message-State: AOAM532oofOfSBdP2biTnORR6l3sY44Adsh3kRfMR3t2MlzUljaOo0Oc tveqbwoHy3gsPjphneFBlD0OAYfRMm8MvA== X-Google-Smtp-Source: ABdhPJy8qwtmp3aZ8OSqQcuiBKcz7ODAO1FIRzEYdsyhfBUS3VoCGvQ91GkfJ7NiyS+e1uqeiRyr+Q== X-Received: by 2002:aa7:c0ce:0:b0:400:1a:e9a2 with SMTP id j14-20020aa7c0ce000000b00400001ae9a2mr19883158edp.396.1646053540320; Mon, 28 Feb 2022 05:05:40 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id sb31-20020a1709076d9f00b006ceb969822esm4385682ejc.76.2022.02.28.05.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 05:05:39 -0800 (PST) In-Reply-To: (David Fussner's message of "Mon, 28 Feb 2022 09:09:36 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227802 Archived-At: On Mon, 28 Feb 2022 at 09:09, David Fussner wrote: > For what it's worth, I've always just done what Arash suggests when > RefTeX gets out of sync, and haven't had any issues with it that I can > remember. (To be fair, my use cases haven't exactly been exotic.) Sure, I'm aware you have to do the manual resync when using RefTeX. I just think it's a totally unnecessary hurdle at this time and age. I used to advice the RefTeX commands so they would reparse the document every time, and this worked just fine. (Granted, I never worked on anything over 100 pages or so, but it should also be possible to reparse individual files of a multifile project so that the file sizes never become an issue.) >> The problem is that there's no way for Emacs to communicate that one of >> these programming modes is to be used. This could be fixed in two ways: >> >> A. by creating latex-prog and latex-expl3 derived modes in Emacs, or >> >> B. adding heuristics to Digestif to decide if a given file is "document" >> or "code". >> >> Do you have any thoughts about A? Would there be any other benefits in >> Emacs to justify the latex-prog and latex-expl3 major modes? It seems >> that (at least in AUCTeX) @ is always considered a letter, which may be >> innocuous but is kinda wrong. > > The only thought I have is that it sounds like a new major mode would > be overkill for what you need here. I would think that a variable or > defcustom might do the trick, or at most maybe a minor mode? When > navigating code I really want to be able to follow the commands to > their source no matter whether the command is internal or for users, > though I can see how in a code-completion setting you might want to be > able to separate the two more cleanly. Obviously, I'm not the person > you need to convince about all of this -- that would be Arash and the > emacs maintainers, themselves. Okay, thanks for your insight. > > Best, > > David. > > On Sun, 27 Feb 2022 at 18:43, Arash Esbati wrote: >> >> Augusto Stoffel writes: >> >> > If you type \label{something}, as opposed to using the RefTeX command >> > to add a label (or if you edit the label by hand) then RefTeX will not >> > reparse the document and get out of sync. >> >> If you know the known labels to RefTeX are out of sync, you can issue >> `C-c )' with a prefix argument: >> >> ,----[ C-h f reftex-reference RET ] >> | reftex-reference is an interactive native compiled Lisp function in >> | =E2=80=98reftex-ref.el=E2=80=99. >> | >> | (reftex-reference &optional TYPE NO-INSERT CUT) >> | >> | Make a LaTeX reference. Look only for labels of a certain TYPE. >> | With prefix arg, force to rescan buffer for labels. This should only = be >> | necessary if you have recently entered labels yourself without using >> | reftex-label. Rescanning of the buffer can also be requested from the >> | label selection menu. >> | The function returns the selected label or nil. >> | If NO-INSERT is non-nil, do not insert \ref command, just return label. >> | When called with 2 C-u prefix args, disable magic word recognition. >> | >> | Probably introduced at or before Emacs version 20.1. >> | >> `---- >> >> Or in the labels *RefTeX select* buffer, you have these choices: >> >> r / C-u r Reparse document / Reparse entire document. >> >> I usually hit r when I don't find the label I'm looking for. >> >> > Or at least that was the case when I still used RefTeX. So it might >> > be worth considering some cache invalidation scheme there. >> >> The question is if it's worth the effort where a remedy is already in >> place. >> >> Best, Arash