Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eat-eshell shim #668

Merged
merged 5 commits into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions meow-shims.el
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,40 @@
;; These vars allow us the select through the polymode chunk
(add-to-list 'polymode-move-these-vars-from-old-buffer v))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; eat-eshell

(defvar meow--eat-eshell-setup nil)
(defvar meow--eat-eshell-mode-override nil)

(declare-function eat-eshell-emacs-mode "eat")
(declare-function eat-eshell-semi-char-mode "eat")
(declare-function eat-eshell-char-mode "eat")

(defun meow--eat-eshell-mode-override-enable ()
(setq-local meow--eat-eshell-mode-override t)
(add-hook 'meow-insert-enter-hook #'eat-eshell-char-mode nil t)
(add-hook 'meow-insert-exit-hook #'eat-eshell-emacs-mode nil t)
(if meow-insert-mode
(eat-eshell-char-mode)
(eat-eshell-emacs-mode)))

(defun meow--eat-eshell-mode-override-disable ()
(setq-local meow--eat-eshell-mode-override nil)
(remove-hook 'meow-insert-enter-hook #'eat-eshell-char-mode t)
(remove-hook 'meow-insert-exit-hook #'eat-eshell-emacs-mode t))

(defun meow--setup-eat-eshell (enable)
(setq meow--eat-eshell-setup enable)
(if enable
(progn (add-hook 'eat-eshell-exec-hook #'meow--eat-eshell-mode-override-enable)
(add-hook 'eat-eshell-exit-hook #'meow--eat-eshell-mode-override-disable)
(add-hook 'eat-eshell-exit-hook #'meow--update-cursor))

(remove-hook 'eat-eshell-exec-hook #'meow--eat-eshell-mode-override-enable)
(remove-hook 'eat-eshell-exit-hook #'meow--eat-eshell-mode-override-disable)
(remove-hook 'eat-eshell-exit-hook #'meow--update-cursor)))

;; Enable / Disable shims

(defun meow--enable-shims ()
Expand All @@ -480,22 +514,23 @@
(meow--setup-eldoc t)
(meow--setup-rectangle-mark t)

(eval-after-load "macrostep" (lambda () (meow--setup-macrostep t)))

Check warning on line 517 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 517 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 517 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "wdired" (lambda () (meow--setup-wdired t)))

Check warning on line 518 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 518 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 518 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "edebug" (lambda () (meow--setup-edebug t)))

Check warning on line 519 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 519 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 519 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "magit" (lambda () (meow--setup-magit t)))

Check warning on line 520 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 520 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 520 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "wgrep" (lambda () (meow--setup-wgrep t)))

Check warning on line 521 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 521 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 521 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "company" (lambda () (meow--setup-company t)))

Check warning on line 522 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 522 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 522 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "corfu" (lambda () (meow--setup-corfu t)))

Check warning on line 523 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 523 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "polymode" (lambda () (meow--setup-polymode t)))

Check warning on line 524 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 524 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "cider" (lambda () (meow--setup-cider t)))

Check warning on line 525 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 525 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "sly" (lambda () (meow--setup-sly t)))

Check warning on line 526 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.

Check warning on line 526 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

`eval-after-load' is for use in configurations, and should rarely be used in packages.
(eval-after-load "realgud" (lambda () (meow--setup-realgud t)))
(eval-after-load "which-key" (lambda () (meow--setup-which-key t)))
(eval-after-load "undo-tree" (lambda () (meow--setup-undo-tree t)))
(eval-after-load "diff-hl" (lambda () (meow--setup-diff-hl t)))
(eval-after-load "quail" (lambda () (meow--setup-input-method t)))
(eval-after-load "skk" (lambda () (meow--setup-ddskk t))))
(eval-after-load "skk" (lambda () (meow--setup-ddskk t)))
(eval-after-load "eat" (lambda () (meow--setup-eat-eshell t))))

(defun meow--disable-shims ()
"Remove shim setups."
Expand All @@ -514,7 +549,8 @@
(when meow--which-key-setup (meow--setup-which-key nil))
(when meow--diff-hl-setup (meow--setup-diff-hl nil))
(when meow--input-method-setup (meow--setup-input-method nil))
(when meow--ddskk-setup (meow--setup-ddskk nil)))
(when meow--ddskk-setup (meow--setup-ddskk nil))
(when meow--eat-eshell-setup (meow--setup-eat-eshell nil)))

;;; meow-shims.el ends here
(provide 'meow-shims)
Loading