changeset 29997:d6a745cf3bfc

(refer-find-entry-internal): Use some-window instead of cycling through windows with next-window.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 03 Jul 2000 09:10:44 +0000
parents f784be5b6130
children 275ab94028be
files lisp/textmodes/refer.el
diffstat 1 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/refer.el	Mon Jul 03 07:51:52 2000 +0000
+++ b/lisp/textmodes/refer.el	Mon Jul 03 09:10:44 2000 +0000
@@ -195,21 +195,19 @@
      ;; find window in which to display bibliography file.
      ;; if a bibliography file is already displayed in a window, use
      ;; that one, otherwise use any window other than the current one
-     (while (not found)
-       (while (and (not (null (setq file (nth n files))))
-                   (setq n (1+ n))
-                   (not (string-equal file
-                                      (buffer-file-name
-                                       (window-buffer new-window))))))
-       (setq found
-             (if (null file)
-                 (eq (setq new-window (next-window new-window 'nomini))
-                     old-window)
-               't)))
-     (if (null file)                     ; didn't find bib file in any window:
-         (progn (if (one-window-p 'nomini)
-                    (setq old-window (split-window)))
-                (setq new-window (next-window old-window 'nomini))))
+     (setq new-window
+	   (some-window (lambda (w)
+			  (while (and (not (null (setq file (nth n files))))
+				      (setq n (1+ n))
+				      (not (string-equal file
+							 (buffer-file-name
+							  (window-buffer w))))))
+			  file)))
+     (unless new-window
+       ;; didn't find bib file in any window:
+       (when (one-window-p 'nomini)
+	 (setq old-window (split-window)))
+       (setq new-window (next-window old-window 'nomini)))
      (select-window (if refer-same-file
                         old-window
                       new-window))  ; the window in which to show the bib file