From ee8b6591c989aa65f3034b4e4285081eb0ce1422 Mon Sep 17 00:00:00 2001 From: Rune Juhl Jacobsen Date: Sat, 1 Feb 2020 14:42:01 +0100 Subject: [PATCH 1/2] Lint README.md --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 32bec9f..36d4dc2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ Because switching between your themes shouldn't be so damn hard How it works ------------ -Define a list of themes you want to be able to switch between. Then, enable the global minor mode. If you don't list any themes, we default to switching between all the ones emacs knows about. +Define a list of themes you want to be able to switch between. Then, enable the +global minor mode. If you don't list any themes, we default to switching between +all the ones emacs knows about. ```elisp (setq cycle-themes-theme-list @@ -17,9 +19,11 @@ Define a list of themes you want to be able to switch between. Then, enable the ``` -That's it! Now, you can switch between your themes by calling `M-x cycle-themes`, or with the (easily re-definable) binding of `C-c C-t`. +That's it! Now, you can switch between your themes by calling `M-x +cycle-themes`, or with the (easily re-definable) binding of `C-c C-t`. -If you use [use-package](https://github.com/jwiegley/use-package), it'll look something like this: +If you use [use-package](https://github.com/jwiegley/use-package), it'll look +something like this: ```elisp (use-package cycle-themes @@ -28,17 +32,19 @@ If you use [use-package](https://github.com/jwiegley/use-package), it'll look so '(leuven monokai solarized-dark)) :config (cycle-themes-mode)) ``` - + Hooks ----- -Additionally, there is a custom variable for attaching your own hooks to be run after switching themes. For example, I don't like having my fringes be a different color than the background, so I simply use this: +Additionally, there is a custom variable for attaching your own hooks to be run +after switching themes. For example, I don't like having my fringes be a +different color than the background, so I simply use this: ```elisp (add-hook 'cycle-themes-after-cycle-hook #'(lambda () (dolist (frame (frame-list)) - (set-face-attribute 'fringe frame + (set-face-attribute 'fringe frame :background (face-background 'default))))) ``` If you add any hooks and call `cycle-themes-mode` anywhere in your init file, it will automatically enable the first theme in the list and run all of your hooks. @@ -46,19 +52,20 @@ If you add any hooks and call `cycle-themes-mode` anywhere in your init file, it Caveats ------- -If you find that it's skipping themes in your list, make sure that all of your themes are installed and loaded properly. This is especially important for users of `use-package`, as it will `require` the theme, but not actually -`load` it into emacs' list of valid themes (which makes `(custom-theme-p my-theme)` return `nil`). +If you find that it's skipping themes in your list, make sure that all of your +themes are installed and loaded properly. This is especially important for users +of `use-package`, as it will `require` the theme, but not actually `load` it +into emacs' list of valid themes (which makes `(custom-theme-p my-theme)` return +`nil`). ```elisp -(use-package solarized-theme - :ensure t - :config (progn (load-theme 'solarized-dark t t) - (load-theme 'solarized-light t t))) +use-package solarized-theme +:ensure t ``` Thanks ------ -This package was inspired by a [stackoverflow -answer](http://stackoverflow.com/a/18796138). I thought that snippet was great, and -that it really deserved to be made into a true package. So I did. +This package was inspired by a [stackoverflow +answer](http://stackoverflow.com/a/18796138). I thought that snippet was great, +and that it really deserved to be made into a true package. So I did. From 2c7742fd5fae518986b2436e108771610f9f0919 Mon Sep 17 00:00:00 2001 From: Rune Juhl Jacobsen Date: Sat, 1 Feb 2020 14:42:12 +0100 Subject: [PATCH 2/2] Remove default key binding See https://github.com/toroidal-code/cycle-themes.el/issues/3 --- cycle-themes.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/cycle-themes.el b/cycle-themes.el index 3ae7ea5..0f8dd32 100644 --- a/cycle-themes.el +++ b/cycle-themes.el @@ -122,9 +122,6 @@ (define-minor-mode cycle-themes-mode "Minor mode for cycling between themes." :lighter "" - :keymap (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-t") 'cycle-themes) - map) :global t (progn ;; remove any lingering themes other than the primary