Emacs: Killing either vterm-scratch or the frame kills the other
This commit is contained in:
parent
e55f157b1e
commit
c60c7ed631
@ -1813,28 +1813,28 @@ the right frame, I'm going to use the frame's name to close and remove the hook
|
||||
|
||||
(defun joe/kill-frame ()
|
||||
(when (equal (buffer-name) "Scratch VTerm")
|
||||
(remove-hook 'delete-frame-functions #'joe/kill-vterm-scratch)
|
||||
(remove-hook 'kill-buffer-hook #'joe/kill-frame)
|
||||
(remove-function delete-frame-functions #'joe/kill-vterm-scratch)
|
||||
(delete-frame)))
|
||||
|
||||
(defun joe/kill-vterm-scratch ()
|
||||
(let ((kill-buffer-query-functions nil)
|
||||
(frame-name (substring-no-properties (cdr (assoc 'name (frame-parameters))))))
|
||||
(message "Frame Name: %s" frame-name)
|
||||
(when (equal frame-name "emacs-vterm-scratch")
|
||||
(message "VTerm Scratch Buffer? %s" (get-buffer "Scratch VTerm"))
|
||||
(kill-buffer (get-buffer "Scratch VTerm"))
|
||||
(message "Did we kill it? %s" (get-buffer "Scratch VTerm"))
|
||||
(remove-function delete-frame-functions #'joe/kill-vterm-scratch)
|
||||
(defun joe/kill-vterm-scratch (FRAME)
|
||||
(let* ((kill-buffer-query-functions nil)
|
||||
(scratch-framep (cdr (assoc 'scratch-frame (frame-parameters))))
|
||||
(vterm-buf (get-buffer "Scratch VTerm")))
|
||||
(when (and scratch-framep
|
||||
vterm-buf)
|
||||
(kill-buffer vterm-buf)
|
||||
(remove-hook 'delete-frame-functions #'joe/kill-vterm-scratch)
|
||||
(remove-hook 'kill-buffer-hook #'joe/kill-frame))))
|
||||
|
||||
(defun joe/vterm-scratch ()
|
||||
(interactive)
|
||||
(let* ((vterm-buf (vterm--internal #'switch-to-buffer "Scratch VTerm")))
|
||||
(set-frame-parameter nil 'scratch-frame t)
|
||||
(with-current-buffer vterm-buf
|
||||
(setq popper-popup-status 'raised)
|
||||
(olivetti-mode)
|
||||
(add-function :before delete-frame-functions #'joe/kill-vterm-scratch)
|
||||
(add-hook 'delete-frame-functions #'joe/kill-vterm-scratch)
|
||||
(add-hook 'kill-buffer-hook #'joe/kill-frame))))
|
||||
#+end_src
|
||||
|
||||
|
@ -208,7 +208,7 @@ hc rule floatplacement=center
|
||||
#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
|
||||
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
|
||||
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
|
||||
hc rule title='emacs-run-launcher' floating=on floatplacement=center
|
||||
hc rule title~'emacs-run-.*' floating=on floatplacement=center
|
||||
hc rule title~'^Glut.*' floating=on floatplacement=center
|
||||
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
|
||||
hc rule fixedsize floating=on
|
||||
|
Loading…
x
Reference in New Issue
Block a user