# HG changeset patch # User Richard M. Stallman # Date 935961620 0 # Node ID 37b1636d73d587d5d8a6b97fa41a477a2a40efc3 # Parent a4be8e9452ef0a32973cbc629ed4eeb1405f357a (bibtex-mode): Use with-temp-buffer rather than make-temp-name, use match-string-no-properties, and eliminate a quadratic behavior when building bibtex-strings. diff -r a4be8e9452ef -r 37b1636d73d5 lisp/textmodes/bibtex.el --- a/lisp/textmodes/bibtex.el Sun Aug 29 20:55:30 1999 +0000 +++ b/lisp/textmodes/bibtex.el Sun Aug 29 21:20:20 1999 +0000 @@ -2539,23 +2539,16 @@ (if (< item size) ;; file was found (let ((case-fold-search t) - (curbuf (current-buffer)) - (bufname (make-temp-name "")) - (compl bibtex-strings)) - (create-file-buffer bufname) - (set-buffer bufname) - (insert-file-contents fullfilename) - (goto-char (point-min)) - (while (re-search-forward bibtex-string nil t) - (setq compl - (append compl - (list - (list (buffer-substring-no-properties - (match-beginning bibtex-key-in-string) - (match-end bibtex-key-in-string))))))) - (kill-buffer bufname) - (set-buffer curbuf) - (setq bibtex-strings compl)) + (compl nil)) + (with-temp-buffer + (insert-file-contents fullfilename) + (goto-char (point-min)) + (while (re-search-forward bibtex-string nil t) + (setq compl + (cons (list (match-string-no-properties + bibtex-key-in-string)) + compl)))) + (setq bibtex-strings (append bibtex-strings (nreverse compl)))) (error "File %s not in paths defined by bibtex-string-file-path variable" filename))))