diff options
| author | Richard M. Stallman | 1999-08-29 21:20:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-08-29 21:20:20 +0000 |
| commit | ab3b61015a16f208a3d8fbb05c56fd40707e62fa (patch) | |
| tree | d1c44b1be4c1b0def3bb83b7ecc20fda24c4f256 /lisp | |
| parent | bc29fd5ff8330481b3c739eeca4e3ae5dbc01c19 (diff) | |
| download | emacs-ab3b61015a16f208a3d8fbb05c56fd40707e62fa.tar.gz emacs-ab3b61015a16f208a3d8fbb05c56fd40707e62fa.zip | |
(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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/textmodes/bibtex.el | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 357e5e75e66..d9513f13601 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -2539,23 +2539,16 @@ non-nil. | |||
| 2539 | (if (< item size) | 2539 | (if (< item size) |
| 2540 | ;; file was found | 2540 | ;; file was found |
| 2541 | (let ((case-fold-search t) | 2541 | (let ((case-fold-search t) |
| 2542 | (curbuf (current-buffer)) | 2542 | (compl nil)) |
| 2543 | (bufname (make-temp-name "")) | 2543 | (with-temp-buffer |
| 2544 | (compl bibtex-strings)) | 2544 | (insert-file-contents fullfilename) |
| 2545 | (create-file-buffer bufname) | 2545 | (goto-char (point-min)) |
| 2546 | (set-buffer bufname) | 2546 | (while (re-search-forward bibtex-string nil t) |
| 2547 | (insert-file-contents fullfilename) | 2547 | (setq compl |
| 2548 | (goto-char (point-min)) | 2548 | (cons (list (match-string-no-properties |
| 2549 | (while (re-search-forward bibtex-string nil t) | 2549 | bibtex-key-in-string)) |
| 2550 | (setq compl | 2550 | compl)))) |
| 2551 | (append compl | 2551 | (setq bibtex-strings (append bibtex-strings (nreverse compl)))) |
| 2552 | (list | ||
| 2553 | (list (buffer-substring-no-properties | ||
| 2554 | (match-beginning bibtex-key-in-string) | ||
| 2555 | (match-end bibtex-key-in-string))))))) | ||
| 2556 | (kill-buffer bufname) | ||
| 2557 | (set-buffer curbuf) | ||
| 2558 | (setq bibtex-strings compl)) | ||
| 2559 | (error | 2552 | (error |
| 2560 | "File %s not in paths defined by bibtex-string-file-path variable" | 2553 | "File %s not in paths defined by bibtex-string-file-path variable" |
| 2561 | filename)))) | 2554 | filename)))) |