Subject: bug#94: Fwd: vc and vc-mtn interaction breaks files opening

From: Stefan Monnier <[email-masked]>
Date: Sat, 29 Mar 2008 15:32:54 -0400

> When I try to C-x C-f a file the file opens but the buffer isn't brought
> to front. Instead, the frame is split. Apparently, it is because of
> the following error message:

> vc-find-file-hook: Wrong type argument: stringp, nil

I suspect the problem is fixed by the patch below.

        Stefan

--- vc.el.~1.424.2.12.~	2008-02-04 10:26:11.000000000 -0500
+++ vc.el	2008-03-29 15:30:57.000000000 -0400
@@ -1047,9 +1047,14 @@
 	  (when (and (not (eq t okstatus))
                      (or (not (integerp status))
                          (and okstatus (< okstatus status))))
+            ;; Don't show internal temp buffers.  Especially since, together
+            ;; with with-temp-buffer and pop-up-frames, this can result in
+            ;; bugs where with-temp-buffer ends up not preserving
+            ;; current-buffer (because kill-buffer doesn't preserve it).
+            (unless (eq ?\s (aref (buffer-name (current-buffer)) 0))
 	    (pop-to-buffer (current-buffer))
 	    (goto-char (point-min))
-	    (shrink-window-if-larger-than-buffer)
+              (shrink-window-if-larger-than-buffer))
 	    (error "Running %s...FAILED (%s)" command
 		   (if (integerp status) (format "status %d" status) status))))
 	(if vc-command-messages