auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] color.el: RFC and a question
Date: Tue, 03 Feb 2015 08:42:14 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Arash Esbati <address@hidden> 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. ;-)




reply via email to

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