mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-01 11:14:55 +00:00
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.
This commit is contained in:
parent
8610fe8b84
commit
1ed43b0999
@ -1,3 +1,11 @@
|
||||
2011-08-24 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* 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 <juri@jurta.org>
|
||||
|
||||
* isearch.el (isearch-ring-adjust1): Start visiting previous
|
||||
|
@ -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))
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user