From: Chong Yidong Date: Wed, 24 Aug 2011 17:38:46 +0000 (-0400) Subject: Rename quit-restore-window into quit-window. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~70^2~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1ed43b0999487094d4082e431947d48bd8feb2bb;p=emacs.git Rename quit-restore-window into quit-window. * lisp/window.el (quit-window): Renamed from quit-restore-window. Use same arglist as old quit-window. (frame-auto-delete): Doc fix. * lisp/view.el (view-mode-exit): Use quit-window. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6716a879a76..2335f3780dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2011-08-24 Chong Yidong + + * window.el (quit-window): Renamed from quit-restore-window. Use + same arglist as old quit-window. + (frame-auto-delete): Doc fix. + + * view.el (view-mode-exit): Use quit-window. + 2011-08-24 Juri Linkov * isearch.el (isearch-ring-adjust1): Start visiting previous diff --git a/lisp/view.el b/lisp/view.el index 21479a70a72..be011d217fc 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -576,9 +576,9 @@ current buffer. " (cond ((or all-windows view-exits-all-viewing-windows) (dolist (window (get-buffer-window-list)) - (quit-restore-window window))) + (quit-window nil window))) ((eq (window-buffer) (current-buffer)) - (quit-restore-window))) + (quit-window))) (when exit-action (funcall exit-action buffer)) diff --git a/lisp/window.el b/lisp/window.el index 75fa0b46a1c..fb9d38c6503 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2272,7 +2272,7 @@ another frame still exists. Functions quitting a window and consequently affected by this variable are `switch-to-prev-buffer', `delete-windows-on', -`replace-buffer-in-windows' and `quit-restore-window'." +`replace-buffer-in-windows' and `quit-window'." :type '(choice (const :tag "Never" nil) (const :tag "Automatic" automatic) @@ -2907,21 +2907,17 @@ all window-local buffer lists." ;; Unrecord BUFFER in WINDOW. (unrecord-window-buffer window buffer))))) -(defun quit-restore-window (&optional window kill) - "Quit WINDOW in some way. -WINDOW must be a live window and defaults to the selected window. -Return nil. +(defun quit-window (&optional kill window) + "Quit WINDOW and bury its buffer. +WINDOW defaults to the selected window. +With a prefix argument, kill the buffer instead. According to information stored in WINDOW's `quit-restore' window parameter either \(1) delete WINDOW and its frame, \(2) delete WINDOW, \(3) restore the buffer previously displayed in WINDOW, or \(4) make WINDOW display some other buffer than the present -one. If non-nil, reset `quit-restore' parameter to nil. - -Optional argument KILL non-nil means in addition kill WINDOW's -buffer. If KILL is nil, put WINDOW's buffer at the end of the -buffer list. Interactively, KILL is the prefix argument." - (interactive "i\nP") +one. If non-nil, reset `quit-restore' parameter to nil." + (interactive "P") (setq window (window-normalize-live-window window)) (let ((buffer (window-buffer window)) (quit-restore (window-parameter window 'quit-restore)) @@ -2971,8 +2967,7 @@ buffer list. Interactively, KILL is the prefix argument." (switch-to-prev-buffer window 'bury-or-kill))) ;; Kill WINDOW's old-buffer if requested - (when kill (kill-buffer buffer)) - nil)) + (if kill (kill-buffer buffer)))) ;;; Splitting windows. (defsubst window-split-min-size (&optional horizontal) @@ -7045,39 +7040,6 @@ Return non-nil if the window was shrunk, nil otherwise." (with-current-buffer buffer-to-kill (remove-hook 'kill-buffer-hook delete-window-hook t)))))) -(defun quit-window (&optional kill window) - "Quit WINDOW and bury its buffer. -With a prefix argument, kill the buffer instead. WINDOW defaults -to the selected window. - -If WINDOW is non-nil, dedicated, or a minibuffer window, delete -it and, if it's alone on its frame, its frame too. Otherwise, or -if deleting WINDOW fails in any of the preceding cases, display -another buffer in WINDOW using `switch-to-buffer'. - -Optional argument KILL non-nil means kill WINDOW's buffer. -Otherwise, bury WINDOW's buffer, see `bury-buffer'." - (interactive "P") - (let ((buffer (window-buffer window))) - (if (or window - (window-minibuffer-p window) - (window-dedicated-p window)) - ;; WINDOW is either non-nil, a minibuffer window, or dedicated; - ;; try to delete it. - (let* ((window (or window (selected-window))) - (frame (window-frame window))) - (if (frame-root-window-p window) - ;; WINDOW is alone on its frame. - (delete-frame frame) - ;; There are other windows on its frame, delete WINDOW. - (delete-window window))) - ;; Otherwise, switch to another buffer in the selected window. - (switch-to-buffer nil)) - - ;; Deal with the buffer. - (if kill - (kill-buffer buffer) - (bury-buffer buffer)))) (defvar recenter-last-op nil "Indicates the last recenter operation performed.