GNU bug report logs - #58005
13.1.4; Can't work with indirect buffers

Previous Next

Package: auctex;

Reported by: "Philipp G. Haselwarter" <philipp <at> haselwarter.org>

Date: Thu, 22 Sep 2022 14:40:02 UTC

Severity: normal

Tags: wontfix

Found in version 13.1.4

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Vangelis Evangelou <evangelou <at> gmail.com>
Cc: philipp <at> haselwarter.org, 58005 <at> debbugs.gnu.org
Subject: bug#58005: 13.1.4; Can't work with indirect buffers
Date: Mon, 15 Apr 2024 00:01:32 +0900
Hi Vangelis,

>>>>> Vangelis Evangelou <evangelou <at> gmail.com> writes:
> I am using indirect buffers with auctex and I am affected by this. My use
> is to have an indirect buffer narrowed to the preamble of my file.
> Typically, if I want to define a new command, I switch to the narrowed
> buffer instead of jumping at the top of the buffer to type the command and
> then go back to where I was later. I implemented a patch (attached) where,
> essentially, I replace instances of `buffer-file-name' with a new function
> `TeX-buffer-file-name' defined as

> (defun TeX-buffer-file-name (&optional BUFFER)
>   (buffer-file-name (or (buffer-base-buffer BUFFER) BUFFER)))

Thank you for your proposal. I'd like to comment on it. Please bear with
me if I'm saying something stupid since I don't know indirect buffer well.

Current AUCTeX source has some references to the variable
`buffer-file-name', as well as call to the function of the same name. It
seems that the variable is nil in indirect buffers. Is it safe to leave
those references unchanged?

> I also added a condition in TeX-master-file to check for indirect
> buffer.

The major portion of the addition is
        (cond
[...]
         ;; Indirect buffer
         (my-buffer
          (with-current-buffer my-buffer
            (TeX-master-file nil nondirectory ask)))
                             ^^^
. Why is the first argument always nil? The original function receives
the second argument as `extension'. Aren't there cases that we should
provide the same argument `extension' here?

There are still some calls to the function `buffer-file-name' which
weren't replaced by `TeX-buffer-file-name' in the source. You can see
them with
git grep -E "[^-]buffer-file-name"
on the repo directory. (This lists references to the variable
`buffer-file-name' as well.)

It seems that the proposed change doesn't work in indirect buffer if
`TeX-output-dir' is specified. To try:
1. Open the following file.
2. Type C-x 4 c
3. Type C-c C-c RET
4. Then AUCTeX signals error with "LaTeX errors in ‘*~/test-tex/<none> output*’. Use C-c ` to display."
Can you resolve this problem?
----------------------------------------------------------------------
\documentclass{article}
\begin{document}

dummy

\end{document}

%%% Local Variables:
%%% mode: LaTeX
%%% TeX-master: t
%%% TeX-output-dir: "build"
%%% End:
----------------------------------------------------------------------

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




This bug report was last modified 1 year and 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.