From: Martin Rudalics Date: Wed, 19 Dec 2007 09:25:18 +0000 (+0000) Subject: (vc-ensure-vc-buffer): Avoid infinite looping when X-Git-Tag: emacs-pretest-23.0.90~8883 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=772111be139c5065327786bed163a92dda12acb6;p=emacs.git (vc-ensure-vc-buffer): Avoid infinite looping when vc-parent-buffer is the current buffer. --- diff --git a/lisp/vc.el b/lisp/vc.el index 9757161b7ad..7d843b934c5 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1297,7 +1297,10 @@ Otherwise, throw an error." "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))