diff --git a/oni-core.el b/oni-core.el index 512dc4d..620a337 100644 --- a/oni-core.el +++ b/oni-core.el @@ -4,8 +4,8 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.1015.100916 -;; Package-Requires: (oni-data-dir expand-region multiple-cursors embrace gcmh diminish) +;; Version: 2020.1015.102640 +;; Package-Requires: (oni-data-dir expand-region multiple-cursors embrace gcmh diminish ws-butler) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ (require 'gcmh) (require 'oni-data-dir) (require 'recentf) +(require 'ws-butler) (defconst oni-core--auto-save-directory (oni-data-dir-locate "auto-save-files/") "Directory where auto-saves go.") @@ -40,11 +41,6 @@ (defvar oni-core--recentf-idle-timer nil "Internal variable keeping track of a timer started for ‘recentf-save-list’.") -(defun oni-core--destroy-trailing-whitespace () - "Delete trailing whitespace everywhere, except in Markdown buffers." - (if (not (eq major-mode 'markdown-mode)) - (delete-trailing-whitespace))) - (defun oni-core--switch-newline-keys () "Switch the ‘C-j’ and ‘RET’ keys in the local buffer." (if electric-indent-mode @@ -131,7 +127,6 @@ (setq-default truncate-lines t) (setq-default fill-column 80) -(add-hook 'before-save-hook #'oni-core--destroy-trailing-whitespace) (add-hook 'before-save-hook 'time-stamp) (add-hook 'electric-indent-local-mode-hook #'oni-core--switch-newline-keys) (add-hook 'minibuffer-setup-hook 'electric-pair-local-mode) @@ -155,11 +150,13 @@ (run-with-idle-timer 10 t #'oni-core-recentf-save-list-silently))) (diminish 'gcmh-mode) +(diminish 'ws-butler-mode) (electric-indent-mode -1) (winner-mode) (recentf-mode) (gcmh-mode) +(ws-butler-global-mode) (add-to-list 'display-buffer-alist `(,(rx string-start diff --git a/test/integration/oni-core.bats b/test/integration/oni-core.bats index adf6a4f..373d3ea 100755 --- a/test/integration/oni-core.bats +++ b/test/integration/oni-core.bats @@ -35,3 +35,21 @@ [[ "$output" == *"t" ]] } + +@test "Starting Emacs diminishes ws-butler-global-mode" { + run emacs -batch -l package -f package-initialize -l subr-x \ + -eval "(prin1 (string-empty-p (car (alist-get 'ws-butler-mode minor-mode-alist))))" + + echo "$output" + + [[ "$output" == *"t" ]] +} + +@test "Starting Emacs turns on ws-butler-mode" { + run emacs -batch -l package -f package-initialize \ + -eval "(prin1 (bound-and-true-p ws-butler-mode))" + + echo "$output" + + [[ "$output" == *"t" ]] +}