From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Fussner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers Date: Wed, 13 Sep 2023 18:01:41 +0100 Message-ID: References: <1de34060-e93b-0a42-fff5-20e283abe0dc@yandex.ru> <87o7vq0zir.fsf@gnus.org> <8735d20yvd.fsf@gnus.org> Reply-To: David Fussner Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27876"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53749@debbugs.gnu.org, Lars Ingebrigtsen , Stefan Kangas To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 13 19:03:14 2023 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 1qgTGi-0006v3-VG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Sep 2023 19:03:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgTGU-00048u-Oq; Wed, 13 Sep 2023 13:02:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgTGT-00048k-2H for bug-gnu-emacs@gnu.org; Wed, 13 Sep 2023 13:02:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgTGS-00060y-Qx for bug-gnu-emacs@gnu.org; Wed, 13 Sep 2023 13:02:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgTGY-0005Ef-3p for bug-gnu-emacs@gnu.org; Wed, 13 Sep 2023 13:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Fussner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Sep 2023 17:03: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: pending patch Original-Received: via spool by 53749-submit@debbugs.gnu.org id=B53749.169462452820033 (code B ref 53749); Wed, 13 Sep 2023 17:03:02 +0000 Original-Received: (at 53749) by debbugs.gnu.org; 13 Sep 2023 17:02:08 +0000 Original-Received: from localhost ([127.0.0.1]:35863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgTFg-0005D3-31 for submit@debbugs.gnu.org; Wed, 13 Sep 2023 13:02:08 -0400 Original-Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:56333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgTFd-0005CW-Ks for 53749@debbugs.gnu.org; Wed, 13 Sep 2023 13:02:06 -0400 Original-Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68fb71ded6dso6477b3a.0 for <53749@debbugs.gnu.org>; Wed, 13 Sep 2023 10:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1694624514; x=1695229314; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hDk2F0fJ+GrFtXH9IsSJtROEMzPFNMtxuCT68qWf0pk=; b=p9Hy+mFRMhChWFnTj680PFot+HmxWmFenqfxkpP3yyIrQQ87eeqlbzOSS6tgX5YFzr Zrkpq8u/i7vy7wl9XwOauxbs6IRvUEYhwVNP5i00cKkucCIdCElofsoJ+GsVkzuM4r7S q/SY4GN+BP5WZCjt/z/1QQqnmfWaY0JAJXRHKKXpjxOweSjFhBCticC6Ejzi+Q8h68vF ygAVD7ajt8ucMuuSyfzRRWmQMbt2Dt19sE0O2A9Ylw424euWEcdg14Tt6gExBwvi/K7l M13LoPuW0QyHpkaLR2AdaDJ7O5JEq0JJgP/295ayszdarkFHSRLbLgCI4AK3H5nXuTpD ZdvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694624514; x=1695229314; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hDk2F0fJ+GrFtXH9IsSJtROEMzPFNMtxuCT68qWf0pk=; b=nFOr3Jq/s1BceJAiL9cA3K0h4jRw0QcDvulshUuzM1cD9I+v5FaQa4WdAMnxR1zPXU BbEHBKl3qg2ASzMa6XrPGUn9tSm0LiIy3aXJUY4FovEZnTMxW3MRG8WZc9VIcTKrDAFM oFh6qkTUC2Rt42TyT2Tv+OChRkA9mglKsshYaNBl0SgHGuFLahClFjSEu0WiMTvFXric YXqFu8B38si3yEYBO7zitplya1Pl2PZDYwoVIOf2fED9/hZe6AwXw20IYj+4q1eUa2UK Tx5OrOb2fSAK6lYbFA/gsVcSSPfq4XaL7LCV8hDaeZtvx53z3H1YR8f8MRHKwo9+KF17 s8OQ== X-Gm-Message-State: AOJu0YyWmigPf21Tqzw5Z7EohbHmtCYbKVwJpE4NQ4SGnsBKX8Gbfwg3 93U894VALqDQvHjIOZcbCS5Fvin4/4g2UTRa4m4= X-Google-Smtp-Source: AGHT+IFKuE3BvDA2TSXne898q+tyPJoZ4AmYsrx/wjBdxL8c5zf/m4POPx72JiUklw/avLbJwOf6Ji+IWzMk8YuBc68= X-Received: by 2002:a05:6a21:99a2:b0:154:e054:d0d1 with SMTP id ve34-20020a056a2199a200b00154e054d0d1mr3422699pzb.55.1694624514105; Wed, 13 Sep 2023 10:01:54 -0700 (PDT) In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270339 Archived-At: Hi Dmitry, Thanks for the feedback! > These won't be affected either way, right? Because project-find-regexp > defaults its input to (thing-at-point 'symbol t), and isearch... > probably also uses "symbol" if you ask it to. > > So... why not just make tex-thingatpt-include-escape a boolean? What > commands need to be distinguished that way? I think 'find-tag' (it's > obsolete but still used sometimes) would need to obey this var as well. xref-find-apropos and xref-find-references don't work well (or at all) with the escape char included in the search string, so I was keeping that char away from them. (The buffer-local variables I manipulate for project-find-regexp and isearch-forward-thing-at-point have to do with ensuring they use the texsymbol thing in the first place -- see tex--symbol-or-texsymbol.) Does that make sense? I'll look at find-tag, too; thanks for pointing that out. > Why not set the variable find-tag-default-function instead? That seems > easier and more appropriate to do inside a major mode function. I settled on putting the symbol on the modes because I thought it was simpler than setting the variable buffer-locally in all the in-tree and AUCTeX modes, but I'll revisit this and see whether I can come up with something better. Thanks again. On Wed, 13 Sept 2023 at 16:23, Dmitry Gutov wrote: > > Hi David! > > Thanks for the new patch. > > I'm skipping over the etags parser changes (others might comment, I'm > just assuming they are good). > > And "thing at point" code is, I think, at your discretion (if the result > is useful, then that seems good). I would probably not call the function > the same way given that we don't install this "thing" globally, just > using it from several the major modes in a particular way. Anyway, that > is a minor affair. > > I'd like to suggest two simplifications for the xref-related stuff, if > those work for you.r along the lines of your > > On 13/09/2023 14:10, David Fussner via Bug reports for GNU Emacs, the > Swiss army knife of text editors wrote: > > > <...> I also manipulate some > > variables buffer-locally to make things like project-find-regexp and > > isearch-forward-thing-at-point work better in such buffers. > > These won't be affected either way, right? Because project-find-regexp > defaults its input to (thing-at-point 'symbol t), and isearch... > probably also uses "symbol" if you ask it to. > > So... why not just make tex-thingatpt-include-escape a boolean? What > commands need to be distinguished that way? I think 'find-tag' (it's > obsolete but still used sometimes) would need to obey this var as well. > > And the second thing: you're putting the symbol on major modes. > > +(dolist (texmode tex-thingatpt-modes-list) > + (put texmode 'find-tag-default-function 'tex--thing-at-point)) > > Why not set the variable find-tag-default-function instead? That seems > easier and more appropriate to do inside a major mode function.r along the lines of your > > Thanks.