;; This file:
;;   https://anggtwu.net/elisp/2026-eepitch-evil.el.html
;;   https://anggtwu.net/elisp/2026-eepitch-evil.el
;;           (find-angg "elisp/2026-eepitch-evil.el")
;;  Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Version: 2026aug15
;;
;; A quick hack to let skulk use eepitch with evil-mode.
;; Probably very fragile!
;;
;; See: (find-es "eev" "skulk-eepitch-evil")
;;      (find-fline "~/LOGS/2026aug15.2026aug15" "\\r")

(defun ee-eval-with-evil-mode-off (str)
  (if (and (boundp 'evil-mode) evil-mode)
      (progn (evil-mode 0) (eek str) (evil-mode 1))
    (eek str)))

;; Choose one:
(defun eepitch-send-RET () (call-interactively (key-binding "\r")))
(defun eepitch-send-RET () (ee-eval-with-evil-mode-off '(eek "RET")))
 
(defun eepitch-line (line)
  "Send LINE to the target window and run the key binding for RET there.
If the value in the variable `eepitch-line' is non-nil then call
the function in that variable instead of running the default code.
This is a low-level function used by `eepitch-this-line'."
  (if eepitch-line
      (funcall eepitch-line line)
    (eepitch-eval-at-target-window	                 ; Default behavior:
     '(progn (goto-char (point-max))	                 ; at the end of buffer
	     (insert line)                               ; "type" the line
	     ;; (call-interactively (key-binding "\r"))  ; then do a RET
	     (eepitch-send-RET)
	     ))))







;; Local Variables:
;; coding:  utf-8-unix
;; End:
