>>>>> Arash Esbati <[email protected]> writes:
> My suggestion is actually this (I copied a wrong version in my last
> message :-():
> (defun LaTeX--env-parse-args (args)
> "Helper function to insert arguments defined by ARGS."
> (let ((TeX-exit-mark (or TeX-exit-mark
> (point-marker))))
> (LaTeX-find-matching-begin)
> (end-of-line)
> (TeX-parse-arguments args)
> (goto-char (marker-position TeX-exit-mark))
> (set-marker TeX-exit-mark nil)))
> In your example above, the point will be indeed inside "{}" after 'C-c
> C-e' with no query at all. Compare these examples:
> (LaTeX-add-environments
> '("foo" LaTeX-env-args t)
> '("bar" LaTeX-env-args nil)
> '("baz" LaTeX-env-args "Title"))
Sorry, my example didn't make sense. There t should have been some
string literal such as "Title".
> C-c C-e baz RET gives:
> \begin{baz}{}
> *
> \end{baz}
Ah, this is it. Now I see it works very well.
> For me, t behaves as described in the manual "Insert empty braces, leave
> point between the braces.". Does the above make sense?
Certainly.
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
P.S.
By the way, you can do
(goto-char TeX-exit-mark)
instead of
(goto-char (marker-position TeX-exit-mark))
in the new `LaTeX--env-parse-args'.