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