blob: d7107e6589855b5439bff861f9406347f56be3b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
;;; 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
`((name . "eat")
(width . 110)
(height . 35)
(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)) 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))
|