1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

(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.
This commit is contained in:
Richard M. Stallman 1999-08-29 21:20:20 +00:00
parent bc29fd5ff8
commit ab3b61015a

View File

@ -2539,23 +2539,16 @@ non-nil.
(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))))