From: Robert Pluim <rpluim@gmail.com>
To: Thibaut Verron <thibaut.verron@gmail.com>
Cc: Ergus <spacibba@aol.com>,
caiohcs0@gmail.com, emacs-devel <emacs-devel@gnu.org>,
rekado@elephly.net, Stefan Monnier <monnier@iro.umontreal.ca>,
ghe@sdf.org, Eli Zaretskii <eliz@gnu.org>,
Drew Adams <drew.adams@oracle.com>
Subject: Re: Changes for emacs 28, Re: Changes for emacs 28
Date: Mon, 14 Sep 2020 16:35:15 +0200 [thread overview]
Message-ID: <m2y2lcl93w.fsf@gmail.com> (raw)
In-Reply-To: <CAFsi02RSar-DEYK-X7=eyzifXpapq_Uu3-KAye33rw3F71w5dA@mail.gmail.com> (Thibaut Verron's message of "Mon, 14 Sep 2020 14:15:40 +0200, Mon, 14 Sep 2020 09:18:29 -0400")
>>>>> On Mon, 14 Sep 2020 14:15:40 +0200, Thibaut Verron <thibaut.verron@gmail.com> said:
Thibaut> Le lun. 14 sept. 2020 à 13:54, Robert Pluim <rpluim@gmail.com> a écrit :
>> >>>>> On Mon, 14 Sep 2020 09:53:28 +0200, Thibaut Verron <
>> thibaut.verron@gmail.com> said:
>> >>
>> >> We could set 'kill-buffer-hook' to a querying function in buffers
>> >> created via the toolbar.
>> >>
>>
Thibaut> There is already a (buffer-local) variable buffer-offer-save
>> which, set to
Thibaut> 'always, causes save-some-buffers to query for save the
>> corresponding
Thibaut> buffer, if non-empty.
>>
>> Right, but toolbar-save doesnʼt run save-some-buffers. That could be
>> added, but it seems people feel toolbar space is precious (here the
>> default toolbar uses slightly more than 50% of the available width
>> when running -Q)
>>
Thibaut> The save button runs save-buffer, so it should DTRT already, no?
Sorry, yes. The 'new' button forces you to choose a filename for the
buffer, so saving it works (that will teach me to talk about features
I donʼt use)
>> That covers the 'exiting emacs' scenario, weʼd still need something to
>> cover the 'clicked the kill-buffer button'.
And again, this is already covered, since the buffer has an associated
file, emacs queries if you try to kill a buffer with unsaved changes.
Thibaut> That's correct, I didn't have this usage in mind. Kill-buffer-hook seems to
Thibaut> be more for cleanup, but kill-buffer-query-functions could do the job as a
Thibaut> first step (as in, "do you really want to kill without saving?"). I believe
Thibaut> that
Thibaut> the most natural would be to add such a test to kill-buffer, since it
Thibaut> already
Thibaut> takes care of modified file buffers.
Thibaut> All those approaches would also affect other commands killing the buffer,
Thibaut> preventing a user from accidentally losing data because of an unfortunate
Thibaut> keypress.
And now that Iʼve tested it, attempting to exit emacs with a modified
buffer throws up the GUI version of the 'save/no save/view' question,
so thatʼs OK.
So in short: nothing to implement :-)
Thibaut> Or if we really want to go
>> whole hog, we automatically save the state of buffers created via the
>> toolbar, and restore them on startup.
>>
Thibaut> Restoring them as-is is what notepad++ does (or did when I last used it
Thibaut> 10 years ago). I personally did not like this behavior, and I didn't have
Thibaut> remotely as many open files in notepad++ as I do in a typical emacs session.
Itʼs a behaviour thatʼs become strongly expected, mainly because
people have become conditioned to 'restart where I left off' behaviour
from web browsers, I suspect.
Thibaut> On the other hand, auto-saving and offering to restore could be sensible.
>>>>> On Mon, 14 Sep 2020 09:18:29 -0400, Stefan Monnier <monnier@iro.umontreal.ca> said:
Eli> But with a buffer that doesn't visit a file, you don't get any prompt
Eli> at all.
The toolbar does not let you create such buffers (I thought it did,
but it doesnʼt).
>> We could set 'kill-buffer-hook' to a querying function in buffers
>> created via the toolbar.
Stefan> Beside this question of "save" there's also the issue of "autosave".
Stefan> Why not create a new and "normal" file-buffer whose file name is
Stefan> something like `~/.emacs.d/newfiles/untitled<N>`?
See above: the buffer will have an associated file, so autosave should
just work.
Robert
next prev parent reply other threads:[~2020-09-14 14:35 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200910231420.kvqg6ohvxetpup5c.ref@Ergus>
2020-09-10 23:14 ` Changes for emacs 28 Ergus
2020-09-11 1:38 ` Caio Henrique
2020-09-11 6:58 ` Eli Zaretskii
2020-09-11 13:57 ` Robert Pluim
2020-09-11 14:04 ` Eli Zaretskii
2020-09-11 14:24 ` Robert Pluim
2020-09-11 14:40 ` Eli Zaretskii
2020-09-11 16:12 ` Caio Henrique
2020-09-11 16:30 ` Robert Pluim
2020-09-12 18:29 ` Caio Henrique
2020-09-12 20:03 ` Ergus
2020-09-12 20:08 ` Caio Henrique
2020-09-11 15:16 ` Thibaut Verron
2020-09-11 15:21 ` Eli Zaretskii
2020-09-11 15:36 ` Thibaut Verron
2020-09-11 15:49 ` Eli Zaretskii
2020-09-11 16:20 ` Thibaut Verron
2020-09-11 18:24 ` Eli Zaretskii
2020-09-14 7:37 ` Robert Pluim
2020-09-14 7:53 ` Thibaut Verron
2020-09-14 11:54 ` Robert Pluim
2020-09-14 12:15 ` Thibaut Verron
2020-09-14 14:35 ` Robert Pluim [this message]
2020-09-14 14:53 ` Changes for emacs 28, " Thibaut Verron
2020-09-14 16:01 ` Robert Pluim
2020-09-14 16:34 ` Thibaut Verron
2020-09-14 17:13 ` tomas
2020-09-14 13:18 ` Stefan Monnier
2020-09-14 15:12 ` Andreas Schwab
2020-09-11 6:39 ` Eli Zaretskii
2020-09-11 10:10 ` Dmitry Gutov
2020-09-11 10:33 ` Eli Zaretskii
2020-09-11 10:36 ` Dmitry Gutov
2020-09-11 10:41 ` Eli Zaretskii
2020-09-11 11:09 ` Dmitry Gutov
2020-09-11 11:19 ` Ergus
2020-09-11 12:32 ` Dmitry Gutov
2020-09-11 12:04 ` Eli Zaretskii
2020-09-11 12:19 ` Ergus
2020-09-11 12:35 ` Eli Zaretskii
2020-09-11 12:57 ` Ergus
2020-09-11 13:04 ` Eli Zaretskii
2020-09-11 13:13 ` Eli Zaretskii
2020-09-12 12:15 ` Arthur Miller
2020-09-11 21:00 ` Dmitry Gutov
2020-09-11 21:17 ` Ergus
2020-09-11 22:29 ` Dmitry Gutov
2020-09-12 2:01 ` Ergus
2020-09-12 12:59 ` Dmitry Gutov
2020-09-13 3:57 ` Richard Stallman
2020-09-13 9:49 ` Yuri Khan
2020-09-13 14:30 ` Eli Zaretskii
2020-09-13 17:36 ` Dmitry Gutov
2020-09-13 17:43 ` Eli Zaretskii
2020-09-13 10:24 ` Dmitry Gutov
2020-09-14 3:51 ` Richard Stallman
2020-09-14 17:43 ` Dmitry Gutov
2020-09-14 18:01 ` Stefan Monnier
2020-09-15 4:43 ` Richard Stallman
2020-09-15 11:16 ` Dmitry Gutov
2020-09-16 5:05 ` Richard Stallman
2020-09-13 11:59 ` Arthur Miller
2020-09-13 12:37 ` Stefan Kangas
2020-09-13 14:02 ` T.V Raman
2020-09-11 23:02 ` Drew Adams
2020-09-12 6:12 ` Eli Zaretskii
2020-09-12 11:51 ` Dmitry Gutov
2020-09-12 3:21 ` Richard Stallman
2020-09-12 11:36 ` Dmitry Gutov
2020-09-12 12:42 ` Ergus
2020-09-12 16:37 ` Dmitry Gutov
2020-09-12 16:46 ` Ergus
2020-09-12 16:56 ` Dmitry Gutov
2020-09-11 12:21 ` Dmitry Gutov
2020-09-12 3:21 ` Richard Stallman
2020-09-11 10:59 ` Ergus
2020-09-11 11:17 ` Dmitry Gutov
2020-09-13 8:36 ` Juri Linkov
2020-09-11 10:15 ` Ergus
2020-09-11 10:35 ` Eli Zaretskii
2020-09-11 14:02 ` Caio Henrique
2020-09-11 14:16 ` Eli Zaretskii
2020-09-11 14:47 ` Ergus
2020-09-11 21:29 ` Caio Henrique
2020-09-12 3:22 ` Ergus
2020-09-12 6:30 ` Eli Zaretskii
2020-09-12 8:27 ` Ergus
2020-09-12 8:38 ` Eli Zaretskii
2020-09-12 9:38 ` Ergus
2020-09-12 9:57 ` Eli Zaretskii
2020-09-12 3:20 ` Richard Stallman
2020-09-12 3:28 ` Ergus
2020-09-13 4:07 ` Richard Stallman
2020-09-13 10:47 ` Dmitry Gutov
2020-09-14 3:51 ` Richard Stallman
2020-09-12 14:28 ` Achilles Yuce
2020-09-12 14:38 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2y2lcl93w.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=caiohcs0@gmail.com \
--cc=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=ghe@sdf.org \
--cc=monnier@iro.umontreal.ca \
--cc=rekado@elephly.net \
--cc=spacibba@aol.com \
--cc=thibaut.verron@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).