Skip to content

Commit

Permalink
Don't set markdown-code-face background
Browse files Browse the repository at this point in the history
Setting the background based on the theme at load time (which is a
light backround if a theme other than `default` has not been loaded
yet) produces undesirable results if the user later switches to a
theme with a dark backround that has not defined `markdown-code-face`.

Closes GH-273.
  • Loading branch information
jrblevin committed Nov 6, 2017
1 parent 4a5859c commit e313f9c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2621,16 +2621,10 @@ See `markdown-hide-markup' for additional details."
:group 'markdown-faces)

(defface markdown-code-face
(let ((default-bg (face-background 'default))
light-bg dark-bg)
(if (member default-bg '(nil unspecified "unspecified-bg" "SystemWindow"))
(setq light-bg "unspecified-bg" dark-bg "unspecified-bg")
(setq light-bg (color-darken-name default-bg 3)
dark-bg (color-lighten-name default-bg 3)))
`((default :inherit fixed-pitch)
(((type graphic) (class color) (background dark)) (:background ,dark-bg))
(((type graphic) (class color) (background light)) (:background ,light-bg))))
"Face for inline code, pre blocks, and fenced code blocks."
'((t (:inherit fixed-pitch)))
"Face for inline code, pre blocks, and fenced code blocks.
This may be used, for example, to add a contrasting background to
inline code fragments and code blocks."
:group 'markdown-faces)

(defface markdown-inline-code-face
Expand Down

0 comments on commit e313f9c

Please sign in to comment.