# HG changeset patch # User Martin Rudalics # Date 1198056318 0 # Node ID bad7c1eb53922472a1908fa7acad4bbe395ade81 # Parent 9088a29785d119fd9620c4d68d19a7bdd2556968 (vc-ensure-vc-buffer): Avoid infinite looping when vc-parent-buffer is the current buffer. diff -r 9088a29785d1 -r bad7c1eb5392 lisp/vc.el --- a/lisp/vc.el Wed Dec 19 09:24:31 2007 +0000 +++ b/lisp/vc.el Wed Dec 19 09:25:18 2007 +0000 @@ -1297,7 +1297,10 @@ "Make sure that the current buffer visits a version-controlled file." (if vc-dired-mode (set-buffer (find-file-noselect (dired-get-filename))) - (while vc-parent-buffer + (while (and vc-parent-buffer + ;; Avoid infinite looping when vc-parent-buffer and + ;; current buffer are the same buffer. + (not (eq vc-parent-buffer (current-buffer)))) (set-buffer vc-parent-buffer)) (if (not buffer-file-name) (error "Buffer %s is not associated with a file" (buffer-name))