aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2007-12-19 09:25:18 +0000
committerMartin Rudalics2007-12-19 09:25:18 +0000
commit772111be139c5065327786bed163a92dda12acb6 (patch)
tree6a465f2878ec2ba9588a011b0956f9197950e6e3
parentd6a4ad74755e30a7926b43263310973d9578193f (diff)
downloademacs-772111be139c5065327786bed163a92dda12acb6.tar.gz
emacs-772111be139c5065327786bed163a92dda12acb6.zip
(vc-ensure-vc-buffer): Avoid infinite looping when
vc-parent-buffer is the current buffer.
-rw-r--r--lisp/vc.el5
1 files changed, 4 insertions, 1 deletions
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."
1297 "Make sure that the current buffer visits a version-controlled file." 1297 "Make sure that the current buffer visits a version-controlled file."
1298 (if vc-dired-mode 1298 (if vc-dired-mode
1299 (set-buffer (find-file-noselect (dired-get-filename))) 1299 (set-buffer (find-file-noselect (dired-get-filename)))
1300 (while vc-parent-buffer 1300 (while (and vc-parent-buffer
1301 ;; Avoid infinite looping when vc-parent-buffer and
1302 ;; current buffer are the same buffer.
1303 (not (eq vc-parent-buffer (current-buffer))))
1301 (set-buffer vc-parent-buffer)) 1304 (set-buffer vc-parent-buffer))
1302 (if (not buffer-file-name) 1305 (if (not buffer-file-name)
1303 (error "Buffer %s is not associated with a file" (buffer-name)) 1306 (error "Buffer %s is not associated with a file" (buffer-name))