GNU bug report logs -
#71376
14.0.5; find-file-at-point doesn't work in LaTeX-mode
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71376 in the body.
You can then email your comments to 71376 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-auctex <at> gnu.org
:
bug#71376
; Package
auctex
.
(Wed, 05 Jun 2024 09:06:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Бабушкин Максим Владимирович <maxbabushkin <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-auctex <at> gnu.org
.
(Wed, 05 Jun 2024 09:06:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
Emacs has a built-in function 'find-file-at-point' (or 'ffap'), which works
great with the standard latex-mode. For example, putting cursor on the
argument of the command
\input{~/Downloads/myfile.tex}
and calling 'M-x find-file-at-point' causes visiting the file under the
cursor. It works similarly with the \usepackage command.
The AUCTeX package comes with LaTeX-mode which does not support this
functionality. But it seems that the older versions of AUCTeX did.
As a workaround I put these lines in my .emacs
(eval-after-load "ffap"
'(progn
(add-to-list 'ffap-alist '(LaTeX-mode . ffap-latex-mode)) ; same as
for latex-mode
(add-to-list 'ffap-string-at-point-mode-alist '(LaTeX-mode
"--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")) ; same as for latex-mode
)
)
Emacs : GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.41, cairo version 1.18.0)
Package: 14.0.5
--
Maksim Babushkin
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#71376
; Package
auctex
.
(Wed, 05 Jun 2024 11:49:03 GMT)
Full text and
rfc822 format available.
Message #8 received at 71376 <at> debbugs.gnu.org (full text, mbox):
Бабушкин Максим Владимирович <maxbabushkin <at> gmail.com> writes:
> Emacs has a built-in function 'find-file-at-point' (or 'ffap'), which
> works great with the standard latex-mode. For example, putting cursor
> on the argument of the command
> \input{~/Downloads/myfile.tex}
> and calling 'M-x find-file-at-point' causes visiting the file under
> the cursor. It works similarly with the \usepackage command.
>
> The AUCTeX package comes with LaTeX-mode which does not support this
> functionality. But it seems that the older versions of AUCTeX did.
Thanks for raising this issue. I don't use `ffap', but the issue is
that AUCTeX has changed the mode names. Following your code, the
following change should fix the issue, right? Can you give it a try? I
can propose it for Emacs.
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/ffap.el b/lisp/ffap.el
index b2b681b7c44..f6d663a778b 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -753,6 +753,8 @@ ffap-alist
("\\.[fF]\\'" . ffap-fortran-mode)
(tex-mode . ffap-tex-mode) ; search ffap-tex-path
(latex-mode . ffap-latex-mode) ; similar
+ (TeX-mode . ffap-tex-mode) ; AUCTeX v14 counterpart
+ (LaTeX-mode . ffap-latex-mode) ; ditto
("\\.\\(tex\\|sty\\|doc\\|cls\\)\\'" . ffap-tex)
("\\.bib\\'" . ffap-bib) ; search ffap-bib-path
("\\`\\." . ffap-home) ; .emacs, .bashrc, .profile
@@ -1065,6 +1067,9 @@ ffap-string-at-point-mode-alist
;; (La)TeX: don't allow braces
(latex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
(tex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+ ;; AUCTeX v14 counterparts:
+ (LaTeX-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+ (TeX-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
;; XML: don't allow angle brackets
(xml-mode "--:\\\\${}+@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}")
(nxml-mode "--:\\\\${}+@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}")
--8<---------------cut here---------------end--------------->8---
Best, Arash
bug reassigned from package 'auctex' to 'emacs'.
Request was from
Arash Esbati <arash <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 05 Jun 2024 19:31:02 GMT)
Full text and
rfc822 format available.
bug No longer marked as found in versions 14.0.5.
Request was from
Arash Esbati <arash <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 05 Jun 2024 19:31:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Wed, 05 Jun 2024 19:43:02 GMT)
Full text and
rfc822 format available.
Message #15 received at 71376 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Бабушкин Максим Владимирович <maxbabushkin <at> gmail.com> writes:
> Arash,
>
> Your patch fixes the issue. Thank you!
Thanks for testing.
@Emacs maintainers: Please find attached a fix for ffap.el tracking the
new major-mode names introduced in AUCTeX v14. Any comments welcome.
Best, Arash
[0001-Recognize-new-mode-names-provided-by-AUCTeX.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Thu, 06 Jun 2024 05:34:01 GMT)
Full text and
rfc822 format available.
Message #18 received at 71376 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
>>>>> Arash Esbati <arash <at> gnu.org> writes:
> Thanks for raising this issue. I don't use `ffap', but the issue is
> that AUCTeX has changed the mode names. Following your code, the
> following change should fix the issue, right? Can you give it a try? I
> can propose it for Emacs.
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/ffap.el b/lisp/ffap.el
> index b2b681b7c44..f6d663a778b 100644
> --- a/lisp/ffap.el
> +++ b/lisp/ffap.el
> @@ -753,6 +753,8 @@ ffap-alist
> ("\\.[fF]\\'" . ffap-fortran-mode)
> (tex-mode . ffap-tex-mode) ; search ffap-tex-path
> (latex-mode . ffap-latex-mode) ; similar
> + (TeX-mode . ffap-tex-mode) ; AUCTeX v14 counterpart
> + (LaTeX-mode . ffap-latex-mode) ; ditto
> ("\\.\\(tex\\|sty\\|doc\\|cls\\)\\'" . ffap-tex)
> ("\\.bib\\'" . ffap-bib) ; search ffap-bib-path
> ("\\`\\." . ffap-home) ; .emacs, .bashrc, .profile
> @@ -1065,6 +1067,9 @@ ffap-string-at-point-mode-alist
> ;; (La)TeX: don't allow braces
> (latex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
> (tex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
> + ;; AUCTeX v14 counterparts:
> + (LaTeX-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
> + (TeX-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
> ;; XML: don't allow angle brackets
> (xml-mode "--:\\\\${}+@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}")
> (nxml-mode "--:\\\\${}+@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}")
> --8<---------------cut here---------------end--------------->8---
It seems dubious to include `TeX-mode' here because it is used for only
a parent of other AUCTeX major modes and isn't meant for a major mode of
an actual buffer. Unless the user explicitly does M-x TeX-mode, no
buffers would be in `TeX-mode'.
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Thu, 06 Jun 2024 06:56:03 GMT)
Full text and
rfc822 format available.
Message #21 received at 71376 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Keita,
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> It seems dubious to include `TeX-mode' here because it is used for only
> a parent of other AUCTeX major modes and isn't meant for a major mode of
> an actual buffer. Unless the user explicitly does M-x TeX-mode, no
> buffers would be in `TeX-mode'.
Yes, my fault, thanks for catching this. Next try is attached.
Best, Arash
[0001-Recognize-new-mode-names-provided-by-AUCTeX.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Thu, 06 Jun 2024 15:24:02 GMT)
Full text and
rfc822 format available.
Message #24 received at 71376 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
>>>>> Arash Esbati <arash <at> gnu.org> writes:
>> It seems dubious to include `TeX-mode' here because it is used for only
>> a parent of other AUCTeX major modes and isn't meant for a major mode of
>> an actual buffer. Unless the user explicitly does M-x TeX-mode, no
>> buffers would be in `TeX-mode'.
> Yes, my fault, thanks for catching this. Next try is attached.
It looks good to me with respect to AUCTeX. (If we are looking after
built-in TeX modes as well, entries for `plain-tex-mode' should also
be included, maybe.)
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Thu, 06 Jun 2024 17:20:02 GMT)
Full text and
rfc822 format available.
Message #27 received at 71376 <at> debbugs.gnu.org (full text, mbox):
Hi Keita,
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> It looks good to me with respect to AUCTeX. (If we are looking after
> built-in TeX modes as well, entries for `plain-tex-mode' should also
> be included, maybe.)
I'm not sure, I thought `tex-mode' is a bit different than AUCTeX's
`TeX-mode':
,----[ C-h f tex-mode RET ]
| tex-mode is an autoloaded interactive native-comp-function in
| ‘tex-mode.el’.
|
| (tex-mode)
|
| Major mode for editing files of input for TeX, LaTeX, or SliTeX.
| This is the shared parent mode of several submodes.
| Tries to determine (by looking at the beginning of the file) whether
| this file is for plain TeX, LaTeX, or SliTeX and calls ‘plain-tex-mode’,
| ‘latex-mode’, or ‘slitex-mode’, accordingly. If it cannot be determined,
| such as if there are no commands in the file, the value of ‘tex-default-mode’
| says which mode to use.
`----
`tex-mode' redirects to submodes via `tex--redirect-to-submode'. I
think we ask the tex-mode.el maintainer.
@Stefan: Should the entries in ffap.el for `tex-mode' be replaced by
`plain-tex-mode' as well?
Best, Arash
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Thu, 06 Jun 2024 18:06:02 GMT)
Full text and
rfc822 format available.
Message #30 received at 71376 <at> debbugs.gnu.org (full text, mbox):
> | Major mode for editing files of input for TeX, LaTeX, or SliTeX.
> | This is the shared parent mode of several submodes.
> | Tries to determine (by looking at the beginning of the file) whether
> | this file is for plain TeX, LaTeX, or SliTeX and calls ‘plain-tex-mode’,
> | ‘latex-mode’, or ‘slitex-mode’, accordingly. If it cannot be determined,
> | such as if there are no commands in the file, the value of ‘tex-default-mode’
> | says which mode to use.
> `----
>
> `tex-mode' redirects to submodes via `tex--redirect-to-submode'. I
> think we ask the tex-mode.el maintainer.
>
> @Stefan: Should the entries in ffap.el for `tex-mode' be replaced by
> `plain-tex-mode' as well?
No buffer should be in `tex-mode` (it's an "abstract" parent mode), so
AFAICT the current entry
(tex-mode . ffap-tex-mode) ; search ffap-tex-path
in `ffap-alist` is not very useful.
So unless/until `ffap.el` is changed to pay attention to the modes'
hierarchy rather than just the value of `major-mode`, we should use
things like `plain-tex-mode`.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Thu, 06 Jun 2024 20:30:02 GMT)
Full text and
rfc822 format available.
Message #33 received at 71376 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> So unless/until `ffap.el` is changed to pay attention to the modes'
> hierarchy rather than just the value of `major-mode`, we should use
> things like `plain-tex-mode`.
Thanks for the clarification. Revised patch is attached.
Best, Arash
[0001-Fix-names-of-TeX-related-major-modes.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Fri, 07 Jun 2024 06:13:02 GMT)
Full text and
rfc822 format available.
Message #36 received at 71376 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
>>>>> Arash Esbati <arash <at> gnu.org> writes:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> So unless/until `ffap.el` is changed to pay attention to the modes'
>> hierarchy rather than just the value of `major-mode`, we should use
>> things like `plain-tex-mode`.
> Thanks for the clarification. Revised patch is attached.
Now it looks good for me. ffap.el doesn't cover doctex and texinfo modes
yet, but it wouldn't count as major issue since there were no complaints
over the years.
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Fri, 07 Jun 2024 07:17:01 GMT)
Full text and
rfc822 format available.
Message #39 received at 71376 <at> debbugs.gnu.org (full text, mbox):
Hi Keita,
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> Now it looks good for me. ffap.el doesn't cover doctex and texinfo modes
> yet, but it wouldn't count as major issue since there were no complaints
> over the years.
Thanks for confirming.
@Maintainers: Can I install the change?
Best, Arash
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Fri, 07 Jun 2024 09:12:02 GMT)
Full text and
rfc822 format available.
Message #42 received at 71376 <at> debbugs.gnu.org (full text, mbox):
Arash Esbati <arash <at> gnu.org> writes:
> @Maintainers: Can I install the change?
LGTM.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71376
; Package
emacs
.
(Fri, 07 Jun 2024 11:43:02 GMT)
Full text and
rfc822 format available.
Message #45 received at 71376 <at> debbugs.gnu.org (full text, mbox):
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,
> Бабушкин Максим Владимирович
> <maxbabushkin <at> gmail.com>, 71376 <at> debbugs.gnu.org
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Fri, 7 Jun 2024 11:10:07 +0200
>
> Arash Esbati <arash <at> gnu.org> writes:
>
> > @Maintainers: Can I install the change?
>
> LGTM.
Yes, please go ahead, and close the bug after installing.
Thanks.
Reply sent
to
Arash Esbati <arash <at> gnu.org>
:
You have taken responsibility.
(Fri, 07 Jun 2024 12:03:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Бабушкин Максим Владимирович <maxbabushkin <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 07 Jun 2024 12:03:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 71376-done <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Yes, please go ahead, and close the bug after installing.
Thanks, installed, and closing.
Best, Arash
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 06 Jul 2024 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 39 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.