GNU bug report logs - #78586
TeX-make-inline

Previous Next

Package: auctex;

Reported by: "Paul D. Nelson" <ultrono <at> gmail.com>

Date: Sun, 25 May 2025 14:03:02 UTC

Severity: normal

Done: "Paul D. Nelson" <ultrono <at> gmail.com>

Full log


View this message in rfc822 format

From: "Paul D. Nelson" <ultrono <at> gmail.com>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: arash <at> gnu.org, 78586 <at> debbugs.gnu.org
Subject: bug#78586: TeX-make-inline
Date: Wed, 04 Jun 2025 12:22:19 +0200
[Message part 1 (text/plain, inline)]
Hi Ikumi,

> +        (forward-char (length open))
> +        (save-excursion (join-line))
> +        (forward-char (- (length open)))))
>
> Why do you go forth and back here? What's wrong with a bare `join-line'
> without two `forward-char's?

Suppose the buffer contains:

--8<---------------cut here---------------start------------->8---
We have
\begin{equation*}
  x + y = z.
\end{equation*}
--8<---------------cut here---------------end--------------->8---

With point on line 2, join-line yields a buffer with first line:

--8<---------------cut here---------------start------------->8---
We have \begin{equation*}
--8<---------------cut here---------------end--------------->8---

The motivation for the slightly convoluted code is that, when point is
at beginning of line, (save-excursion (join-line)) places point just
before " \begin" (rather than just before "\begin", as one might have
expected).  On the other hand, it behaves in the expected way if point
occurs later in the line (e.g., after "}").  Rather than trying to
understand exactly why join-line behaves this way (which seems like a
potentially non-robust feature that could change in the future), it
seemed simpler just to do the little dance that you see in the code.
I've added a comment to the code summarizing the above.

> We have to keep
> (setq pos nil)
> after `set-marker', which doesn't change the value of `pos' itself.

Thanks, good catch.

> As far as I can see, the proposed feature doesn't support docTeX mode. I
> don't think that is a practical problem at all, but addition of FIXME
> comment and breif mention about it in the documentation would be nice.

I'll trust you on this one -- I'm regrettably ignorant of TeX outside a
limited practical subset of LaTeX.  I've added some FIXME comments,
hopefully as intended.

There remains the question of where in the manual to document
LaTeX-modify-math and whether to illustrate it via examples like in my
earlier email.

Thanks, best,

Paul

[0001-Add-LaTeX-modify-math-and-LaTeX-make-inline.patch (text/x-patch, attachment)]

This bug report was last modified 3 days ago.

Previous Next


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