diff options
author | Case Duckworth | 2021-08-16 17:09:35 -0500 |
---|---|---|
committer | Case Duckworth | 2021-08-16 17:09:35 -0500 |
commit | 3eeed49d3d563d446b5b908a7e29142f77c59c63 (patch) | |
tree | 4d6541f91186fa532eb18165485a1ba1473d6462 | |
parent | Merge branch 'main' of tildegit.org:acdw/emacs (diff) | |
download | emacs-3eeed49d3d563d446b5b908a7e29142f77c59c63.tar.gz emacs-3eeed49d3d563d446b5b908a7e29142f77c59c63.zip |
Move ‘org-mode@wc-stupid’ and try to make it smarterer
-rw-r--r-- | init.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/init.el b/init.el index 532a1af..c416abe 100644 --- a/init.el +++ b/init.el | |||
@@ -1373,6 +1373,17 @@ successive invocations." | |||
1373 | (advice-add 'org-delete-backward-char | 1373 | (advice-add 'org-delete-backward-char |
1374 | :override #'acdw-org/delete-backward-char) | 1374 | :override #'acdw-org/delete-backward-char) |
1375 | 1375 | ||
1376 | (add-hook 'org-mode-hook | ||
1377 | (defun org-mode@wc-stupid () | ||
1378 | (unless (and wc-mode | ||
1379 | (> 0 (+ wc-orig-words wc-words-delta)))) | ||
1380 | (setq-local | ||
1381 | wc-count-words-function | ||
1382 | (lambda (start end) "Count words stupidly with a limit." | ||
1383 | (acdw-org/count-words-stupidly start | ||
1384 | end | ||
1385 | 999))))) | ||
1386 | |||
1376 | (setup (:straight org-appear) | 1387 | (setup (:straight org-appear) |
1377 | (:hook-into org-mode))) | 1388 | (:hook-into org-mode))) |
1378 | 1389 | ||
@@ -1532,15 +1543,6 @@ successive invocations." | |||
1532 | 1543 | ||
1533 | (:hook-into text-mode) | 1544 | (:hook-into text-mode) |
1534 | 1545 | ||
1535 | (add-hook 'org-mode-hook | ||
1536 | (defun org-mode@wc-stupid () | ||
1537 | (setq-local | ||
1538 | wc-count-words-function | ||
1539 | (lambda (start end) "Count words stupidly with a limit." | ||
1540 | (acdw-org/count-words-stupidly start | ||
1541 | end | ||
1542 | 999))))) | ||
1543 | |||
1544 | (defun acdw-modeline/wc () | 1546 | (defun acdw-modeline/wc () |
1545 | "Display current `wc-buffer-stats'." | 1547 | "Display current `wc-buffer-stats'." |
1546 | (when (bound-and-true-p wc-mode) | 1548 | (when (bound-and-true-p wc-mode) |