summaryrefslogtreecommitdiff
path: root/lisp/textmodes/refer.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-07-03 09:10:44 +0000
committerGerd Moellmann <gerd@gnu.org>2000-07-03 09:10:44 +0000
commit90601de977560fa533fc80a7f299857d33869a95 (patch)
tree42bb2c690b67b57071592f0a5cc55fd57ce78a70 /lisp/textmodes/refer.el
parent831a6cb01c5b5159f8559a22fd7025f659ebb35f (diff)
downloademacs-90601de977560fa533fc80a7f299857d33869a95.tar.gz
(refer-find-entry-internal): Use some-window
instead of cycling through windows with next-window.
Diffstat (limited to 'lisp/textmodes/refer.el')
-rw-r--r--lisp/textmodes/refer.el28
1 files changed, 13 insertions, 15 deletions
diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el
index 6d710e8d8b5..92b18a01b7b 100644
--- a/lisp/textmodes/refer.el
+++ b/lisp/textmodes/refer.el
@@ -195,21 +195,19 @@ found on the last refer-find-entry or refer-find-next-entry."
;; 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