aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2020-12-02 15:36:19 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2020-12-02 15:36:19 +0000
commit5cc34e5da17aa39597745e9e2075dcfd3a74416c (patch)
tree44a9d05d44ea0e014ebf07d28728e7cb3cc3b9b6 /Emacs/.config/emacs
parent8b7837e90259f2443f0d1c6eb44973add0bf2d53 (diff)
downloaddotfiles-5cc34e5da17aa39597745e9e2075dcfd3a74416c.tar.gz
dotfiles-5cc34e5da17aa39597745e9e2075dcfd3a74416c.tar.bz2
dotfiles-5cc34e5da17aa39597745e9e2075dcfd3a74416c.zip
(Emacs)+use-package functionality for :pretty keyword
:pretty keyword allows use-package to create aliases for prettify-symbols-mode.
Diffstat (limited to 'Emacs/.config/emacs')
-rw-r--r--Emacs/.config/emacs/config.org23
1 files changed, 23 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index e0d844d..e750047 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -644,6 +644,29 @@ packages can leverage it.
:init
(setq prettify-symbols-unprettify-at-point t)
:config
+ (with-eval-after-load "use-package-core"
+ (add-to-list 'use-package-keywords ':pretty)
+ (defun use-package-normalize/:pretty (_name-symbol _keyword args)
+ args)
+
+ (defun use-package-handler/:pretty (name _keyword args rest state)
+ (use-package-concat
+ (use-package-process-keywords name rest state)
+ (let ((arg args)
+ forms)
+ (while arg
+ (let ((mode (car arg))
+ (rest (cdr arg)))
+ (add-to-list
+ 'forms
+ `(add-hook
+ ',mode
+ (lambda ()
+ (setq prettify-symbols-alist ',rest)
+ (prettify-symbols-mode)))))
+ (setq arg (cdr arg)))
+ forms))))
+
(defmacro +pretty/set-alist (mode &rest symbols)
`(add-hook
',mode