From 0bba9c4db8f6ba61f899ddf51e162fe53dcdc8f1 Mon Sep 17 00:00:00 2001 From: Jake Romer Date: Sun, 24 Nov 2019 08:00:02 -0500 Subject: [PATCH] Use derived-mode-p --- doom-modeline-core.el | 4 ++-- doom-modeline-segments.el | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index e40c9d6..02528e3 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -249,9 +249,9 @@ It respects `doom-modeline-icon' and `doom-modeline-buffer-state-icon'." :group 'doom-modeline) (defcustom doom-modeline-continuous-word-count-modes - '(markdown-mode org-mode) + '(text-mode) "Major modes in which to display word count continuously. -Respects `doom-modeline-enable-word-count'." +Also applies to any derived modes. Respects `doom-modeline-enable-word-count'." :type 'list :group 'doom-modeline) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 578d7e3..05c2165 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -1030,10 +1030,10 @@ mouse-1: List all problems%s" (doom-modeline-def-segment word-count "The buffer word count. -Displayed when in a major mode in `doom-modeline-continuous-word-count-modes'. -Respects `doom-modeline-enable-word-count'." +Displayed when in a major mode in `doom-modeline-continuous-word-count-modes', +or any derived mode. Respects `doom-modeline-enable-word-count'." (when (and doom-modeline-enable-word-count - (member major-mode doom-modeline-continuous-word-count-modes)) + (apply #'derived-mode-p doom-modeline-continuous-word-count-modes)) (let ((word-count (format " %dW" (count-words (point-min) (point-max))))) (if (doom-modeline--active) word-count