changeset 78189:253d28d87f2a

(reftex-access-parse-file): Do not risk destroying an existing buffer.
author Reiner Steib <Reiner.Steib@gmx.de>
date Sun, 22 Jul 2007 18:55:07 +0000
parents 748ea3258d7d
children 1837795ece51
files lisp/ChangeLog lisp/textmodes/reftex.el
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Jul 22 12:17:31 2007 +0000
+++ b/lisp/ChangeLog	Sun Jul 22 18:55:07 2007 +0000
@@ -1,3 +1,8 @@
+2007-07-22  Ralf Angeli  <angeli@caeruleus.net>
+
+	* textmodes/reftex.el (reftex-access-parse-file): Do not risk
+	destroying an existing buffer.
+
 2007-07-22  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* startup.el (command-line-x-option-alist): Use x-handle-no-bitmap-icon.
--- a/lisp/textmodes/reftex.el	Sun Jul 22 12:17:31 2007 +0000
+++ b/lisp/textmodes/reftex.el	Sun Jul 22 18:55:07 2007 +0000
@@ -1331,10 +1331,8 @@
       (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 @@
                           )
                          (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))))