From 779e3a4faeba6f43e7430131afc2898812a0a782 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 18 Aug 2023 01:00:08 +0200 Subject: emacs: Don’t kill buffers used by other frames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/emacs/config.org | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to '.config/emacs') diff --git a/.config/emacs/config.org b/.config/emacs/config.org index 3ce52c6..96f0614 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -952,16 +952,22 @@ kill all buffers you were using in a frame before closing it. #+BEGIN_SRC elisp - (use-package beframe - :init - (beframe-mode)) - - (defun mango-beframe-kill-frame () + (defun mango-beframe-delete-frame () "Kill all the buffers within the current beframe buffer list and then destroy the frame." (interactive) - (mapc #'kill-buffer (beframe-buffer-list)) - (save-buffers-kill-terminal)) + (cl-loop with buffers = (cl-loop for frame in (frame-list) + unless (eq frame (selected-frame)) + append (beframe-buffer-list frame)) + for buffer in (beframe-buffer-list) + unless (member buffer buffers) + do (kill-buffer buffer)) + (delete-frame)) + + (use-package beframe + :bind ([remap delete-frame] . mango-beframe-delete-frame) + :init + (beframe-mode)) #+END_SRC -- cgit v1.2.3