doomemacs / themes

A megapack of themes for GNU Emacs.
MIT License
2.16k stars 390 forks source link

solarized: more consistent and subtle md / org modes #673

Open memeplex opened 2 years ago

memeplex commented 2 years ago

What did you expect to happen?

Headers and bold text are similarly shown in org and in markdown. Also the highlighting is more or less subtle. Besides it's consistent between light and dark modes.

What actually happened?

org and markdown modes are inconsistent in their coloring of similar semantics. Moreover, in markdown headings and bold text are highlighted using a very distracting red (usually destined to errors). Besides, in solarized light bold and heading are highlighted almost the same, but not in solarized dark.

image

image

Describe your attempts to resolve the issue

I did nothing yet, but I believe the best approach is to use the current colors for org mode also in markdown mode.

Steps to reproduce

  1. Set theme to solarized light.
  2. Create a markdown file with heading and bold text
  3. Create an org file with heading and bold text

Package commit

e716ddbb882a3a06744faa74decb2fea1569c921

System Information

macOS Big Sur, emacs-28 branch.

memeplex commented 2 years ago

Now I see that the red in markdown (vs org) is a shared feature of many themes, maybe it's so by design, it's less distracting in themes that are more colorful but I find it odd in solarized light which is in general more subtle. I don't know...

memeplex commented 2 years ago

BTW, according to the documentation here one must use custom-set-faces after a change of theme, so given that I cannot use custom-theme-set-faces and that there is no available hook AFAICS, I'm writing an after advice to modify doom themes:

(defun my-fix-theme-advice (theme &rest _args)
  (cond ((eq theme 'doom-solarized-light)
         (custom-set-faces
          `(markdown-header-face ((t (:foreground ,(doom-color 'blue)))))
          `(markdown-bold-face ((t (:foreground ,(doom-color 'fg)))))))))
(advice-add #'load-theme :after #'my-fix-theme-advice)

is this too hacky or the recommended way, if any?

Claude-Ray commented 2 years ago

It seems more sensible to inherit markdown-header-face-N from outline-N faces.

(custom-set-faces
 `(markdown-bold-face ((t (:foreground ,(doom-color 'fg)))))
 '(markdown-header-face-1 ((t (:inherit outline-1))))
 '(markdown-header-face-2 ((t (:inherit outline-2))))
 '(markdown-header-face-3 ((t (:inherit outline-3))))
 '(markdown-header-face-4 ((t (:inherit outline-4))))
 '(markdown-header-face-5 ((t (:inherit outline-5))))
 '(markdown-header-face-6 ((t (:inherit outline-6))))
 '(markdown-header-face-7 ((t (:inherit outline-7))))
 '(markdown-header-face-8 ((t (:inherit outline-8)))))

As for the bold text,

(custom-set-faces
 `(markdown-bold-face ((t (:foreground ,(doom-color 'fg))))))

And if @hlissner approves, I can submit a PR for this problem.