Skip to main content
added 248 characters in body
Source Link

You cannot do this using different themes. The solution is to create a theme that has different face definitions depending on the terminal. If you look at an example like font-lock-comment-face, you'll see how it works. Instead of specifying ((class color) (min-colors 88) (background dark)) you could also specifcy (type tty) or (type graphic)etc etc. The manual has more info.

(defface font-lock-comment-face
  '((((class grayscale) (background light))
 :foreground "DimGray" :weight bold :slant italic)
(((class grayscale) (background dark))
 :foreground "LightGray" :weight bold :slant italic)
(((class color) (min-colors 88) (background light))
 :foreground "Firebrick")
(((class color) (min-colors 88) (background dark))
 :foreground "chocolate1")
(((class color) (min-colors 16) (background light))
 :foreground "red")
(((class color) (min-colors 16) (background dark))
 :foreground "red1")
(((class color) (min-colors 8) (background light))
 :foreground "red")
(((class color) (min-colors 8) (background dark))
 :foreground "yellow")
(t :weight bold :slant italic))
  "Font Lock mode face used to highlight comments."
  :group 'font-lock-faces)

I guess you could write a function that takes two themes and produces a merged theme, with faces from one theme being assigned (type tty) and faces from the other theme being assigned (type graphic) where both of the original themes use t.

You cannot do this using different themes. The solution is to create a theme that has different face definitions depending on the terminal. If you look at an example like font-lock-comment-face, you'll see how it works. Instead of specifying ((class color) (min-colors 88) (background dark)) you could also specifcy (type tty) or (type graphic)etc. The manual has more info.

(defface font-lock-comment-face
  '((((class grayscale) (background light))
 :foreground "DimGray" :weight bold :slant italic)
(((class grayscale) (background dark))
 :foreground "LightGray" :weight bold :slant italic)
(((class color) (min-colors 88) (background light))
 :foreground "Firebrick")
(((class color) (min-colors 88) (background dark))
 :foreground "chocolate1")
(((class color) (min-colors 16) (background light))
 :foreground "red")
(((class color) (min-colors 16) (background dark))
 :foreground "red1")
(((class color) (min-colors 8) (background light))
 :foreground "red")
(((class color) (min-colors 8) (background dark))
 :foreground "yellow")
(t :weight bold :slant italic))
  "Font Lock mode face used to highlight comments."
  :group 'font-lock-faces)

You cannot do this using different themes. The solution is to create a theme that has different face definitions depending on the terminal. If you look at an example like font-lock-comment-face, you'll see how it works. Instead of specifying ((class color) (min-colors 88) (background dark)) you could also specifcy (type tty) or (type graphic) etc. The manual has more info.

(defface font-lock-comment-face
  '((((class grayscale) (background light))
 :foreground "DimGray" :weight bold :slant italic)
(((class grayscale) (background dark))
 :foreground "LightGray" :weight bold :slant italic)
(((class color) (min-colors 88) (background light))
 :foreground "Firebrick")
(((class color) (min-colors 88) (background dark))
 :foreground "chocolate1")
(((class color) (min-colors 16) (background light))
 :foreground "red")
(((class color) (min-colors 16) (background dark))
 :foreground "red1")
(((class color) (min-colors 8) (background light))
 :foreground "red")
(((class color) (min-colors 8) (background dark))
 :foreground "yellow")
(t :weight bold :slant italic))
  "Font Lock mode face used to highlight comments."
  :group 'font-lock-faces)

I guess you could write a function that takes two themes and produces a merged theme, with faces from one theme being assigned (type tty) and faces from the other theme being assigned (type graphic) where both of the original themes use t.

Source Link

You cannot do this using different themes. The solution is to create a theme that has different face definitions depending on the terminal. If you look at an example like font-lock-comment-face, you'll see how it works. Instead of specifying ((class color) (min-colors 88) (background dark)) you could also specifcy (type tty) or (type graphic)etc. The manual has more info.

(defface font-lock-comment-face
  '((((class grayscale) (background light))
 :foreground "DimGray" :weight bold :slant italic)
(((class grayscale) (background dark))
 :foreground "LightGray" :weight bold :slant italic)
(((class color) (min-colors 88) (background light))
 :foreground "Firebrick")
(((class color) (min-colors 88) (background dark))
 :foreground "chocolate1")
(((class color) (min-colors 16) (background light))
 :foreground "red")
(((class color) (min-colors 16) (background dark))
 :foreground "red1")
(((class color) (min-colors 8) (background light))
 :foreground "red")
(((class color) (min-colors 8) (background dark))
 :foreground "yellow")
(t :weight bold :slant italic))
  "Font Lock mode face used to highlight comments."
  :group 'font-lock-faces)