aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2011-08-24 13:38:46 -0400
committerChong Yidong <[email protected]>2011-08-24 13:38:46 -0400
commit1ed43b0999487094d4082e431947d48bd8feb2bb (patch)
treedb9433372dd45400d202b37179940cb5a7e04575
parent8610fe8b84e22f5d962f5e480001748a6687a3b2 (diff)
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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/view.el4
-rw-r--r--lisp/window.el54
3 files changed, 18 insertions, 48 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6716a879a7..2335f3780d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2011-08-24 Chong Yidong <[email protected]>
+
+ * 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 <[email protected]>
* isearch.el (isearch-ring-adjust1): Start visiting previous
diff --git a/lisp/view.el b/lisp/view.el
index 21479a70a7..be011d217f 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 75fa0b46a1..fb9d38c650 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.