From 3eeed49d3d563d446b5b908a7e29142f77c59c63 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 16 Aug 2021 17:09:35 -0500 Subject: Move ‘org-mode@wc-stupid’ and try to make it smarterer --- init.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 532a1af..c416abe 100644 --- a/init.el +++ b/init.el @@ -1373,6 +1373,17 @@ successive invocations." (advice-add 'org-delete-backward-char :override #'acdw-org/delete-backward-char) + (add-hook 'org-mode-hook + (defun org-mode@wc-stupid () + (unless (and wc-mode + (> 0 (+ wc-orig-words wc-words-delta)))) + (setq-local + wc-count-words-function + (lambda (start end) "Count words stupidly with a limit." + (acdw-org/count-words-stupidly start + end + 999))))) + (setup (:straight org-appear) (:hook-into org-mode))) @@ -1532,15 +1543,6 @@ successive invocations." (:hook-into text-mode) - (add-hook 'org-mode-hook - (defun org-mode@wc-stupid () - (setq-local - wc-count-words-function - (lambda (start end) "Count words stupidly with a limit." - (acdw-org/count-words-stupidly start - end - 999))))) - (defun acdw-modeline/wc () "Display current `wc-buffer-stats'." (when (bound-and-true-p wc-mode) -- cgit 1.4.1-21-gabe81