GNU bug report logs - #5310
23.1; vc-revert modifies window configuration

Previous Next

Package: emacs;

Reported by: Nathaniel Flath <flat0103 <at> gmail.com>

Date: Tue, 5 Jan 2010 14:09:06 UTC

Severity: normal

Tags: patch

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nathaniel Flath <flat0103 <at> gmail.com>
To: 5310 <at> debbugs.gnu.org
Subject: bug#5310: Patch Attached
Date: Fri, 29 Jan 2010 22:14:02 -0500
[Message part 1 (text/plain, inline)]
My apologies - looking at this in the bug tracker does not appear to show
the patch.  I must have forgotten to attach it, somehow.  The patch is as
follows:

--- vc.el    7 Dec 2009 09:02:16 -0000    1.746
+++ vc.el    4 Jan 2010 04:10:54 -0000
@@ -1975,37 +1975,38 @@
 This asks for confirmation if the buffer contents are not identical
 to the working revision (except for keyword expansion)."
   (interactive)
-  (let* ((vc-fileset (vc-deduce-fileset))
-     (files (cadr vc-fileset)))
-    ;; If any of the files is visited by the current buffer, make
-    ;; sure buffer is saved.  If the user says `no', abort since
-    ;; we cannot show the changes and ask for confirmation to
-    ;; discard them.
-    (when (or (not files) (memq (buffer-file-name) files))
-      (vc-buffer-sync nil))
-    (dolist (file files)
-      (let ((buf (get-file-buffer file)))
-    (when (and buf (buffer-modified-p buf))
-      (error "Please kill or save all modified buffers before reverting")))
-      (when (vc-up-to-date-p file)
-    (unless (yes-or-no-p (format "%s seems up-to-date.  Revert anyway? "
file))
-      (error "Revert canceled"))))
-    (when (vc-diff-internal vc-allow-async-revert vc-fileset nil nil)
-      (unless (yes-or-no-p
-           (format "Discard changes in %s? "
-               (let ((str (vc-delistify files))
-                 (nfiles (length files)))
-             (if (< (length str) 50)
-                 str
-               (format "%d file%s" nfiles
-                   (if (= nfiles 1) "" "s"))))))
-    (error "Revert canceled"))
-      (delete-windows-on "*vc-diff*")
-      (kill-buffer "*vc-diff*"))
-    (dolist (file files)
-      (message "Reverting %s..." (vc-delistify files))
-      (vc-revert-file file)
-      (message "Reverting %s...done" (vc-delistify files)))))
+  (save-window-excursion
+   (let* ((vc-fileset (vc-deduce-fileset))
+          (files (cadr vc-fileset)))
+     ;; If any of the files is visited by the current buffer, make
+     ;; sure buffer is saved.  If the user says `no', abort since
+     ;; we cannot show the changes and ask for confirmation to
+     ;; discard them.
+     (when (or (not files) (memq (buffer-file-name) files))
+       (vc-buffer-sync nil))
+     (dolist (file files)
+       (let ((buf (get-file-buffer file)))
+         (when (and buf (buffer-modified-p buf))
+           (error "Please kill or save all modified buffers before
reverting")))
+       (when (vc-up-to-date-p file)
+         (unless (yes-or-no-p (format "%s seems up-to-date.  Revert anyway?
" file))
+           (error "Revert canceled"))))
+     (when (vc-diff-internal vc-allow-async-revert vc-fileset nil nil)
+       (unless (yes-or-no-p
+                (format "Discard changes in %s? "
+                        (let ((str (vc-delistify files))
+                              (nfiles (length files)))
+                          (if (< (length str) 50)
+                              str
+                            (format "%d file%s" nfiles
+                                    (if (= nfiles 1) "" "s"))))))
+         (error "Revert canceled"))
+       (delete-windows-on "*vc-diff*")
+       (kill-buffer "*vc-diff*"))
+     (dolist (file files)
+       (message "Reverting %s..." (vc-delistify files))
+       (vc-revert-file file)
+       (message "Reverting %s...done" (vc-delistify files))))))

 ;;;###autoload
 (defun vc-rollback ()
[Message part 2 (text/html, inline)]

This bug report was last modified 13 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.