GNU bug report logs -
#78586
TeX-make-inline
Previous Next
Full log
Message #41 received at 78586 <at> debbugs.gnu.org (full text, mbox):
[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 4 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.