From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs 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 Message-ID: <87zhezt8eo.fsf@ericabrahamsen.net> References: <87tv58mo8d.fsf@disroot.org> <87y2ukxt0r.fsf@ericabrahamsen.net> <87v9pofg9b.fsf@disroot.org> <87y2ukw9q4.fsf@ericabrahamsen.net> <87ftgr1o0q.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="140181"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 38993@debbugs.gnu.org To: Jorge P. de Morais Neto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 07 19:44:43 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iotqJ-000WtJ-NR for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2020 19:44:39 +0100 Original-Received: from localhost ([::1]:54886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iotqI-00069W-Hr for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2020 13:44:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60974) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iotpj-0005eO-FE for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 13:44:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iotpi-0001Us-8P for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 13:44:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iotpi-0001Ud-4u for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 13:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iotpi-00027Z-4Q for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 13:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2020 18:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38993 X-GNU-PR-Package: emacs Original-Received: via spool by 38993-submit@debbugs.gnu.org id=B38993.15784225868063 (code B ref 38993); Tue, 07 Jan 2020 18:44:02 +0000 Original-Received: (at 38993) by debbugs.gnu.org; 7 Jan 2020 18:43:06 +0000 Original-Received: from localhost ([127.0.0.1]:49284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ioton-00025z-Rn for submit@debbugs.gnu.org; Tue, 07 Jan 2020 13:43:06 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:45310 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iotom-00025W-Ff for 38993@debbugs.gnu.org; Tue, 07 Jan 2020 13:43:05 -0500 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 122CDFA090; Tue, 7 Jan 2020 18:42:57 +0000 (UTC) In-Reply-To: <87ftgr1o0q.fsf@disroot.org> (Jorge P. de Morais Neto's message of "Tue, 07 Jan 2020 08:53:09 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174337 Archived-At: Jorge P. de Morais Neto 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