Re: [AUCTeX-devel] color.el: RFC and a question

2015-02-02 Thread Tassilo Horn
Arash Esbati  writes:

Hi Arash,

>> > Besides, I don't understand why 
>> >
>> > (LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)
>> >
>> > does not work -- it confuses any `completing-read' call.
>> 
>> I don't see where `LaTeX-add-color-definecolors' is defined.  My
>> AUCTeX copy doesn't have it, and neither does your style decare it.
>
> Thanks for your response.  `LaTeX-add-color-definecolors' is definded
> after invoking `TeX-auto-add-type' with arguments (cf. tex.el, line
> 3508).  For my use case, it is this line:
>
> (TeX-auto-add-type "color-definecolor" "LaTeX")

Ah, stupid me. ;-)

So to your original question.  The generated
`LaTeX-add-color-definecolors' has the signature

  (LaTeX-add-color-definecolors &rest COLOR-DEFINECOLORS)

so it accepts zero or many color arguments (that's the meaning of
&rest).  But when you call it like

  (LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)

what it gets is one list of colors.  I.e., the call is equivalent to

  (LaTeX-add-color-definecolors (list "color1" "color2"...))

instead of

  (LaTeX-add-color-definecolors "color1" "color2"...)

which would be correct.  So what you have to do is `apply' the function
to the list of dvi colors like so:

  (apply #'LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)

Otherwise, your style looks good and a quick test drive suggests that it
works as intended.  So please integrate the change above and resubmit,
then I'll instantly commit it.

Bye,
Tassilo

PS: Wow, it seems like this is going to be your 19th style contributed
to AUCTeX!  That makes you the top-third style contributor, and you're
already close to the top two Mads and Ralf. ;-)


___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] color.el: RFC and a question

2015-02-02 Thread Arash Esbati
Tassilo Horn  gnu.org> writes:

Hi Tassilo,

> Arash Esbati  gmx.de> writes:
>
> > Besides, I don't understand why 
> >
> > (LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)
> >
> > does not work -- it confuses any `completing-read' call.
> 
> I don't see where `LaTeX-add-color-definecolors' is defined.  My AUCTeX
> copy doesn't have it, and neither does your style decare it.

Thanks for your response.  `LaTeX-add-color-definecolors' is definded after
invoking `TeX-auto-add-type' with arguments (cf. tex.el, line 3508).  For my
use case, it is this line:

(TeX-auto-add-type "color-definecolor" "LaTeX")

Best, Arash

PS: Thanks for installing my other patch.







___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel