;ELC ;;; compiled by rms@mole.gnu.ai.mit.edu on Sun May 22 18:31:46 1994 ;;; from file /home/fsf/rms/e19/lisp/refer.el ;;; emacs version 19.23.90.1. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/home/fsf/rms/e19/lisp/refer.el' was compiled for Emacs 19")) (provide (quote refer)) (defvar refer-bib-files (quote dir) "\ *List of \\.bib files to search for references, or one of the following special values: nil = prompt for \\.bib file (if visiting a \\.bib file, use it as default) auto = read \\.bib file names from appropriate command in buffer (see refer-bib-files-regexp) dir = use all \\.bib files in current directory. If a specified file doesn't exist and has no extension, a \\.bib extension is automatically tried. If refer-bib-files is nil, auto or dir, it is setq'd to the appropriate list of files when it is first used if refer-cache-bib-files is t. If refer-cache-bib-files is nil, the list of \\.bib files to use is re-read each time it is needed.") (defvar refer-cache-bib-files t "\ *Variable determining whether the value of refer-bib-files should be cached. If t, initialize the value of refer-bib-files the first time it is used. If nil, re-read the list of \\.bib files depending on the value of refer-bib-files each time it is needed.") (defvar refer-bib-files-regexp "\\\\bibliography" "\ *Regexp matching a bibliography file declaration. The current buffer is expected to contain a line such as \\bibliography{file1,file2,file3} which is read to set up refer-bib-files. The regexp must specify the command (such as \\bibliography) that is used to specify the list of bib files. The command is expected to specify a file name, or a list of comma-separated file names, within curly braces. If a specified file doesn't exist and has no extension, a \\.bib extension is automatically tried.") (byte-code "!!" [make-variable-buffer-local refer-bib-files refer-cache-bib-files] 2) (defalias 'refer-find-entry #[(keywords &optional continue) " \f\n! \"" [keywords continue refer-previous-keywords read-string "Keywords: " refer-find-entry-internal] 3 "\ Find entry in refer-bib-files containing KEYWORDS. If KEYWORDS is nil, prompt user for blank-separated list of keywords. If CONTINUE is t, or if called interactively with a prefix arg, look for next entry by continuing search from previous point." (list nil current-prefix-arg)]) (defalias 'refer-find-next-entry #[nil " \"" [refer-find-entry-internal refer-previous-keywords t] 3 "\ Find next occurrence of entry in refer-bib-files. See refer-find-entry." nil]) (byte-code "\"\"\"\"\"" [defalias refer-find-entry-internal #[(keywords continue) " !\n ȍ*" [convert-string-to-list-of-strings keywords continue refer-saved-state refer-get-bib-files files keywords-list found (byte-code "Q@!@@P!@P > #8 !\"MAM@ #!A) #" [files file-exists-p ".bib" file refer-saved-state refer-find-entry-in-file keywords-list continue throw found find-file message "Scanning %s... No such file" ding sit-for 1 "Keywords \"%s\" not found in any .bib file" keywords] 4)] 2] refer-find-entry-in-file #[(keywords-list file &optional continue) "\n\"\n!q\f!eb` \n  FmF!`\n\" !\n b! \\ b#\n\"b\n\"+" [message "Scanning %s..." file find-file-noselect continue forward-paragraph 1 0 nil found end begin every #[(keyword) "b\n #" [begin re-search-forward keyword end t] 4] keywords-list re-search-forward "\\W" t "Scanning %s... found" "Scanning %s... not found"] 5] every #[(pred l) "\n@!A?\nA\"" [l nil pred every] 3] convert-string-to-list-of-strings #[(s) "p!\nq !cebc#)ˉ#dbceb\n! q*" [get-buffer-create "*refer-temp*" temp-buffer current erase-buffer regexp-quote s "(\"" re-search-forward "[ ]+" nil t replace-match "\" \"" "\")" read] 4] refer-get-bib-files #[nil "+\n= !\" ! !$&̉$!C<4=ebP#`#!`{C!yu`#!`{C\"Y)!)=#\")" [refer-bib-files expand-file-name major-mode bibtex-mode read-file-name format ".bib file: (default %s) " file-name-nondirectory buffer-file-name file-name-directory t ".bib file: " nil auto re-search-forward refer-bib-files-regexp "{" "[,}]" backward-char 1 files looking-at "}" append error "No \\\\bibliography command in this buffer, can't read refer-bib-files" dir directory-files "." "\\.bib$" "Illegal value for refer-bib-files: %s" refer-cache-bib-files] 7]] 3)