Add my/always-use-eat

This commit is contained in:
Alexander Rosenberg 2025-02-20 20:33:00 -08:00
parent 2d072241a7
commit 997be323f5
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -2663,11 +2663,15 @@ If no name is given, list all bookmarks instead."
(defvar my/eshell-or-eat-hook nil
"Hook to determine weather `my/open-shell-dwin' uses `eshell' or `eat'.")
(defvar my/always-use-eat nil
"Make `my/open-shell-dwim' always use eat.")
(put 'my/always-use-eat 'safe-local-variable 'booleanp)
(defun my/open-shell-dwim (&optional arg)
"Open either an `eshell' or `eat' terminal based on `my/eshell-or-eat-hook'.
ARG is the same as for either of the above functions."
(interactive "P")
(if (run-hook-with-args-until-success 'my/eshell-or-eat-hook)
(if (or my/always-use-eat
(run-hook-with-args-until-success 'my/eshell-or-eat-hook))
(my/project-eat-or-default arg)
(my/project-eshell-or-default arg)))
(keymap-global-set "C-c v" #'my/open-shell-dwim)