From 5cc34e5da17aa39597745e9e2075dcfd3a74416c Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 2 Dec 2020 15:36:19 +0000 Subject: (Emacs)+use-package functionality for :pretty keyword :pretty keyword allows use-package to create aliases for prettify-symbols-mode. --- Emacs/.config/emacs/config.org | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Emacs/.config/emacs/config.org') 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 -- cgit v1.2.3-13-gbd6f