[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#35140: 12.1; Scan errors in doctex mode with ^^A-comments after brac
From: |
Ikumi Keita |
Subject: |
bug#35140: 12.1; Scan errors in doctex mode with ^^A-comments after braces |
Date: |
Wed, 02 Mar 2022 23:47:56 +0900 |
Hello Stefan, thanks for your response.
>>>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> In which operation does the "fails scanning for balanced {...} pairs"
> happen?
That's described in the example file test.dtx provided in the original
post by Markus; double-clicking by mouse:
--- test.dtx ---
% \begin{macro}{\test}^^A This is an official dtx-comment
% This does not work. Try to double-click to the closing brace before the
% comment and you will get: |Scan error: "Unbalanced parantheses", 22, 22|
% \end{macro}
%
% \begin{macro}{\test}%^^A This is a workaround for an official dtx-comment
% This does work, but the \% after the closing brace is not wanted.
% \end{macro}
% \endinput
% Local Variables:
% mode: doctex
% TeX-master: t
% End:
--- end of file ---
> I'm not sufficiently informed about DocTeX to know what's the right
> thing to do here. Changing the code so it only changes the face but
> without messing with syntax tables would definitely be simpler.
Agreed.
> But one thing catches my attention. If having the `}` marked as an
> end-of-comment "fails scanning for balanced {...} pairs" with the
> current setup, wouldn't the same kind of problem appear with
> # \begin{macro}^^A Funny, eh? (
> if the `^^A.*` part isn't marked in the syntax as separate?
I'm not sure I understand what you are worring about. Could you
ellaborate it?
> PS: It would be nicer if AUCTeX could just use the tex-mode.el code
> rather the copy&paste it.
I think that we can do that for `font-latex-doctex-^^A' and
`doctex-font-lock-^^A'. I guess AUCTeX needed separate function because
of compatibility for older emacsen including xemacs.
On the other hand, AUCTeX still needs its own function
`font-latex-doctex-syntactic-face-function' different from
`doctex-font-lock-syntactic-face-function' because we use different
faces for its return value.
Regards,
Ikumi Keita