Refactor unicode fixes
This commit is contained in:
parent
806fa7d85a
commit
1d187fa478
3 changed files with 16 additions and 9 deletions
|
@ -284,5 +284,14 @@ Examples:
|
||||||
(require 'autoloads))
|
(require 'autoloads))
|
||||||
(message "Done!")))
|
(message "Done!")))
|
||||||
|
|
||||||
|
(defun narf-fix-unicode (font chars &optional size)
|
||||||
|
"Display certain unicode characters in a specific font.
|
||||||
|
|
||||||
|
e.g. (narf-fix-unicode \"DejaVu Sans\" '(?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))"
|
||||||
|
(mapc (lambda (x) (set-fontset-font
|
||||||
|
"fontset-default" `(,x . ,x)
|
||||||
|
(font-spec :name font :size size) nil 'prepend))
|
||||||
|
chars))
|
||||||
|
|
||||||
(provide 'core-defuns)
|
(provide 'core-defuns)
|
||||||
;;; core-defuns.el ends here
|
;;; core-defuns.el ends here
|
||||||
|
|
|
@ -74,15 +74,7 @@
|
||||||
(add-hook! 'after-init-hook (set-window-fringes (minibuffer-window) 0 0 nil)))
|
(add-hook! 'after-init-hook (set-window-fringes (minibuffer-window) 0 0 nil)))
|
||||||
|
|
||||||
;; Try to display unicode characters without upsetting line-hieght (as much as possible)
|
;; Try to display unicode characters without upsetting line-hieght (as much as possible)
|
||||||
(defun narf-fix-unicode (set)
|
(narf-fix-unicode "DejaVu Sans" '(?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))
|
||||||
(let ((font (car set))
|
|
||||||
(chars (cadr set))
|
|
||||||
(size (caddr set)))
|
|
||||||
(mapc (lambda (x) (set-fontset-font
|
|
||||||
"fontset-default" `(,x . ,x)
|
|
||||||
(font-spec :name font :size size) nil 'prepend))
|
|
||||||
chars)))
|
|
||||||
(mapc 'narf-fix-unicode '(("DejaVu Sans" (?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))))
|
|
||||||
|
|
||||||
;; on by default in Emacs 25; I prefer to enable on a mode-by-mode basis, so disable it
|
;; on by default in Emacs 25; I prefer to enable on a mode-by-mode basis, so disable it
|
||||||
(when (and (> emacs-major-version 24) (featurep 'eldoc))
|
(when (and (> emacs-major-version 24) (featurep 'eldoc))
|
||||||
|
|
|
@ -137,6 +137,12 @@
|
||||||
(file+headline (concat org-directory "topics/vocab.org") "Unsorted")
|
(file+headline (concat org-directory "topics/vocab.org") "Unsorted")
|
||||||
"** %i%?\n")))
|
"** %i%?\n")))
|
||||||
|
|
||||||
|
(narf-fix-unicode "DejaVu Sans" '(?♭ ?♯))
|
||||||
|
(narf-fix-unicode "Hack" '(?× ?∙ ?÷ ?⌉ ?⌈ ?⌊ ?⌋
|
||||||
|
?∩ ?∪ ?⊆ ?⊂ ?⊄ ?⊇ ?⊃ ?⊅
|
||||||
|
?⇒ ?⇐ ?⇔ ?↔ ?→ ?≡ ?∴ ?∵ ?⊕ ?∀ ?∃ ?∄ ?∈ ?∉
|
||||||
|
?∨ ?∧ ?¬))
|
||||||
|
|
||||||
(org-babel-do-load-languages
|
(org-babel-do-load-languages
|
||||||
'org-babel-load-languages
|
'org-babel-load-languages
|
||||||
'((python . t) (ruby . t) (sh . t) (js . t) (css . t)
|
'((python . t) (ruby . t) (sh . t) (js . t) (css . t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue