From 89e37ee87755339d113fb631ddae3682e5cddffc Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 25 Nov 2022 10:36:02 -0800 Subject: feat(wpcarro/emacs): Package theme.el **TL;DR:** - Rename `colorscheme.el` to `theme.el` to align with Emacs's nomenclature. - Prune dependencies: - `cl-lib` - `>` - `prelude` Change-Id: I15f225671b4096ab08913583b7b464e316c95298 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7412 Tested-by: BuildkiteCI Reviewed-by: wpcarro --- users/wpcarro/emacs/.emacs.d/wpc/colorscheme.el | 85 ------------------------- 1 file changed, 85 deletions(-) delete mode 100644 users/wpcarro/emacs/.emacs.d/wpc/colorscheme.el (limited to 'users/wpcarro/emacs/.emacs.d/wpc/colorscheme.el') diff --git a/users/wpcarro/emacs/.emacs.d/wpc/colorscheme.el b/users/wpcarro/emacs/.emacs.d/wpc/colorscheme.el deleted file mode 100644 index 20d209f895eb..000000000000 --- a/users/wpcarro/emacs/.emacs.d/wpc/colorscheme.el +++ /dev/null @@ -1,85 +0,0 @@ -;;; colorscheme.el --- Syntax highlight and friends -*- lexical-binding: t -*- - -;; Author: William Carroll -;; Version: 0.0.1 -;; Package-Requires: ((emacs "24.3")) - -;;; Commentary: -;; -;; TODO: Clarify this. -;; Since I have my own definition of "theme", which couples wallpaper, font, -;; with Emacs's traditional notion of the word "theme", I'm choosing to use -;; "colorscheme" to refer to *just* the notion of syntax highlight etc. - -;;; Code: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Dependencies -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(require 'cycle) -(require '>) -(require 'cl-lib) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Library -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defcustom colorscheme-whitelist - (cycle-from-list - (->> (custom-available-themes) - (list-map #'symbol-name) - (list-filter (>-> (s-starts-with? "doom-"))) - (list-map #'intern))) - "The whitelist of colorschemes through which to cycle.") - -(defun colorscheme-current () - "Return the currently enabled colorscheme." - (cycle-current colorscheme-whitelist)) - -(defun colorscheme-disable-all () - "Disable all currently enabled colorschemes." - (interactive) - (->> custom-enabled-themes - (list-map #'disable-theme))) - -(defun colorscheme-set (theme) - "Call `load-theme' with `THEME', ensuring that the line numbers are bright. -There is no hook that I'm aware of to handle this more elegantly." - (load-theme theme t) - (prelude-set-line-number-color "#da5468")) - -(defun colorscheme-whitelist-set (colorscheme) - "Focus the COLORSCHEME in the `colorscheme-whitelist' cycle." - (cycle-focus! (lambda (x) (equal x colorscheme)) colorscheme-whitelist) - (colorscheme-set (colorscheme-current))) - -(defun colorscheme-ivy-select () - "Load a colorscheme using ivy." - (interactive) - (let ((theme (ivy-read "Theme: " (cycle-to-list colorscheme-whitelist)))) - (colorscheme-disable-all) - (colorscheme-set (intern theme)))) - -(cl-defun colorscheme-cycle (&key forward?) - "Cycle next if `FORWARD?' is non-nil. -Cycle prev otherwise." - (disable-theme (cycle-current colorscheme-whitelist)) - (let ((theme (if forward? - (cycle-next! colorscheme-whitelist) - (cycle-prev! colorscheme-whitelist)))) - (colorscheme-set theme) - (message (s-concat "Active theme: " (symbol-to-string theme))))) - -(defun colorscheme-next () - "Disable the currently active theme and load the next theme." - (interactive) - (colorscheme-cycle :forward? t)) - -(defun colorscheme-prev () - "Disable the currently active theme and load the previous theme." - (interactive) - (colorscheme-cycle :forward? nil)) - -(provide 'colorscheme) -;;; colorscheme.el ends here -- cgit 1.4.1