[ESS] How can one tell rlang not to mess up R session in ESS ?

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue Nov 14 17:32:44 CET 2023


On 13 November 2023 at 18:54, Lionel Henry wrote:
| > Do you use this instead of the nord theme, or on top of the nord
| > theme?  Can you (briefly) describe what it does / what you like about
| > this addition?
| 
| I use it on top. This snippet comes in between loading and activation:
| 
| ```
| (require 'nord-theme)
| (load-theme 'nord)
| 
| *snippet*
| 
| (enable-theme 'nord)
| ```

That is good!  I noticed for a while that loading nord interfered with
starting in daemon mode so I dialed things down a little / conditioned on
interactive or some other trick (I am still a complete Elisp noob).

| I have a bunch of other stuff defined in there, like:
| 
| ```
| (custom-theme-set-faces
|  'nord
|  `(tab-bar ((t (:background ,nord1 :height 1.0))))
|  `(tab-bar-tab ((t (:foreground ,nord6 :background ,nord9 :box
| (:line-width (4 . 2) :style flat-button)))))
|  `(tab-bar-tab-inactive ((t (:foreground ,nord9 :background ,nord3
| :box (:line-width (4 . 2) :style flat-button))))))
| ```
| 
| This might not be the best way of doing this, but it's been some years
| since I added this and it still works.
| 
| Let me know if you're still having trouble with cli theming in ESS
| (and you want it to work instead of disabling it). It might be worth
| discussing in an issue on Github in that case.

Haven't restarted yet but I resorted for the blunt-but-likely-effective

    ## No color from cli inside emacs
    ## https://cli.r-lib.org/reference/faq.html#how-do-i-turn-off-ansi-colors-and-styles-
    if (Sys.getenv("INSIDE_EMACS") != "")
        Sys.setenv(NO_COLOR="TRUE")

See next message. Part of me still thinks rlang and cli do this wrong by
ignoring available env vars.

Thanks for the help,  Dirk
 
| Best,
| Lionel
| 
| 
| On 11/13/23, Dirk Eddelbuettel <edd using debian.org> wrote:
| >
| > Thanks Lionel. I was pretty sure I could count on a non-empty intersection
| > between ESS and rlang...
| >
| > On 13 November 2023 at 17:20, Lionel Henry wrote:
| > | See the cli website for disabling colours:
| > |
| > https://cli.r-lib.org/reference/faq.html#how-do-i-turn-off-ansi-colors-and-styles-
| >
| > Drats. I though of crayon but not cli. I still get lost in your endlessly
| > twisted maze of package. One day.
| >
| > | I use nord-theme too and I see I have this in my config, in case that
| > helps
| > | (I trimmed down this snippet manually, there might be a typo):
| > |
| > | ```lisp
| > | (let ((class '((class color) (min-colors 89)))
| > |       (nord0 (if (nord-display-truecolor-or-graphic-p) "#2E3440" nil))
| > |       (nord1 (if (nord-display-truecolor-or-graphic-p) "#3B4252"
| > "black"))
| > |       (nord2 (if (nord-display-truecolor-or-graphic-p) "#434C5E"
| > "#434C5E"))
| > |       (nord3 (if (nord-display-truecolor-or-graphic-p) "#4C566A"
| > "brightblack"))
| > |       (nord4 (if (nord-display-truecolor-or-graphic-p) "#D8DEE9"
| > "#D8DEE9"))
| > |       (nord5 (if (nord-display-truecolor-or-graphic-p) "#E5E9F0"
| > "white"))
| > |       (nord6 (if (nord-display-truecolor-or-graphic-p) "#ECEFF4"
| > "brightwhite"))
| > |       (nord7 (if (nord-display-truecolor-or-graphic-p) "#8FBCBB" "cyan"))
| > |       (nord8 (if (nord-display-truecolor-or-graphic-p) "#88C0D0"
| > "brightcyan"))
| > |       (nord9 (if (nord-display-truecolor-or-graphic-p) "#81A1C1" "blue"))
| > |       (nord10 (if (nord-display-truecolor-or-graphic-p) "#5E81AC"
| > "brightblue"))
| > |       (nord11 (if (nord-display-truecolor-or-graphic-p) "#BF616A" "red"))
| > |       (nord12 (if (nord-display-truecolor-or-graphic-p) "#D08770"
| > | "brightyellow"))
| > |       (nord13 (if (nord-display-truecolor-or-graphic-p) "#EBCB8B"
| > "yellow"))
| > |       (nord14 (if (nord-display-truecolor-or-graphic-p) "#A3BE8C"
| > "green"))
| > |       (nord15 (if (nord-display-truecolor-or-graphic-p) "#B48EAD"
| > "magenta")))
| > |   (let ((ansi-colours (vector nord1     ; black
| > |                               nord11    ; red
| > |                               nord14    ; green
| > |                               nord13    ; yellow
| > |                               nord8     ; blue
| > |                               nord15    ; magenta
| > |                               nord7     ; cyan
| > |                               nord5     ; white
| > |                               )))
| > |     (setq xterm-color-names ansi-colours)
| > |     (custom-theme-set-variables
| > |      'nord
| > |      `(ansi-color-names-vector ,ansi-colours))))
| > | ```
| >
| > Great, will play later.  Do you use this instead of the nord theme, or on
| > top
| > of the nord theme?  Can you (briefly) describe what it does / what you like
| > about this addition?
| >
| > Thanks,  Dirk
| >
| > | Best,
| > | Lionel
| > |
| > |
| > | On 11/13/23, Dirk Eddelbuettel via ESS-help <ess-help using r-project.org>
| > wrote:
| > | >
| > | > Casual searching at the rlang repo doesn't reveal anything so pardon me
| > for
| > | > asking here but what is a simple way to tell rlang to NOT do fancy
| > pants
| > | > color error backtraces?  At least under the theme I use ("nord", for
| > Emacs)
| > | > it basically nixes readability by leaving a 'dark on dark' default.
| > | >
| > | > Thanks in advance for any pointers.
| > | >
| > | > Dirk
| > | >
| > | > --
| > | > dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
| > | >
| > | > ______________________________________________
| > | > ESS-help using r-project.org mailing list
| > | > https://stat.ethz.ch/mailman/listinfo/ess-help
| > | >
| >
| > --
| > dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
| >

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the ESS-help mailing list