emacs - A smarter alternative to delete-window? -
sometimes multiple windows open same buffer (or similar one) , have differentiate whether or not buffer in window same before deciding either kill or delete window.
is there way in emacs delete window if buffer exists in another? ideally same function kill buffer , window if instance of buffer in window.
(defun delete-extra-windows () (interactive) (let* ((selwin (selected-window)) (buf (window-buffer selwin))) (walk-windows (lambda (ww) (unless (eq ww selwin) (when (eq (window-buffer ww) buf) (delete-window ww)))) 'no-mini 'this-frame)))
Comments
Post a Comment