From: Stefan Kangas <stefankangas@gmail.com>
To: David Fussner <dfussner@googlemail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: 53749@debbugs.gnu.org, ikumi@ikumi.que.jp, dgutov@yandex.ru,
arash@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
tsdh@gnu.org
Subject: bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers
Date: Sun, 9 Jun 2024 07:36:50 -0400 [thread overview]
Message-ID: <CADwFkmkY_gRVR=x-N=9Jb-1jt-y_598BfvG4PQD5g18vZhH+7A@mail.gmail.com> (raw)
In-Reply-To: <CADF+Rtjn52wJ2ikWcVaw8gBzKV9PGqjnSEb7+8tiifi=LzyAbg@mail.gmail.com>
David Fussner <dfussner@googlemail.com> writes:
> In case the changeset might prove acceptable for version 30, I attach
> the latest patch, which clears out the code I was using to simplify
> testing of the AUCTeX modes.
I have some comments and questions:
- Does this need a NEWS entry?
- I see the brief text you added to tex-mode.el explaining more about
expl3, but perhaps there should be a clear explanation in the commit
message too.
- [Optional: In most places you use spaces for indentation, but here and
there, there is a single tab followed by one or more spaces. Consider
using only spaces.]
> From: David Fussner <dfussner@googlemail.com>
> Date: Wed, 5 Jun 2024 10:26:18 +0100
> Subject: [PATCH] Provide a modified xref backend for TeX buffers
[Don't forget to add the bug number to the ChangeLog.]
> diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
> index 579098c81b1..a064103aa25 100644
> --- a/doc/emacs/maintaining.texi
> +++ b/doc/emacs/maintaining.texi
> @@ -2529,6 +2529,15 @@ Identifier Search
> referenced. The XREF mode commands are available in this buffer, see
> @ref{Xref Commands}.
>
> +When invoked in a buffer whose major mode uses the @code{etags} backend,
> +@kbd{M-?} searches files and buffers whose major mode matches that of
> +the original buffer. It guesses that mode from file extensions, so if
> +@kbd{M-?} seems to be skipping relevant buffers or files, try
> +customizing either the variable @code{semantic-symref-filepattern-alist}
Why does this speak of Semantic? Does `xref-find-references` depend on
it somehow?
> diff --git a/lib-src/etags.c b/lib-src/etags.c
> index 03bc55de03d..6bc734e7df0 100644
> --- a/lib-src/etags.c
> +++ b/lib-src/etags.c
> @@ -5740,11 +5756,25 @@ Scheme_functions (FILE *inf)
> static linebuffer *TEX_toktab = NULL; /* Table with tag tokens */
>
> /* Default set of control sequences to put into TEX_toktab.
> - The value of environment var TEXTAGS is prepended to this. */
> + The value of environment var TEXTAGS is prepended to this.
> + (2024) Add variants of '\def', some additional LaTeX (and
> + former xparse) commands, common variants from the
> + 'etoolbox' package, and the main expl3 commands. */
Do we really need this comment? Isn't the git log enough?
> diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
> index 97c950267c6..fbf08840699 100644
> --- a/lisp/textmodes/tex-mode.el
> +++ b/lisp/textmodes/tex-mode.el
> @@ -636,6 +636,14 @@ tex-font-lock-keywords-2
> 3 '(tex-font-lock-append-prop 'bold) 'append)))))
> "Gaudy expressions to highlight in TeX modes.")
>
> +(defvar-local tex-expl-region-list nil
> + "List of region boundaries where expl3 syntax is active.
> +It will be nil in buffers where expl3 syntax is always active, e.g.,
Please prefer "for example" to "e.g.".
> +(defvar-local tex-expl-buffer-p nil
> + "Non-nil in buffers where expl3 syntax is always active.")
What does "always active" mean as compared to just "active"?
Does this need to be elaborated?
> +;; Populate `semantic-symref-filepattern-alist' for the in-tree modes;
> +;; AUCTeX is doing the same for its modes.
> +(with-eval-after-load 'semantic/symref/grep
> + (defvar semantic-symref-filepattern-alist)
> + (push '(latex-mode "*.[tT]e[xX]" "*.ltx" "*.sty" "*.cl[so]"
> + "*.bbl" "*.drv" "*.hva")
> + semantic-symref-filepattern-alist)
> + (push '(plain-tex-mode "*.[tT]e[xX]" "*.ins")
> + semantic-symref-filepattern-alist)
> + (push '(doctex-mode "*.dtx") semantic-symref-filepattern-alist))
Doesn't this stuff rather belong in semantic itself?
> +(cl-defmethod xref-backend-references ((_backend (eql 'tex-etags)) identifier)
> + "Find references of IDENTIFIER in TeX buffers and files."
> + (require 'semantic/symref/grep)
Are we sure that we want to make this depend on semantic?
Is there any way around that?
next prev parent reply other threads:[~2024-06-09 11:36 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 15:09 bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-21 2:11 ` Dmitry Gutov
2022-02-21 9:48 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-21 17:28 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-21 23:56 ` Dmitry Gutov
2022-02-22 15:19 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-23 2:21 ` Dmitry Gutov
2022-02-23 10:45 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-24 2:23 ` Dmitry Gutov
2022-02-24 13:15 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-21 23:55 ` Dmitry Gutov
2022-09-08 13:25 ` Lars Ingebrigtsen
2022-09-08 13:34 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-08 13:39 ` Lars Ingebrigtsen
2022-09-08 15:50 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 9:08 ` Stefan Kangas
2023-09-03 10:03 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 10:46 ` Stefan Kangas
2023-09-13 11:10 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 13:42 ` Stefan Kangas
2023-09-13 15:23 ` Dmitry Gutov
2023-09-13 17:01 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 23:59 ` Dmitry Gutov
2023-09-14 6:10 ` Eli Zaretskii
2023-09-15 18:45 ` Tassilo Horn
2023-09-16 5:53 ` Ikumi Keita
2023-09-17 8:49 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22 13:06 ` Arash Esbati
2024-04-22 14:56 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22 16:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22 16:37 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22 17:16 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22 17:25 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-24 0:09 ` Dmitry Gutov
2024-04-24 9:02 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-23 12:04 ` Arash Esbati
2024-04-23 13:21 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 14:15 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-02 0:43 ` Dmitry Gutov
2024-05-02 13:32 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-03 13:42 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-07 2:27 ` Dmitry Gutov
2024-05-09 3:00 ` Dmitry Gutov
2024-05-09 6:38 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-09 10:49 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-13 20:54 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-14 21:24 ` Dmitry Gutov
2024-05-16 18:18 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-20 0:21 ` Dmitry Gutov
2024-05-20 2:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-25 7:57 ` Eli Zaretskii
2024-06-05 9:46 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-08 12:38 ` Eli Zaretskii
2024-06-08 20:54 ` Dmitry Gutov
2024-06-09 11:10 ` Stefan Kangas
2024-06-09 11:36 ` Stefan Kangas [this message]
2024-06-09 18:42 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-09 18:45 ` Dmitry Gutov
2024-06-09 21:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-09 22:13 ` Dmitry Gutov
2024-06-10 13:29 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-27 15:39 ` Arash Esbati
2024-07-28 23:57 ` Dmitry Gutov
2024-07-29 10:31 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 13:43 ` Stefan Kangas
2024-09-14 14:06 ` Eli Zaretskii
2024-09-14 15:02 ` Dmitry Gutov
2024-09-14 15:08 ` Stefan Kangas
2024-09-14 15:28 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-25 23:01 ` Dmitry Gutov
2024-05-07 2:06 ` Dmitry Gutov
2024-05-02 6:47 ` Arash Esbati
2024-05-02 13:34 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-03 14:10 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-04 8:26 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-04 14:32 ` Arash Esbati
2024-05-04 14:54 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-04 21:15 ` Arash Esbati
2024-05-07 13:15 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-15 15:47 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-16 7:53 ` Arash Esbati
2024-05-16 12:56 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-14 16:11 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-14 23:55 ` Dmitry Gutov
2023-09-15 6:47 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 19:16 ` Eli Zaretskii
2023-09-13 20:25 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-14 5:14 ` Eli Zaretskii
2022-02-21 12:35 ` Arash Esbati
2022-02-21 14:03 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-25 20:16 ` Augusto Stoffel
2022-02-26 9:29 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-26 10:56 ` Augusto Stoffel
2022-02-27 18:42 ` Arash Esbati
2022-02-28 9:09 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-28 11:54 ` Arash Esbati
2022-02-28 13:11 ` Augusto Stoffel
2022-02-28 19:04 ` Arash Esbati
2022-03-01 8:46 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-28 13:05 ` Augusto Stoffel
2024-09-14 17:26 ` Mattias Engdegård
2024-09-16 8:33 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-16 13:30 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-21 2:07 ` Stefan Kangas
2024-09-21 16:44 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-17 12:35 ` Mattias Engdegård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADwFkmkY_gRVR=x-N=9Jb-1jt-y_598BfvG4PQD5g18vZhH+7A@mail.gmail.com' \
--to=stefankangas@gmail.com \
--cc=53749@debbugs.gnu.org \
--cc=arash@gnu.org \
--cc=dfussner@googlemail.com \
--cc=dgutov@yandex.ru \
--cc=eliz@gnu.org \
--cc=ikumi@ikumi.que.jp \
--cc=monnier@iro.umontreal.ca \
--cc=tsdh@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.