Skip to content

Commit

Permalink
Only use string-pixel-width in 29+.
Browse files Browse the repository at this point in the history
Close #601.
compat provides string-pixel-width but it has bad performance, thus will freeze
Emacs.
  • Loading branch information
seagle0128 committed Jan 7, 2023
1 parent 4224fce commit fb516af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doom-modeline-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,8 @@ Example:
:align-to
(- (+ right right-fringe right-margin scroll-bar)
,(let ((rhs-str (format-mode-line (cons "" rhs-forms))))
(if (fboundp 'string-pixel-width)
(if (and (>= emacs-major-version 29)
(fboundp 'string-pixel-width))
(/ (string-pixel-width rhs-str)
(doom-modeline--font-width)
1.0)
Expand Down

0 comments on commit fb516af

Please sign in to comment.