]> git.eshelyaron.com Git - emacs.git/commitdiff
(bookmark-write-file): Don't visit the destination file, just write
authorKarl Fogel <kfogel@red-bean.com>
Sat, 12 Nov 2005 20:30:22 +0000 (20:30 +0000)
committerKarl Fogel <kfogel@red-bean.com>
Sat, 12 Nov 2005 20:30:22 +0000 (20:30 +0000)
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.

lisp/ChangeLog
lisp/bookmark.el

index eca2a8f6b77525dc0dcaab7da5f7c3097b5d698b..bc3bca39cc6f98f1c7331ba1e70dd54fe6168a30 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-12  Karl Fogel  <kfogel@red-bean.com>
+
+       * bookmark.el (bookmark-write-file): Don't visit the destination
+       file, just write the data to it using write-region.  This is
+       similar to saveplace.el at 2005-05-29T08:36:26Z!rms@gnu.org, but with an additional
+       change to avoid visiting the file in the first place.
+
 2005-11-12  Chong Yidong  <cyd@stupidchicken.com>
 
        * hi-lock.el (hi-lock-mode): Set the default value of
index 86fa6e489f082a2404d1badc56ef8590ebb1af0c..de1bb4f6a6c94781b6c2aad3e267de65d453071e 100644 (file)
@@ -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)