diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-08-18 01:00:08 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-08-18 01:00:08 +0200 |
commit | 779e3a4faeba6f43e7430131afc2898812a0a782 (patch) | |
tree | dfb05041d45a2a58c828c3174f3cb09a04dee4a2 /.config/emacs/config.org | |
parent | afd8278faa40999377169ab0b3922c1f7e715e3e (diff) |
emacs: Don’t kill buffers used by other frames
Diffstat (limited to '.config/emacs/config.org')
-rw-r--r-- | .config/emacs/config.org | 20 |
1 files changed, 13 insertions, 7 deletions
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 |