# HG changeset patch # User Karl Fogel # Date 1131827422 0 # Node ID 871ff6d8055343a53326a71f43b66ef45eefeb05 # Parent efab878cd2e1938abf1ca990fc545c418c31225d (bookmark-write-file): Don't visit the destination file, just write the data to it using write-region. This is similar to revision 1.32 of saveplace.el, but with an additional change to avoid visiting the file in the first place. diff -r efab878cd2e1 -r 871ff6d80553 lisp/ChangeLog --- a/lisp/ChangeLog Sat Nov 12 17:17:52 2005 +0000 +++ b/lisp/ChangeLog Sat Nov 12 20:30:22 2005 +0000 @@ -1,3 +1,10 @@ +2005-11-12 Karl Fogel + + * bookmark.el (bookmark-write-file): Don't visit the destination + file, just write the data to it using write-region. This is + similar to revision 1.32 of saveplace.el, but with an additional + change to avoid visiting the file in the first place. + 2005-11-12 Chong Yidong * hi-lock.el (hi-lock-mode): Set the default value of diff -r efab878cd2e1 -r 871ff6d80553 lisp/bookmark.el --- a/lisp/bookmark.el Sat Nov 12 17:17:52 2005 +0000 +++ b/lisp/bookmark.el Sat Nov 12 20:30:22 2005 +0000 @@ -1352,12 +1352,11 @@ (save-window-excursion (if (>= baud-rate 9600) (message "Saving bookmarks to file %s..." file)) - (set-buffer (let ((enable-local-variables nil)) - (find-file-noselect file))) + (set-buffer (get-buffer-create " *Bookmarks*")) (goto-char (point-min)) + (delete-region (point-min) (point-max)) (let ((print-length nil) (print-level nil)) - (delete-region (point-min) (point-max)) (bookmark-insert-file-format-version-stamp) (pp bookmark-alist (current-buffer)) (let ((version-control @@ -1368,7 +1367,7 @@ (t t)))) (condition-case nil - (write-file file) + (write-region (point-min) (point-max) file) (file-error (message "Can't write %s" file))) (kill-buffer (current-buffer)) (if (>= baud-rate 9600)