Kill current buffer. Switch to next buffer if previous command was switching
to next buffer or this command itself allowing sequential closing of
uninteresting buffers."
--- a/.emacs-my Thu Apr 10 18:14:08 2014 +0300
+++ b/.emacs-my Fri Apr 11 12:02:49 2014 +0300
@@ -813,7 +813,16 @@
(global-set-key [?\C-x right] 'next-buffer)
(global-set-key [?\C-x left] 'previous-buffer)
(global-set-key (kbd "C-x C-k") 'kill-this-buffer)
-(global-set-key [?\C-x deletechar] 'kill-this-buffer)
+(defun my-kill-this-buffer-maybe-switch-to-next ()
+ "Kill current buffer. Switch to next buffer if previous command
+was switching to next buffer or this command itself allowing
+sequential closing of uninteresting buffers."
+ (interactive)
+ (let ( (cmd last-command) )
+ (kill-this-buffer)
+ (when (memq cmd (list 'next-buffer this-command))
+ (next-buffer))))
+(global-set-key [?\C-x deletechar] 'my-kill-this-buffer-maybe-switch-to-next)
(global-set-key [?\C-x up] '(lambda ()
(interactive)
(other-window -1)))