[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scope environment in TikZ
From: |
Arash Esbati |
Subject: |
Re: scope environment in TikZ |
Date: |
Wed, 16 Nov 2022 12:37:52 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 |
Hi Keita,
Ikumi Keita <ikumi@ikumi.que.jp> writes:
> The largest obstacle is that TikZ option is quite complicated. :-(
> [...]
>
> Thus the standard key-value completion facility of AUCTeX isn't enough
> in my view to provide satisfactory support for TikZ options.
I agree, TikZ options are indeed too heavy for AUCTeX.
> I hope LSP servers can provide practical support for TikZ.
Give digestif[1] a roll; installation is really straight forward. And if
you have eglot, starting it should work OOTB.
> 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?
Best, Arash
Footnotes:
[1] https://github.com/astoff/digestif
- scope environment in TikZ, Ikumi Keita, 2022/11/10
- Re: scope environment in TikZ, Arash Esbati, 2022/11/10
- Re: scope environment in TikZ, Ikumi Keita, 2022/11/11
- Re: scope environment in TikZ, Ikumi Keita, 2022/11/14
- Re: scope environment in TikZ, Arash Esbati, 2022/11/15
- Re: scope environment in TikZ, Ikumi Keita, 2022/11/16
- Re: scope environment in TikZ,
Arash Esbati <=
- Re: scope environment in TikZ, Ikumi Keita, 2022/11/17
- Re: scope environment in TikZ, Arash Esbati, 2022/11/17
- Re: scope environment in TikZ, Ikumi Keita, 2022/11/18
- Re: scope environment in TikZ, Arash Esbati, 2022/11/18
- Re: scope environment in TikZ, Ikumi Keita, 2022/11/21
- Re: scope environment in TikZ, Arash Esbati, 2022/11/21
- Re: scope environment in TikZ, Ikumi Keita, 2022/11/21