[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
vc vs window layout
vc vs window layout
Fri, 07 Oct 2011 18:29:16 +0200
Thunderbird 22.214.171.124 (Windows/20090302)
Ther are currently four pending bugs on vc not restoring the window
#4557 23.1; Commit via vc-dir does not restore window configuration
#5310 23.1; vc-revert modifies window configuration
#5556 [PATCH] vc-next-action destroys window configuration
#7447 vc-next-action does not restore frame configuration after C-c C-c
Could people please try the attached patch and check whether it (1) does
not break their usual working routine and (2) whether it does anything
useful wrt to these bugs. Since I'm currently not using vc I'm not very
sure how to test them.
=== modified file 'lisp/vc/vc-dispatcher.el'
--- lisp/vc/vc-dispatcher.el 2011-02-19 21:23:51 +0000
+++ lisp/vc/vc-dispatcher.el 2011-10-07 09:07:41 +0000
@@ -666,18 +666,15 @@
- ;; Remove checkin window (after the checkin so that if that fails
- ;; we don't zap the log buffer and the typing therein).
- ;; -- IMO this should be replaced with quit-window
- (cond ((and logbuf vc-delete-logbuf-window)
- (delete-windows-on logbuf (selected-frame))
- ;; Kill buffer and delete any other dedicated windows/frames.
- (kill-buffer logbuf))
- (with-selected-window (or (get-buffer-window logbuf 0)
- (with-current-buffer logbuf
+ ;; Quit windows on logbuf.
+ ((not logbuf))
+ (quit-windows-on logbuf t (selected-frame)))
+ (quit-windows-on logbuf nil 0)))
;; Now make sure we see the expanded headers
=== modified file 'lisp/vc/vc.el'
--- lisp/vc/vc.el 2011-07-13 07:58:34 +0000
+++ lisp/vc/vc.el 2011-10-07 09:08:38 +0000
@@ -2302,8 +2302,7 @@
(if (= nfiles 1) "" "s"))))))
(error "Revert canceled")))
- (delete-windows-on diff-buffer)
- (kill-buffer diff-buffer)))
+ (quit-windows-on diff-buffer t)))
(dolist (file files)
(message "Reverting %s..." (vc-delistify files))
@@ -2349,8 +2348,7 @@
;; Display changes
(unless (yes-or-no-p "Discard these revisions? ")
(error "Rollback canceled"))
- (delete-windows-on "*vc-diff*")
+ (quit-windows-on "*vc-diff*" t)
;; Do the actual reversions
(message "Rolling back %s..." (vc-delistify files))
=== modified file 'lisp/window.el'
--- lisp/window.el 2011-10-05 08:59:13 +0000
+++ lisp/window.el 2011-10-07 09:04:07 +0000
@@ -2980,6 +2980,27 @@
+(defun quit-windows-on (&optional buffer-or-name kill frame)
+ "Quit all windows showing BUFFER-OR-NAME.
+BUFFER-OR-NAME may be a buffer or the name of an existing buffer
+and defaults to the current buffer. Optional argument KILL
+non-nil means to kill BUFFER-OR-NAME. KILL nil means to bury
+BUFFER-OR-NAME. Optional argument FRAME is handled as by
+This function calls `quit-window' on all candidate windows
+ (interactive "BQuit windows on (buffer):\nP")
+ (let ((buffer (window-normalize-buffer buffer-or-name))
+ ;; Handle the "inverted" meaning of the FRAME argument wrt other
+ ;; `window-list-1' based function.
+ (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame))))
+ (dolist (window (window-list-1 nil nil all-frames))
+ (if (eq (window-buffer window) buffer)
+ (quit-window kill window)
+ ;; If a window doesn't show BUFFER, unrecord BUFFER in it.
+ (unrecord-window-buffer window buffer)))))
;;; Splitting windows.
(defsubst window-split-min-size (&optional horizontal)
- vc vs window layout,
martin rudalics <=