Subject: RE: bug#12507: [debbugs-tracker] Processed: severity 12507 wishlist

From: Drew Adams <[email-masked]>
Date: Wed, 23 Sep 2020 11:13:53 -0700 (PDT)

> > This way we would still use `write-region' and avoid visiting the file.
> 
> Why do we have to keep to use write-region?

We don't.

> > Even though we don't know exactly why Richard made the original motivating
> change (commit cfde584f6d, see [b] below), there was some problem with
> `write-file' -- so we shouldn't just go back to that, because a regression
> would be likely.
> 
> You already had this discussion with Richard back then, see
> 
>   https://urldefense.com/v3/__https://lists.gnu.org/archive/html/emacs-
> devel/2005-
> 05/msg01376.html__;!!GqivPVa7Brio!OSjUJblLyJ3EpHMJp5DOIs2JXP2on_caEr0IyNh9zTt
> iU5_MphK2KXh6pWfteriy$
> 
> If what Richard wrote in response is not clear enough, we can ask him
> to try to elaborate.

Thanks for finding that.  Clearly, the save-place use
case is particular, and the reason for it to use
`write-region' doesn't apply to the use of a bookmark
file.  That's clear to me, at least, from what RMS said:

  If bookmark.el currently visits the file when reading it,
  changing the way it writes the file would not alter the outcome.

  How often do users visit the bookmark file?  If they do this commonly,
  then it is better to visit the file.  If they do this quite rarely,
  then could be is better to work like save-place-alist-to-file.

  Another alternative, which could be best if you want Emacs to make backups
  of the bookmark file in the usual way, is to visit the file normally,
  but kill the buffer after saving it, unless the buffer existed previously.