Hi Arash, >>>>> Arash Esbati <[email protected]> writes: > I wonder if this change is sufficient to fix the issue and doesn't have > other side effects:
> (defun LaTeX-env-args (environment &rest args) > "Insert ENVIRONMENT and arguments defined by ARGS." > (let ((LaTeX-current-environment environment) > (LaTeX-indent-environment-check nil)) ; <-- ADDED > (LaTeX-insert-environment environment) > (LaTeX--env-parse-args args))) It seems that it doesn't in the range I tried, but I don't agree with that idea so much. In my opinion, let-binding of `LaTeX-current-environment' should be restricted to rather low level functions where it is absolutely evident that it doesn't have bad side effects. Doing in general-purpose functions like `LaTeX-env-args' can lead to a mysterious behavior which is hard to debug for future developers. If you still want to stay with that idea, how about moving the let-binding into `LaTeX--env-parse-args'? Then we can avoid unintended interaction of `LaTeX-current-environment' and `LaTeX-insert-environment', and simplify `LaTeX-env-item-args' and `LaTeX-env-label-args' at the same time. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine
