diff options
author | Karl Fogel <kfogel@red-bean.com> | 2005-11-12 20:30:22 +0000 |
---|---|---|
committer | Karl Fogel <kfogel@red-bean.com> | 2005-11-12 20:30:22 +0000 |
commit | 0393e2548217178bb8c1829e23ed6c95bfb41a12 (patch) | |
tree | c16d47ed34156ffb86d4f6492faf6ca9149af766 /lisp/bookmark.el | |
parent | db6229fc1d8550edeca5e4985255ccb0ba889eca (diff) | |
download | emacs-0393e2548217178bb8c1829e23ed6c95bfb41a12.tar.gz |
(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.
Diffstat (limited to 'lisp/bookmark.el')
-rw-r--r-- | lisp/bookmark.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 86fa6e489f0..de1bb4f6a6c 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1352,12 +1352,11 @@ for a file, defaulting to the file defined by variable (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 @@ for a file, defaulting to the file defined by variable (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) |