[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Working with colors in --batch mode
From: |
Kévin Le Gouguec |
Subject: |
Re: Working with colors in --batch mode |
Date: |
Sun, 25 Dec 2022 19:49:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Sun, 25 Dec 2022 20:05:59 +0200
>> From: Eli Zaretskii <eliz@gnu.org>
>>
>> Emacs doesn't (and cannot, I think) load X colors unless it
>> initializes the X display, and that doesn't happen in batch sessions.
>> Basically, batch sessions behave like a colorless TTY session.
>
> Btw, I don't really understand why you need the X machinery for this.
> Doesn't tty-color-standard-values do the job?
>
> $ emacs -batch --eval "(message \"%s\" (tty-color-standard-values
> \"#abcdef\"))"
> => (43947 52685 61423)
Because this message is the latest step in a longer journey that started
with me trying to call modus-themes-contrast in batch mode, as hinted in
the OP.
So I hope to find a solution that will let me keep calling this
high-level function, instead of re-implementing it and its callees
(e.g. color-name-to-rgb).
Thanks for weighing in; it's not obvious to me yet that there's no way
to ask emacs --batch to --eval its way into initializing the X display,
but I may well end up reaching that conclusion after more digging.