[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scope environment in TikZ

From: Ikumi Keita
Subject: Re: scope environment in TikZ
Date: Fri, 18 Nov 2022 14:24:32 +0900

>>>>> Arash Esbati <> 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?


Ikumi Keita
#StandWithUkraine #StopWarInUkraine

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'.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]