From 69aec39c5dd6c75b6c10d511bd557eea656cd888 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 9 Apr 2020 13:17:05 -0700 Subject: Diminish auto-revert-mode to  --- oni-gui.el | 8 ++++++-- test/integration/oni-gui.bats | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/oni-gui.el b/oni-gui.el index df72750..babc4d1 100644 --- a/oni-gui.el +++ b/oni-gui.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0409.131343 +;; Version: 2020.0409.131646 ;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish) ;; This program is free software; you can redistribute it and/or modify @@ -31,6 +31,7 @@ (set-face-font 'variable-pitch "Comic Neue-14") (defconst oni-gui-isearch-icon ?) +(defconst oni-gui-arev-icon ?) (defun oni-gui-setup-fontsets (frame) "Setup fontsets for FRAME. @@ -48,7 +49,8 @@ If FRAME is nil, they’re set for the current frame." (set-fontset-font t ? font-awesome frame) (set-fontset-font t ? font-awesome frame) (set-fontset-font t ? font-awesome frame) - (set-fontset-font t ? font-awesome frame)) + (set-fontset-font t ? font-awesome frame) + (set-fontset-font t oni-gui-arev-icon font-awesome frame)) (let ((dejavu-sans-mono "DejaVu Sans Mono")) (set-fontset-font t ?◉ dejavu-sans-mono frame) (set-fontset-font t ?○ dejavu-sans-mono frame) @@ -57,6 +59,8 @@ If FRAME is nil, they’re set for the current frame." (with-eval-after-load 'isearch (diminish 'isearch-mode (string ?\s oni-gui-isearch-icon))) +(with-eval-after-load 'autorevert + (diminish 'auto-revert-mode (string ?\s oni-gui-arev-icon))) (defhydra oni-gui-hydra (:color teal :hint nil) " diff --git a/test/integration/oni-gui.bats b/test/integration/oni-gui.bats index 40a14f0..85aaf96 100644 --- a/test/integration/oni-gui.bats +++ b/test/integration/oni-gui.bats @@ -29,3 +29,24 @@ [[ "$output" == *"t" ]] } + +@test "Opening emacs diminishes auto-revert-mode" { + run emacs -batch -l package -f package-initialize \ + -eval "(prin1 (string= (string ?\s oni-gui-arev-icon) + (car (alist-get 'auto-revert-mode minor-mode-alist))))" + + echo "$output" + + [[ "$output" == *"t" ]] +} + +@test "Reloading autorevert diminishes auto-revert-mode" { + run emacs -batch -l package -f package-initialize \ + -eval "(load-library \"autorevert\")" \ + -eval "(prin1 (string= (string ?\s oni-gui-arev-icon) + (car (alist-get 'auto-revert-mode minor-mode-alist))))" + + echo "$output" + + [[ "$output" == *"t" ]] +} -- cgit v1.2.3-54-g00ecf