dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit e8d81e49fccbd09c26b71be92a0d65fd957e5dac
parent d8e869f732e9fddb53781132b51916d810b0ec5b
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Sun,  6 Feb 2022 15:51:36 +0100

Spend way too much time trying to be backward-compatible

Diffstat:
M.emacs | 23++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

diff --git 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)