From f3cb8490ee1a998dfd99ee09b73fd63023ad4c3f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 8 Jan 2021 08:47:12 -0600 Subject: Only cleanup whitespace when the window is unfocused --- config.org | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 7ddc579..c945012 100644 --- a/config.org +++ b/config.org @@ -5,7 +5,7 @@ #+EXPORT_FILE_NAME: README.md #+OPTIONS: toc:nil #+BANKRUPTCY_COUNT: 3.2 -#+Time-stamp: <2021-01-07 19:41:59 acdw> +#+Time-stamp: <2021-01-08 08:46:01 acdw> * Basics @@ -1094,7 +1094,11 @@ For right now, I’m /just/ using Anzu – I don’t like parts of =isearch= but space-before-tab ;; fix mixed spaces and tabs space-after-tab)) - (add-hook 'before-save-hook #'whitespace-cleanup) + (defun acdw/whitespace-cleanup-maybe () + "Only cleanup whitespace when out-of-focus." + (acdw/when-unfocused #'whitespace-cleanup)) + + (add-hook 'before-save-hook #'acdw/whitespace-cleanup-maybe) #+end_src * Programming -- cgit 1.4.1-21-gabe81