-;;; refer.el --- look up references in bibliography files.
+;;; refer.el --- look up references in bibliography files
-;; Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1996, 2001, 2004 Free Software Foundation, Inc.
;; Author: Ashwin Ram <ashwin@cc.gatech.edu>
-;; Maintainer: Gernot Heiser <gernot@jungfrau.disy.cse.unsw.EDU.AU>
+;; Maintainer: Gernot Heiser <gernot@acm.org>
;; Adapted-By: ESR
;; Keywords: bib
(if (looking-at
"[ \t\n]*@\\s-*[a-zA-Z][a-zA-Z0-9]*\\s-*{\\s-*\\([^ \t\n,]+\\)\\s-*,")
(buffer-substring (match-beginning 1) (match-end 1))
- (error "Cannot find key for entry in file %s."
+ (error "Cannot find key for entry in file %s"
(car refer-saved-state))))))
(if (not (= (point) old-point))
(set-mark old-point))))
;; if a bibliography file is already displayed in a window, use
;; that one, otherwise use any window other than the current one
(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)))
+ (get-window-with-predicate
+ (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)
(throw 'found (find-file file)))
(setq refer-saved-pos nil
files (cdr files)))
- (progn (message "Scanning %s... No such file" (car files) (ding))
+ (progn (ding)
+ (message "Scanning %s... No such file" (car files))
(sit-for 1)
(setq files (cdr files))))))
- (message "Keywords \"%s\" not found in any \.bib file" keywords (ding)))
+ (ding)
+ (message "Keywords \"%s\" not found in any \.bib file" keywords))
(select-window old-window)))
(defun refer-find-entry-in-file (keywords-list file &optional old-pos)
(list refer-bib-directory))))
(files
(cond
- ((null refer-bib-files)
+ ((null refer-bib-files)
(list (expand-file-name
(if (eq major-mode 'bibtex-mode)
(read-file-name
(setq refer-bib-files files))
files))
+;;; arch-tag: 151f641b-e79b-462b-9a29-a95c3793f300
;;; refer.el ends here
-