aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Fogel2005-11-12 20:30:22 +0000
committerKarl Fogel2005-11-12 20:30:22 +0000
commita506054af7cd86a63fda996056c09310966f32ef (patch)
treef9870ffa20415f665f4711ca3bc35049bb16af07
parent71dd9295e32625af37aeafeb1e620ec75b0aedc9 (diff)
downloademacs-a506054af7cd86a63fda996056c09310966f32ef.tar.gz
emacs-a506054af7cd86a63fda996056c09310966f32ef.zip
(bookmark-write-file): Don't visit the destination file, just write
the data to it using write-region. This is similar to 2005-05-29T08:36:26Z!rms@gnu.org of saveplace.el, but with an additional change to avoid visiting the file in the first place.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/bookmark.el7
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eca2a8f6b77..bc3bca39cc6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12005-11-12 Karl Fogel <kfogel@red-bean.com>
2
3 * bookmark.el (bookmark-write-file): Don't visit the destination
4 file, just write the data to it using write-region. This is
5 similar to saveplace.el at 2005-05-29T08:36:26Z!rms@gnu.org, but with an additional
6 change to avoid visiting the file in the first place.
7
12005-11-12 Chong Yidong <cyd@stupidchicken.com> 82005-11-12 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * hi-lock.el (hi-lock-mode): Set the default value of 10 * hi-lock.el (hi-lock-mode): Set the default value of
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
1352 (save-window-excursion 1352 (save-window-excursion
1353 (if (>= baud-rate 9600) 1353 (if (>= baud-rate 9600)
1354 (message "Saving bookmarks to file %s..." file)) 1354 (message "Saving bookmarks to file %s..." file))
1355 (set-buffer (let ((enable-local-variables nil)) 1355 (set-buffer (get-buffer-create " *Bookmarks*"))
1356 (find-file-noselect file)))
1357 (goto-char (point-min)) 1356 (goto-char (point-min))
1357 (delete-region (point-min) (point-max))
1358 (let ((print-length nil) 1358 (let ((print-length nil)
1359 (print-level nil)) 1359 (print-level nil))
1360 (delete-region (point-min) (point-max))
1361 (bookmark-insert-file-format-version-stamp) 1360 (bookmark-insert-file-format-version-stamp)
1362 (pp bookmark-alist (current-buffer)) 1361 (pp bookmark-alist (current-buffer))
1363 (let ((version-control 1362 (let ((version-control
@@ -1368,7 +1367,7 @@ for a file, defaulting to the file defined by variable
1368 (t 1367 (t
1369 t)))) 1368 t))))
1370 (condition-case nil 1369 (condition-case nil
1371 (write-file file) 1370 (write-region (point-min) (point-max) file)
1372 (file-error (message "Can't write %s" file))) 1371 (file-error (message "Can't write %s" file)))
1373 (kill-buffer (current-buffer)) 1372 (kill-buffer (current-buffer))
1374 (if (>= baud-rate 9600) 1373 (if (>= baud-rate 9600)