From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Jorge P. de Morais Neto <jorge+list@disroot.org>
Cc: 38993@debbugs.gnu.org
Subject: 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 [thread overview]
Message-ID: <87zhezt8eo.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87ftgr1o0q.fsf@disroot.org> (Jorge P. de Morais Neto's message of "Tue, 07 Jan 2020 08:53:09 -0300")
Jorge P. de Morais Neto <jorge+list@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
next prev parent reply other threads:[~2020-01-07 18:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-06 18:30 bug#38993: 26.3; EBDB saves the database on Emacs exit even when told not to Jorge P. de Morais Neto
2020-01-06 19:51 ` Eric Abrahamsen
2020-01-06 21:04 ` Jorge P. de Morais Neto
2020-01-06 21:33 ` Eric Abrahamsen
2020-01-07 11:53 ` Jorge P. de Morais Neto
2020-01-07 18:42 ` Eric Abrahamsen [this message]
2020-01-08 13:28 ` Jorge P. de Morais Neto
2020-01-08 18:54 ` Eric Abrahamsen
2020-01-11 21:15 ` Jorge P. de Morais Neto
2020-01-12 17:38 ` Eric Abrahamsen
2020-01-14 14:12 ` Jorge P. de Morais Neto
2020-01-14 22:53 ` Eric Abrahamsen
2020-01-18 19:38 ` Eric Abrahamsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zhezt8eo.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=38993@debbugs.gnu.org \
--cc=jorge+list@disroot.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.