Hi Keita, Ikumi Keita <[email protected]> writes:
> Ah, it's the same as > https://tex.stackexchange.com/questions/578900/auctex-math-mode-started-with-cannot-be-closed-with-dollar-in-cases > ... > As written there, temporal workaround is to type C-u $ or C-q $ to > insert "$" in such a case. Ah, thanks for reminding me. The question sounded familiar to me :-) >>>>>> Arash Esbati <[email protected]> writes: >> I think this a corner case where half of a environment is math and the >> other half text. AUCTeX thinks that the entire environment is math and >> hence throws an error. I don't have a strong opinion about this, we can >> add some entries like this to `texmathp-tex-commands-default': > >> ("cases*" env-off) >> ("dcases*" env-off) >> ("rcases*" env-off) >> ("drcases*" env-off) > >> What do others think? > > In my opinion, `TeX-insert-dollar' is too patriarchal in this case. The > intention of `texmathp' is apparently to be "practical enough", not > "precise". It sometimes by design gives false positives and false > negatives, which we should anticipate. > > How about to allow insertion of "$" (or anything according to > `TeX-electric-math') when `last-command' is `TeX-insert-dollar' in a > case like this issue? I suppose that most users would type "$" again > before seeing "Math mode started with `...' cannot be closed with > dollar" when "$" is refused unexpectedly. You mean in case a user says: "Dammit AUCTeX, I know what I'm doing, insert what I type!" Checking `last-command' might be a solution, but is it worth to introduce it where 'C-q <char>' is already available? Now one could argue that " does the same in terms of insert `` first and upon second invocation replace that with ", but I'm not sure $ should do the same. But I don't have a strong opinion on this, if you think we should change this, please go ahead :-) Regardless of this, I think adding the cases entries above to `texmathp-tex-commands-default' would make sense and cures the issue at hand. WDYT? Best, Arash _______________________________________________ bug-auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-auctex
