From 3be5692c7750e9d0a330cca1834ef3b5090ffba5 Mon Sep 17 00:00:00 2001 From: Keating950 Date: Thu, 16 Apr 2020 19:00:23 -0400 Subject: [PATCH 1/4] Respect global whitespace mode config, if set --- core/core-ui.el | 1 + 1 file changed, 1 insertion(+) diff --git a/core/core-ui.el b/core/core-ui.el index 71f75c035..1ac441088 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -142,6 +142,7 @@ Does nothing if `whitespace-mode' is already active or the current buffer is read-only or not file-visiting." (unless (or (eq major-mode 'fundamental-mode) buffer-read-only + (equal global-whitespace-mode t) (null buffer-file-name)) (require 'whitespace) (set (make-local-variable 'whitespace-style) From 8535318cf4ac4969fb11005f461837552912cd24 Mon Sep 17 00:00:00 2001 From: Keating950 Date: Thu, 16 Apr 2020 19:05:23 -0400 Subject: [PATCH 2/4] Update docstring --- core/core-ui.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 1ac441088..37e4fda6a 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -138,8 +138,8 @@ size.") e.g. If you indent with spaces by default, tabs will be highlighted. If you indent with tabs, spaces at BOL are highlighted. -Does nothing if `whitespace-mode' is already active or the current buffer is -read-only or not file-visiting." +Does nothing if `whitespace-mode' or 'global-whitespace-mode'is already +active or if the current buffer is read-only or not file-visiting." (unless (or (eq major-mode 'fundamental-mode) buffer-read-only (equal global-whitespace-mode t) From 1a07ee8269bec6ef462999c947f0a758bf05f9fc Mon Sep 17 00:00:00 2001 From: Keating950 Date: Fri, 17 Apr 2020 19:59:54 -0400 Subject: [PATCH 3/4] simplified expression; fixed typo --- core/core-ui.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core-ui.el b/core/core-ui.el index 37e4fda6a..2de3ddbb2 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -138,7 +138,7 @@ size.") e.g. If you indent with spaces by default, tabs will be highlighted. If you indent with tabs, spaces at BOL are highlighted. -Does nothing if `whitespace-mode' or 'global-whitespace-mode'is already +Does nothing if `whitespace-mode' or 'global-whitespace-mode' is already active or if the current buffer is read-only or not file-visiting." (unless (or (eq major-mode 'fundamental-mode) buffer-read-only From 54041ad827623131c056ade786999d4cff779515 Mon Sep 17 00:00:00 2001 From: Keating950 Date: Fri, 17 Apr 2020 21:33:45 -0400 Subject: [PATCH 4/4] simplifying boolean expression --- core/core-ui.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core-ui.el b/core/core-ui.el index 2de3ddbb2..a3498cf4f 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -142,7 +142,7 @@ Does nothing if `whitespace-mode' or 'global-whitespace-mode' is already active or if the current buffer is read-only or not file-visiting." (unless (or (eq major-mode 'fundamental-mode) buffer-read-only - (equal global-whitespace-mode t) + global-whitespace-mode (null buffer-file-name)) (require 'whitespace) (set (make-local-variable 'whitespace-style)