summaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
authorKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2022-02-06 15:51:36 +0100
committerKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2022-02-06 15:51:36 +0100
commite8d81e49fccbd09c26b71be92a0d65fd957e5dac (patch)
tree488bdea13e90abf5f33b8336e37fecc129b471c6 /.emacs
parentd8e869f732e9fddb53781132b51916d810b0ec5b (diff)
downloaddotfiles-e8d81e49fccbd09c26b71be92a0d65fd957e5dac.tar.xz
Spend way too much time trying to be backward-compatible
Diffstat (limited to '.emacs')
-rw-r--r--.emacs23
1 files changed, 20 insertions, 3 deletions
diff --git a/.emacs b/.emacs
index 234df07..33951e5 100644
--- a/.emacs
+++ b/.emacs
@@ -264,6 +264,17 @@
;; Online packages configuration
+(defun my/symbol-as-icon (c)
+ ;; By default, Emacs 28 uses color fonts for characters from (1) the
+ ;; 'emoji script (2) the 'symbol script, when followed by VS-16.
+ ;; Meanwhile, Emacs 27 knows how to display color fonts, but (1) it
+ ;; has no 'emoji script (2) it doesn't know what to do with VS-16.
+ ;; Bottomline: on Emacs 28, explicitly ask for the emoji
+ ;; presentation with VS-16; on older emacsen, just use the
+ ;; character, and rely on a blanket fontset rule to prefer color
+ ;; fonts for the whole 'symbol script.
+ (apply 'string `(,c ,@(when (>= emacs-major-version 28)
+ '(?\N{VARIATION SELECTOR-16})))))
;; So long, Will Mengarini.
(delight 'abbrev-mode nil 'abbrev)
@@ -272,7 +283,9 @@
(delight 'auto-revert-tail-mode "–" 'autorevert)
(delight 'eldoc-mode "πŸ“–" 'eldoc)
(delight 'footnote-mode "ΒΉ" 'footnote)
-(delight 'flyspell-mode (propertize "πŸ–‹" 'face 'flyspell-incorrect) 'flyspell)
+(delight 'flyspell-mode (propertize (my/symbol-as-icon ?πŸ–‹)
+ 'face 'flyspell-incorrect)
+ 'flyspell)
(delight 'hi-lock-mode nil 'hi-lock)
(delight 'hs-minor-mode "…" 'hideshow)
(delight 'isearch-mode "πŸ”" 'isearch)
@@ -296,8 +309,12 @@
'compile)
(let* ((indicator (alist-get 'compilation-in-progress mode-line-modes))
(old-props (text-properties-at 0 (car indicator)))
- (new-props '(face compilation-mode-line-run)))
- (setcar indicator (apply #'propertize "βš™οΈ" (append new-props old-props)))))
+ (face (if (>= emacs-major-version 28)
+ 'modus-themes-intense-yellow
+ `(:background ,(face-foreground 'warning))))
+ (new-props (append `(face ,face) old-props))
+ (icon (my/symbol-as-icon ?βš™)))
+ (setcar indicator (concat (apply #'propertize icon new-props) " "))))
(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)