;;; term/eat/autoload.el -*- lexical-binding: t; -*- ;;;###autoload (defun +eat/toggle (arg &optional) (interactive "P") (let* ((default-directory (project-root (project-current t))) (eat-kill-buffer-on-exit 't) (eat-buffer-name (format "*doom:eat-popup:%s*" (if (bound-and-true-p persp-mode) (safe-persp-name (get-current-persp)) "main")))) (eat-other-window nil arg))) ;;;###autoload (defvar +eat-frame-parameters `((width . 110) (height . 35) (minibuffer . nil) (transient . t) ,@(when IS-LINUX `((window-system . ,(if (boundp 'pgtk-initialized) 'pgtk 'x)) (display . ,(or (getenv "WAYLAND_DISPLAY") (getenv "DISPLAY") ":0")))) ,(if IS-MAC '(menu-bar-lines . 1))) "TODO") ;;;###autoload (defun +eat/open-frame () (interactive) (let* ((frame-title-format "") (frame (make-frame +eat-frame-parameters))) (select-frame-set-input-focus frame) (with-selected-frame frame (switch-to-buffer (doom-fallback-buffer)) (let* ((eat-kill-buffer-on-exit 't) (default-directory "~") (eat-mode-hook (cons (lambda () (add-hook 'eat-exit-hook (lambda (_process) (delete-frame)) 91 t) ;; Disabling the modeline causes emacs to stop calling this function. ;; Replace with advising eat--t-set-title instead. (add-to-list 'mode-line-process '(:eval (when-let* ((eat-terminal) (title (eat-term-title eat-terminal))) (modify-frame-parameters nil `((name . ,title))) "")))) eat-mode-hook))) (eat nil t))))) ;; These clobber vterm bindings, so will need to pick alternatives. (map! :leader (:prefix-map ("o" . "open") :desc "Toggle Eat popup" "t" #'+eat/toggle :desc "Open Eat here" "T" #'eat-project))