[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allowing closure's in style hooks?
From: |
Arash Esbati |
Subject: |
Re: Allowing closure's in style hooks? |
Date: |
Thu, 17 Nov 2022 14:41:12 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 |
Hi Tassilo,
Tassilo Horn <tsdh@gnu.org> writes:
> Arash Esbati <arash@gnu.org> writes:
>
>> With this, we can use things like this:
>>
>> (TeX-add-symbols
>> `("foo" ,(lambda (_) ...)))
>>
>> in our styles. We're already using this in `TeX-read-key-val' et al.,
>> so why not also anywhere else? This could help us getting rid of more
>> `TeX-arg-eval' constructs.
>
> Yes, please.
Done, commit c8d638ac9d.
>> Any comments welcome.
>
> You can omit the symbolp check or rather replace it with functionp. If
> a symbol has a symbol-function, then (functionp symbol) will return t.
True, thanks!
> But be sure to have a t-case in the cond which signals an error when no
> other clause applies.
The change is inside `TeX-parse-argument' which has this at the end:
(t (error "Unknown argument type %s" (prin1-to-string arg)))
So we're good :-)
Best, Arash