diff options
| author | Martin Rudalics | 2011-10-10 19:52:03 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-10-10 19:52:03 +0200 |
| commit | 366ca7f3da85b695afa34c3c3270b16a16d47f42 (patch) | |
| tree | ea5b9cb51b10e48b8165da7b3609f525b5385989 | |
| parent | 0563dae9a9e3a8c2b6de454693c0cc207e67f05d (diff) | |
| download | emacs-366ca7f3da85b695afa34c3c3270b16a16d47f42.tar.gz emacs-366ca7f3da85b695afa34c3c3270b16a16d47f42.zip | |
In vc actions use quit-windows-on instead of delete-windows-on.
* window.el (quit-windows-on): New function.
* vc/vc.el (vc-revert, vc-rollback):
* vc/vc-dispatcher.el (vc-finish-logentry): Call quit-windows-on
instead of deleting windows. (Bug#4557) (Bug#5310) (Bug#5556)
(Bug#6183) (Bug#7074)((Bug#7447)
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/vc/vc-dispatcher.el | 21 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 6 | ||||
| -rw-r--r-- | lisp/window.el | 21 |
4 files changed, 38 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 103d7b25518..7b9adfd1279 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -3,6 +3,12 @@ | |||
| 3 | * window.el (special-display-buffer-names) | 3 | * window.el (special-display-buffer-names) |
| 4 | (special-display-regexps): Remove some remnants of earlier | 4 | (special-display-regexps): Remove some remnants of earlier |
| 5 | changes from doc-strings. | 5 | changes from doc-strings. |
| 6 | (quit-windows-on): New function. | ||
| 7 | |||
| 8 | * vc/vc.el (vc-revert, vc-rollback): | ||
| 9 | * vc/vc-dispatcher.el (vc-finish-logentry): Call quit-windows-on | ||
| 10 | instead of deleting windows. (Bug#4557) (Bug#5310) (Bug#5556) | ||
| 11 | (Bug#6183) (Bug#7074)((Bug#7447) | ||
| 6 | 12 | ||
| 7 | 2011-10-09 Martin Rudalics <rudalics@gmx.at> | 13 | 2011-10-09 Martin Rudalics <rudalics@gmx.at> |
| 8 | 14 | ||
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 388d4c94a08..84c7f4a510b 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el | |||
| @@ -666,18 +666,15 @@ the buffer contents as a comment." | |||
| 666 | (funcall log-operation | 666 | (funcall log-operation |
| 667 | log-fileset | 667 | log-fileset |
| 668 | log-entry)) | 668 | log-entry)) |
| 669 | ;; Remove checkin window (after the checkin so that if that fails | 669 | |
| 670 | ;; we don't zap the log buffer and the typing therein). | 670 | ;; Quit windows on logbuf. |
| 671 | ;; -- IMO this should be replaced with quit-window | 671 | (cond |
| 672 | (cond ((and logbuf vc-delete-logbuf-window) | 672 | ((not logbuf)) |
| 673 | (delete-windows-on logbuf (selected-frame)) | 673 | (vc-delete-logbuf-window |
| 674 | ;; Kill buffer and delete any other dedicated windows/frames. | 674 | (quit-windows-on logbuf t (selected-frame))) |
| 675 | (kill-buffer logbuf)) | 675 | (t |
| 676 | (logbuf | 676 | (quit-windows-on logbuf nil 0))) |
| 677 | (with-selected-window (or (get-buffer-window logbuf 0) | 677 | |
| 678 | (selected-window)) | ||
| 679 | (with-current-buffer logbuf | ||
| 680 | (bury-buffer))))) | ||
| 681 | ;; Now make sure we see the expanded headers | 678 | ;; Now make sure we see the expanded headers |
| 682 | (when log-fileset | 679 | (when log-fileset |
| 683 | (mapc | 680 | (mapc |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 6704a43e59b..62536fd94be 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -2302,8 +2302,7 @@ to the working revision (except for keyword expansion)." | |||
| 2302 | (if (= nfiles 1) "" "s")))))) | 2302 | (if (= nfiles 1) "" "s")))))) |
| 2303 | (error "Revert canceled"))) | 2303 | (error "Revert canceled"))) |
| 2304 | (when diff-buffer | 2304 | (when diff-buffer |
| 2305 | (delete-windows-on diff-buffer) | 2305 | (quit-windows-on diff-buffer t))) |
| 2306 | (kill-buffer diff-buffer))) | ||
| 2307 | (dolist (file files) | 2306 | (dolist (file files) |
| 2308 | (message "Reverting %s..." (vc-delistify files)) | 2307 | (message "Reverting %s..." (vc-delistify files)) |
| 2309 | (vc-revert-file file) | 2308 | (vc-revert-file file) |
| @@ -2349,8 +2348,7 @@ depending on the underlying version-control system." | |||
| 2349 | ;; Display changes | 2348 | ;; Display changes |
| 2350 | (unless (yes-or-no-p "Discard these revisions? ") | 2349 | (unless (yes-or-no-p "Discard these revisions? ") |
| 2351 | (error "Rollback canceled")) | 2350 | (error "Rollback canceled")) |
| 2352 | (delete-windows-on "*vc-diff*") | 2351 | (quit-windows-on "*vc-diff*" t) |
| 2353 | (kill-buffer"*vc-diff*") | ||
| 2354 | ;; Do the actual reversions | 2352 | ;; Do the actual reversions |
| 2355 | (message "Rolling back %s..." (vc-delistify files)) | 2353 | (message "Rolling back %s..." (vc-delistify files)) |
| 2356 | (with-vc-properties | 2354 | (with-vc-properties |
diff --git a/lisp/window.el b/lisp/window.el index 7241e148dae..4d8b3c92b95 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -2984,6 +2984,27 @@ one. If non-nil, reset `quit-restore' parameter to nil." | |||
| 2984 | (if kill | 2984 | (if kill |
| 2985 | (kill-buffer buffer) | 2985 | (kill-buffer buffer) |
| 2986 | (bury-buffer-internal buffer)))) | 2986 | (bury-buffer-internal buffer)))) |
| 2987 | |||
| 2988 | (defun quit-windows-on (&optional buffer-or-name kill frame) | ||
| 2989 | "Quit all windows showing BUFFER-OR-NAME. | ||
| 2990 | BUFFER-OR-NAME may be a buffer or the name of an existing buffer | ||
| 2991 | and defaults to the current buffer. Optional argument KILL | ||
| 2992 | non-nil means to kill BUFFER-OR-NAME. KILL nil means to bury | ||
| 2993 | BUFFER-OR-NAME. Optional argument FRAME is handled as by | ||
| 2994 | `delete-windows-on'. | ||
| 2995 | |||
| 2996 | This function calls `quit-window' on all candidate windows | ||
| 2997 | showing BUFFER-OR-NAME." | ||
| 2998 | (interactive "BQuit windows on (buffer):\nP") | ||
| 2999 | (let ((buffer (window-normalize-buffer buffer-or-name)) | ||
| 3000 | ;; Handle the "inverted" meaning of the FRAME argument wrt other | ||
| 3001 | ;; `window-list-1' based function. | ||
| 3002 | (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame)))) | ||
| 3003 | (dolist (window (window-list-1 nil nil all-frames)) | ||
| 3004 | (if (eq (window-buffer window) buffer) | ||
| 3005 | (quit-window kill window) | ||
| 3006 | ;; If a window doesn't show BUFFER, unrecord BUFFER in it. | ||
| 3007 | (unrecord-window-buffer window buffer))))) | ||
| 2987 | 3008 | ||
| 2988 | ;;; Splitting windows. | 3009 | ;;; Splitting windows. |
| 2989 | (defsubst window-split-min-size (&optional horizontal) | 3010 | (defsubst window-split-min-size (&optional horizontal) |