@@ -2039,7 +2039,7 @@ headers of levels one through six respectively."
2039
2039
:initialize 'custom-initialize-default
2040
2040
:set (lambda (symbol value)
2041
2041
(set-default symbol value)
2042
- (markdown-update-header-faces value ))
2042
+ (markdown-update-header-faces))
2043
2043
:group 'markdown-faces
2044
2044
:package-version '(markdown-mode . "2.2"))
2045
2045
@@ -2051,44 +2051,38 @@ Used when `markdown-header-scaling' is non-nil."
2051
2051
:initialize 'custom-initialize-default
2052
2052
:set (lambda (symbol value)
2053
2053
(set-default symbol value)
2054
- (markdown-update-header-faces markdown-header-scaling value ))
2054
+ (markdown-update-header-faces))
2055
2055
:group 'markdown-faces)
2056
2056
2057
2057
(defun markdown-make-header-faces ()
2058
2058
"Build the faces used for Markdown headers."
2059
- (let ((inherit-faces '(font-lock-function-name-face)))
2060
- (when markdown-header-scaling
2061
- (setq inherit-faces (cons 'variable-pitch inherit-faces)))
2059
+ (unless (facep 'markdown-header-face)
2062
2060
(defface markdown-header-face
2063
- ` ((t (:inherit ,inherit-faces :weight bold)))
2061
+ ' ((t (:inherit (font-lock-function-name-face) :weight bold)))
2064
2062
"Base face for headers."
2065
- :group 'markdown-faces))
2066
- (dotimes (num 6)
2067
- (let* ((num1 (1+ num))
2068
- (face-name (intern (format "markdown-header-face-%s" num1)))
2069
- (scale (if markdown-header-scaling
2070
- (float (nth num markdown-header-scaling-values))
2071
- 1.0)))
2072
- (eval
2073
- `(defface ,face-name
2074
- '((t (:inherit markdown-header-face :height ,scale)))
2075
- (format "Face for level %s headers.
2063
+ :group 'markdown-faces)
2064
+ (dotimes (num 6)
2065
+ (let* ((num1 (1+ num))
2066
+ (face-name (intern (format "markdown-header-face-%s" num1)))
2067
+ (scale (float (nth num markdown-header-scaling-values))))
2068
+ (eval
2069
+ `(defface ,face-name
2070
+ '((t (:inherit (variable-pitch markdown-header-face) :height ,scale)))
2071
+ (format "Face for level %s headers.
2076
2072
You probably don't want to customize this face directly. Instead
2077
2073
you can customize the base face `markdown-header-face' or the
2078
2074
variable-height variable `markdown-header-scaling'." ,num1)
2079
- :group 'markdown-faces)))))
2075
+ :group 'markdown-faces) )))))
2080
2076
2081
- (markdown-make-header-faces)
2082
-
2083
- (defun markdown-update-header-faces (&optional scaling scaling-values)
2084
- "Update header faces, depending on if header SCALING is desired.
2085
- If so, use given list of SCALING-VALUES relative to the baseline
2086
- size of `markdown-header-face'."
2077
+ (defun markdown-update-header-faces (&optional _scaling _scaling-values)
2078
+ "Update header faces using current values of markdown-header-scaling and
2079
+ markdown-header-scaling-values. Arguments are ignored but retained to avoid breakage."
2080
+ (markdown-make-header-faces)
2087
2081
(dotimes (num 6)
2088
2082
(let* ((face-name (intern (format "markdown-header-face-%s" (1+ num))))
2089
- (scale (cond ((not scaling) 1.0)
2090
- (scaling-values ( float (nth num scaling-values) ))
2091
- (t (float (nth num markdown-header-scaling-values))) )))
2083
+ (scale (if markdown-header- scaling
2084
+ ( float (nth num markdown-header- scaling-values))
2085
+ 1.0 )))
2092
2086
(unless (get face-name 'saved-face) ; Don't update customized faces
2093
2087
(set-face-attribute face-name nil :height scale)))))
2094
2088
@@ -9686,6 +9680,7 @@ rows and columns and the column alignment."
9686
9680
(markdown-live-preview-remove)))
9687
9681
9688
9682
9683
+ (markdown-update-header-faces)
9689
9684
(provide 'markdown-mode)
9690
9685
9691
9686
;; Local Variables:
0 commit comments