[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: Thu, 17 Nov 2022 17:55:18 +0900

>>>>> Arash Esbati <> writes:
> Give digestif[1] a roll; installation is really straight forward.  And if
> you have eglot, starting it should work OOTB.

I've already tried it before; it provided basic support for TikZ
options. I hope it provides more advanced support as well :-)

>> Ah, I see. You are talking about a separate topic of moving the point
>> inside the empty "[]". Doesn't the suggested change break
>> compatibility?

> Not that I'm aware of.  With the current implementation:

> (defun LaTeX--env-parse-args (args)
>   "Helper function to insert arguments defined by ARGS."
>   (save-excursion
>     (LaTeX-find-matching-begin)
>     (end-of-line)
>     (let ((TeX-exit-mark (or TeX-exit-mark
>                              (make-marker))))
>       (TeX-parse-arguments args))))

> You can set `TeX-exit-mark' inside args which is parsed by
> `TeX-parse-arguments', but it doesn't work since the code for moving to
> that point is only available in `TeX-parse-macro' and not in
> `LaTeX--env-parse-args'.  Further, `save-excursion' would nullify a
> point movement anyway.

> Hence my suggestion which respects `TeX-exit-mark'; either set by a
> function in `args' or the value returned by `point-marker'.

> (defun LaTeX--env-parse-args (args)
>   "Helper function to insert arguments defined by ARGS."
>   (let ((TeX-exit-mark (or TeX-exit-mark
>                            (point-marker))))
>     (TeX-parse-arguments args)
>     (goto-char (marker-position TeX-exit-mark))
>     (set-marker TeX-exit-mark nil)))

> Where do you expect a potential breakage?  Maybe I'm missing something?

If I understand correctly, it would move the point inside "{}" after C-c
C-e when the user gave empty answer for argument query for environments
like this:
     '("foo" LaTeX-env-args t)
If the user intentionally keep there empty, that behavior wouldn't be
what the user wants.

(But maybe I'm too skeptical and there is no environment which applies
this worry.)

Ikumi Keita
#StandWithUkraine #StopWarInUkraine

reply via email to

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