GNU bug report logs - #12507
24.2.50; `bookmark-write-file': use `write-file', not `write-region', to get backups

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 24 Sep 2012 18:44:01 UTC

Severity: wishlist

Tags: notabug

Found in version 24.2.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #175 received at 12507-done <at> debbugs.gnu.org (full text, mbox):

From: Karl Fogel <kfogel <at> red-bean.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Chong Yidong <cyd <at> gnu.org>,
 12507-done <at> debbugs.gnu.org
Subject: Re: bug#12507: [debbugs-tracker] Processed: severity 12507 wishlist
Date: Sat, 28 Nov 2020 18:28:14 -0600
Okay, this is done now:

  | commit 17fa17be3d93fc10f6ca91d738d5056b1b9f1f1e
  | Author:     Karl Fogel <kfogel <at> red-bean.com>
  | AuthorDate: Sat Nov 28 18:17:46 2020 -0600
  | 
  | Save bookmarks by using `write-file' (bug#12507)
  | 
  | Go back to using `write-file' to save bookmarks, instead of using
  | `write-region'.  This means numbered backups of the bookmark file may
  | get made again, depending on the value of `bookmark-version-control'.
  | 
  | Thanks especially to Drew Adams and Eli Zaretskii for their
  | persistence in tracking down information relevant to this change.

I committed it on the 'emacs-27' branch.  That seemed like the right place for a small and safe change like this (in addition to running 'make check', I tested it manually to make sure it has the effects we expected).  

Although there's been a fair amount of activity in bookmark.el on 'master' recently (e.g., Stefan Kangas's changes to base `bookmark-bmenu-mode' on `tabulated-list-mode', for bug #39293), my commit does not conflict with any of that activity, so there should be no problem when 'emacs-27' is next automerged to 'master'.

Closing bug #12507 with this message.

Best regards,
-Karl

On 29 Sep 2020, Drew Adams wrote:
>> >What's wrong with the obvious, simple solution to the
>> >real, recognized problem of no backups for bookmark
>> >files: use `write-file'?  That's the first question
>> >to ask and answer, no?
>> 
>> I can't think of any reason now.  I have a vague memory that there *was* a
>> specific reason, but if there was, I failed to document adequately at the
>> time and have been unable to recover it now.
>> 
>> Eli helpfully linked to Richard's message
>> (https://urldefense.com/v3/__https://lists.gnu.org/archive/html/emacs-
>> devel/2005-
>> 05/msg01376.html__;!!GqivPVa7Brio!OesHeMbHNKqFeUCyyW2WJ0UeXBZjSXngBYlvA1Q5G9F
>> zXXgAa30g7LGrcwolObMB$ ), in which Richard points out that if bookmark visits
>> the file anyway when reading, then there's nothing to be gained (from the
>> perspective of saveplace.el interference) from avoiding visiting it when
>> writing.
>> 
>> And `bookmark-load' *does* visit the file when reading, so I'm leaning toward
>> just taking your suggestion and reverting to `write-file' -- but this time
>> leaving better historical breadcrumbs (in comments and/or log messages) in
>> case my vaguely-remembered bug turns out to be real and reappears.
>> 
>> I will do this as soon as I have time to focus on it and make sure I don't
>> make a silly blunder; that may be several days.
>
>Thanks for looking into this, Karl.  (No hurry.)




This bug report was last modified 4 years and 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.