From b138739a63de13ad8918f634f2054badbbacc800 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 10 Jun 2024 02:31:25 +0100 Subject: (Emacs)~Clean buffer list code --- Emacs/.config/emacs/config.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Emacs/.config/emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 4e0d4be..54d37d3 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -181,13 +181,13 @@ any buffers in ~+oreo/keep-buffer~ and kills the rest. "*Warnings*" "*eshell*") "List of buffer names to preserve.") -(defun +oreo/clean-buffer-list () +(defun +oreo/clean-buffers () "Kill all buffers except any with names in +oreo/keep-buffers." (interactive) - (mapcar #'(lambda (buf) - (if (not (member (buffer-name buf) +oreo/keep-buffers)) - (kill-buffer buf))) - (buffer-list))) + (mapcar #'kill-buffer + (cl-remove-if + #'(lambda (buf) (member (buffer-name buf) +oreo/keep-buffers)) + (buffer-list)))) #+end_src * Aesthetics General look and feel of Emacs (mostly disabling stuff I don't like). @@ -508,7 +508,7 @@ Some bindings that I couldn't fit elsewhere easily. "K" #'kill-buffer "j" #'next-buffer "k" #'previous-buffer - "D" '(+oreo/clean-buffer-list :which-key "Kill most buffers")) + "D" '(+oreo/clean-buffers :which-key "Kill most buffers")) (quit-leader "q" #'save-buffers-kill-terminal -- cgit v1.2.3-13-gbd6f