diff options
| author | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-02-21 19:50:01 -0800 |
|---|---|---|
| committer | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-02-21 19:50:01 -0800 |
| commit | 44859710c739ea2d13040a88c1d3f3cf8ab9f04b (patch) | |
| tree | 4c68ce1abf979a5edd07bec8c40a950a92d1b6c1 /config/emacs | |
| parent | 69db01f6b984efcb4cdc0763e7c3dec472ba202d (diff) | |
configurable starting state by major mode
Diffstat (limited to 'config/emacs')
| -rw-r--r-- | config/emacs/site-lisp/my-modal.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/config/emacs/site-lisp/my-modal.el b/config/emacs/site-lisp/my-modal.el index 0759fe5..6fc6f18 100644 --- a/config/emacs/site-lisp/my-modal.el +++ b/config/emacs/site-lisp/my-modal.el @@ -328,16 +328,20 @@ trigger EFFECT or consult UNTIL." (when color (set-face-background 'cursor color)))) -(defvar mm/special-modes '()) +(defvar mm/starting-mode-alist '((eshell-mode . mm/base-state-mode) + (term-mode . mm/base-state-mode) + (vterm-mode . mm/base-state-mode) + (eat-mode . mm/base-state-mode) + (vc-git-log-edit-mode . mm/base-state-mode)) + "Alist of (major-mode . starting-state-mode).") (defun mm/pick-starting-state (&optional buffer) (unless buffer (setq buffer (current-buffer))) (with-current-buffer buffer - (let ((pick (if (or buffer-read-only - (memq major-mode mm/special-modes)) - 'mm/special-state-mode - 'mm/normal-state-mode))) - pick))) + (cond + ((alist-get major-mode mm/starting-mode-alist)) + (buffer-read-only 'mm/special-state-mode) + (t 'mm/normal-state-mode)))) (defun mm/enable-starting-state (&optional buffer) (unless (minibufferp) |
