-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
including dired in crux-kill-other-buffers #49
Comments
You want a command to kill just buffers with a particular major mode or what? |
Let me explain it with one example. One possible solution is like you said, considering the setup of a particular major mode in |
I also need crux command. something like |
any updates regarding this feature request ? |
For now I can use
|
@mambolevis maybe you need this (defun kill-other-buffers ()
"Kill all other buffers."
(interactive)
(mapc 'kill-buffer (delq (current-buffer) (buffer-list)))) Taken from Kill Other Buffers But it will kill everything. crux-kill-other-buffers doesn't kill everything. Because it use The above code will kill everything. Because it just kill whatever (require 'cl)
;;;###autoload
(defun noprompt-kill-buffers ()
"Kill buffers matching REGEXP without asking for confirmation."
(interactive)
(flet ((kill-buffer-ask (buffer) (kill-buffer buffer)))
(kill-matching-buffers "^[^\*]"))) ;;all buffers that doesn't start with *
I think I can improve the regex value to make it more robust. Update: Fresh new version :) ;;;###autoload
(defun aza-kill-other-buffers ()
"Kill all buffers but current buffer and special buffers"
(interactive)
(dolist (buffer (delq (current-buffer) (buffer-list)))
(let ((name (buffer-name buffer)))
(when (string-match "^[^\*]" name)
(funcall 'kill-buffer buffer)))))
|
Hi,
I think it is good idea to consider dired buffers in
crux-kill-other-buffers
function:Something like this:
Thanks
Levis
The text was updated successfully, but these errors were encountered: