Skip to content

Commit 0eb240b

Browse files
lionel-mmaechler
authored andcommitted
Set background-mode envvar on process startup
1 parent fcfc36b commit 0eb240b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lisp/ess-inf.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,11 @@ process-less buffer because it was created with
605605
(nconc
606606
(list "STATATERM=emacs"
607607
(format "PAGER=%s" inferior-ess-pager))
608+
;; This lets R code know whether Emacs was running with a
609+
;; light or dark background at startup time
610+
(let ((bg-mode (frame-parameter nil 'background-mode)))
611+
(when (memq bg-mode '(light dark))
612+
(list (format "ESS_BACKGROUND_MODE=%s" (symbol-name bg-mode)))))
608613
process-environment))
609614
(tramp-remote-process-environment
610615
(nconc ;; it contains a pager already, so append

0 commit comments

Comments
 (0)