diff options
author | Case Duckworth | 2022-10-17 21:41:28 -0500 |
---|---|---|
committer | Case Duckworth | 2022-10-17 21:41:28 -0500 |
commit | aab5bfd074e57d06a79e39d7c7c4760e1f385a06 (patch) | |
tree | 7b111190a44458a970355f7a327cc5278c850293 /lisp/+nyan-mode.el | |
parent | asoi (diff) | |
download | emacs-aab5bfd074e57d06a79e39d7c7c4760e1f385a06.tar.gz emacs-aab5bfd074e57d06a79e39d7c7c4760e1f385a06.zip |
Bankruptcy 9
Diffstat (limited to 'lisp/+nyan-mode.el')
-rw-r--r-- | lisp/+nyan-mode.el | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/lisp/+nyan-mode.el b/lisp/+nyan-mode.el deleted file mode 100644 index 33ae9af..0000000 --- a/lisp/+nyan-mode.el +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | ;;; +nyan-mode.el --- Extras for nyan-mode -*- lexical-binding: t; -*- | ||
2 | |||
3 | ;;; Commentary: | ||
4 | |||
5 | ;;; Code: | ||
6 | |||
7 | ;;; Update even without line number in the mode line. | ||
8 | |||
9 | (defcustom +nyan-mode-update-functions | ||
10 | '( end-of-buffer beginning-of-buffer | ||
11 | next-line previous-line | ||
12 | org-next-visible-heading org-previous-visible-heading) | ||
13 | "Functions after which to force a mode-line update." | ||
14 | :type '(repeat function)) | ||
15 | |||
16 | (defun +nyan-mode--fmlu (&rest _) | ||
17 | "Update the mode-line, advice-style." | ||
18 | (force-mode-line-update)) | ||
19 | |||
20 | (defun +nyan-mode-advice (&rest _) | ||
21 | "Advise line-moving functions when in `nyan-mode'." | ||
22 | (dolist (fn +nyan-mode-update-functions) | ||
23 | (if nyan-mode | ||
24 | (advice-add fn :after #'+nyan-mode--fmlu) | ||
25 | (advice-remove fn #'+nyan-mode--fmlu)))) | ||
26 | |||
27 | (defface +nyan-mode-line nil | ||
28 | "Face for the nyan-mode mode-line indicator.") | ||
29 | |||
30 | (define-minor-mode +nyan-local-mode | ||
31 | "My very own `nyan-mode' that isn't global and doesn't update the mode-line." | ||
32 | :global nil | ||
33 | :group 'nyan | ||
34 | (dolist (fn +nyan-mode-update-functions) | ||
35 | (if +nyan-local-mode | ||
36 | (advice-add fn :after #'+nyan-mode--fmlu) | ||
37 | (advice-remove fn #'+nyan-mode--fmlu)))) | ||
38 | |||
39 | (define-globalized-minor-mode +nyan-mode +nyan-local-mode +nyan-local-mode) | ||
40 | |||
41 | (provide '+nyan-mode) | ||
42 | ;;; +nyan-mode.el ends here | ||