From 49bbf1b953d9ef97fa9398a90e66b6f9fc340321 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Sun, 22 Jul 2007 18:55:07 +0000 Subject: (reftex-access-parse-file): Do not risk destroying an existing buffer. --- lisp/textmodes/reftex.el | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lisp/textmodes/reftex.el') diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 4b34c67aee3..200d271d631 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -1331,10 +1331,8 @@ Valid actions are: readable, restore, read, kill, write." (put docstruct-symbol 'modified nil) (save-excursion (if (file-writable-p file) - (progn + (with-temp-file file (message "Writing parse file %s" (abbreviate-file-name file)) - (set-buffer (get-buffer-create file)) - (erase-buffer) (insert (format ";; RefTeX parse info file\n")) (insert (format ";; File: %s\n" master)) (insert (format ";; User: %s (%s)\n\n" @@ -1357,9 +1355,7 @@ Valid actions are: readable, restore, read, kill, write." ) (t (print x)))) list)) - (insert "))\n\n") - (write-region (point-min) (point-max) file nil 'silent) - (kill-buffer (current-buffer))) + (insert "))\n\n")) (error "Cannot write to file %s" file))) t)))) -- cgit v1.2.1