GNU bug report logs -
#32790
27.0.50; point jumps unexpectedly after delete-window
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Thu, 20 Sep 2018 23:57:01 UTC
Severity: minor
Found in version 27.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #161 received at 32790 <at> debbugs.gnu.org (full text, mbox):
FWIW -
I distinguish interactive use of `kill-buffer' from
programmatic use. Interactively I want any windows
showing the buffer to disappear too. Interactively
I substitute `kill-buffer-and-its-windows'. I've
been doing this at least since the mid-90s.
Dunno whether I'm alone in this preference, or would
be even if it were offered more widely.
Just for reference, here's the definition I'm still
using, but you can no doubt come up with something
better or more recent.
(defun kill-buffer-and-its-windows (buffer)
"Kill BUFFER and delete its windows."
(interactive (list (read-buffer "Kill buffer: "
(current-buffer)
'existing)))
(setq buffer (get-buffer buffer))
(if (buffer-live-p buffer)
(let ((wins (get-buffer-window-list buffer nil t)))
(when (kill-buffer buffer)
(dolist (win wins)
(when (window-live-p win)
(condition-case nil
(delete-window win)
(error nil))))))
(when (interactive-p)
(error "Cannot kill buffer. Not a live buffer: `%s'"
buffer))))
This bug report was last modified 5 years and 235 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.