[ESS] crayon package with ESS?
kw@@t@t @end|ng |rom gm@||@com
Thu Sep 14 21:42:24 CEST 2017
The crayon package in R uses ANSI color codes sent to the terminal. The
regular color codes are 30-37. For example, 31 is red, which you can see
R> red("this is red")
 "\033[31mthis is red\033[39m"
The pillar package is using silver (really gray, but called silver to avoid
a name clash) to print place-holding zeros that are not really of
interest. But silver/gray is not part of the 8 ANSI base colors stored
in ansi-color-names-vector. Instead, silver() uses code 90, which is a
part of the high-intensity colors.
But the high-intensity colors are not supported by ansi-color.el, at least
by default. Someone has created a fix for this by extending the colors.
I have not tried this to see if it works.
On Wed, Sep 13, 2017 at 7:06 PM, Kevin Wright <kw.stat using gmail.com> wrote:
> I found a simple fix:
> After which, the following example works:
> Now to see if I can get the colored output from the pillar package...
> Sort of works. Negative numbers are red, but place-holder zeros are not
> being shown in gray.
> Kevin Wright
> On Wed, Sep 13, 2017 at 6:50 PM, Kevin Wright <kw.stat using gmail.com> wrote:
>> Has anyone successfully used the R package "crayon" for colored text
>> inside Emacs? The package claims to work with ESS:
>> Digging deeper, I find this inside my iESS buffer:
>> crayon::has_color() # returns FALSE
>> Which seems to be caused by this code in the has_color function:
>> isatty(stdout()) # returns FALSE. Why not TRUE?
>> Maybe my inferior terminal settings aren't quite right... Or maybe the
>> problem is with Windows...
>> Kevin Wright
> Kevin Wright
[[alternative HTML version deleted]]
More information about the ESS-help