GNU bug report logs - #38993
26.3; EBDB saves the database on Emacs exit even when told not to

Previous Next

Package: emacs;

Reported by: jorge+list <at> disroot.org (Jorge P. de Morais Neto)

Date: Mon, 6 Jan 2020 18:32:01 UTC

Severity: minor

Found in version 26.3

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 38993 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Jorge P. de Morais Neto <jorge+list <at> disroot.org>
Cc: 38993 <at> debbugs.gnu.org
Subject: Re: bug#38993: 26.3; EBDB saves the database on Emacs exit even
 when told not to
Date: Tue, 07 Jan 2020 10:42:55 -0800
Jorge P. de Morais Neto <jorge+list <at> disroot.org> writes:

> Em [2020-01-06 seg 13:33:55-0800], Eric Abrahamsen escreveu:
>
>> I suppose I could have it do that (prompt for saving) rather than
>> saving silently.  I guess I just assumed that in most cases users
>> would want the database saved, rather than discarding changes.  I
>> don't have very strong feelings about it, though.
>
> In principle I want consistency with the rest of GNU Emacs.  IIRC, Emacs
> generally does not overwrite without asking.  There is the auto-save
> functionality, but it saves to *separate* files.  However I should
> disclaim that I have never studied human-machine interaction and I too
> do not have strong feelings about this.

Yes, I think consistency is the best thing to aim for. FWIW, what we're
talking about isn't auto-save (EBDB has its own mechanism for auto-save,
which is silent), but about behavior during `save-some-buffers'.

>> This is an error, either in Emacs or EBDB, I'm not sure. I originally
>> implemented the ability for special-mode buffers to offer themselves
>> as saveable, but the idea was that, if they saved themselves using
>> their own function, Emacs wouldn't then *also* save the buffer itself
>> in a file.
>>
>> Either my code in Emacs or my code in EBDB has a bug, I haven't gone
>> and figured out which.  I'll try to do that soon.
>
> Yes, by default Emacs should not ask to save the computer-generated
> "*EBDB*" buffer.  Regarding the database, I think that if
> `ebdb-save-on-exit' is nil then either:
> 1. Emacs should not ask to save the database on exit; or
> 2. The EBDB documentation should explicitly mention that Emacs will ask;
>    and the behavior should be altered so that, when the user answers no,
>    then Emacs should not save the database.

The problems is that, when you exit Emacs, it first runs
`save-some-buffers' -- which will prompt the user to possibly save the
database -- and then runs the `kill-emacs-hook'. So if you've said
"don't save" to the `save-some-buffers' prompt, the kill emacs hook
doesn't know that, and might save the database anyway.

To complicate things, the save-some-buffers prompt only runs if you have
live *EBDB* buffers. It's entirely possible to have a loaded database
with unsaved changes, but no buffers, in which case `save-some-buffers'
won't do anything at all.

Give me a bit to chew on this. I think I have a sense of the desired
behavior, it will just be a matter of getting to it.

> Oh, and thank you for this great package! Do you have a mechanism for
> accepting donations? I unfortunately would donate just a little at this
> moment, but I intend to donate more in the future when my financial
> situation improves and/or the Brazilian Real gains value against the US
> dollar.  Also, even very small donations may add up.

I'm glad it's useful to you! I hadn't really thought about donations, I
suppose it makes me a tiny bit uncomfortable. But I see Github has a
sponsorship thing, I suppose it wouldn't hurt to sign up!

Eric




This bug report was last modified 5 years and 175 days ago.

Previous Next


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