Subject: Re: bug#65195: 13.2.1; (La)TeX-fold-math-spec-list have the wrong custom type

From: Ikumi Keita <[email-masked]>
Date: Sat, 12 Aug 2023 14:10:30 +0900

Hi Tony,

>>>>> Tony Zorman via bug-auctex via Bug reporting list for AUCTeX <[email-masked]> writes:
> Hi,
> the custom type for `(La)TeX-fold-math-spec-list' is

>   (repeat (group (choice (string :tag "Display String")
>                          (integer :tag "Number of argument" :value 1))
>                  (repeat :tag "Math Macros" (string))))

> However, the following is a perfectly valid definition

>   (setopt TeX-fold-math-spec-list
>           `((,(lambda (word) word) ("mathbf"))))

> (the code to handle functions is in `TeX-fold-hide-item').

> Currently, the `setopt' macro throws some warning, because a function is
> not part of the type (presumably this was forgotten). I propose to have
> a type closer to what `TeX-fold-macro-spec-list' has:

>   (repeat (group (choice (string :tag "Display String")
>                          (integer :tag "Number of argument" :value 1)
>                          (function :tag "Function to execute"))
>                  (repeat :tag "Math Macros" (string))))

> The relevant functions called, like `TeX-fold-make-overlay' would also
> have to have their documentation adjusted.

Thanks for your report, I think it is actually a bug. I pushed the fix
to the git repo according to your proposal.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine