[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/window.el,v

From: David Kastrup
Subject: [Emacs-diffs] Changes to emacs/lisp/window.el,v
Date: Fri, 20 Oct 2006 15:12:33 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     David Kastrup <dak>     06/10/20 15:12:32

Index: window.el
RCS file: /sources/emacs/emacs/lisp/window.el,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -b -r1.117 -r1.118
--- window.el   8 Sep 2006 14:15:02 -0000       1.117
+++ window.el   20 Oct 2006 15:12:31 -0000      1.118
@@ -719,17 +719,25 @@
   "Kill the current buffer and delete the selected window."
   (let ((window-to-delete (selected-window))
+       (buffer-to-kill (current-buffer))
        (delete-window-hook (lambda ()
                              (condition-case nil
                                (error nil)))))
+    (unwind-protect
+       (progn
     (add-hook 'kill-buffer-hook delete-window-hook t t)
     (if (kill-buffer (current-buffer))
        ;; If `delete-window' failed before, we rerun it to regenerate
-       ;; the error so it can be seen in the minibuffer.
+             ;; the error so it can be seen in the echo area.
        (when (eq (selected-window) window-to-delete)
-         (delete-window))
-      (remove-hook 'kill-buffer-hook delete-window-hook t))))
+               (delete-window))))
+      ;; If the buffer is not dead for some reason (probably because
+      ;; of a `quit' signal), remove the hook again.
+      (condition-case nil
+         (with-current-buffer buffer-to-kill
+           (remove-hook 'kill-buffer-hook delete-window-hook t))
+       (error nil)))))
 (defun quit-window (&optional kill window)
   "Quit the current buffer.  Bury it, and maybe delete the selected frame.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]