From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.devel Subject: Re: Changes for emacs 28 Date: Mon, 14 Sep 2020 14:15:40 +0200 Message-ID: References: <20200910231420.kvqg6ohvxetpup5c.ref@Ergus> <20200910231420.kvqg6ohvxetpup5c@Ergus> <875z8lhz3p.fsf@gmail.com> <83tuw4hkad.fsf@gnu.org> <83tuw4flzy.fsf@gnu.org> <83h7s4fier.fsf@gnu.org> <83d02sfh58.fsf@gnu.org> <83a6xwf9ym.fsf@gnu.org> Reply-To: thibaut.verron@gmail.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d31f7a05af44fe61" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27966"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ergus , caiohcs0@gmail.com, emacs-devel , rekado@elephly.net, ghe@sdf.org, Eli Zaretskii , Drew Adams To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 14 14:21:06 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kHnTl-0007AI-Tr for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Sep 2020 14:21:06 +0200 Original-Received: from localhost ([::1]:37498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHnTk-0003Pi-VW for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Sep 2020 08:21:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHnOl-0007ez-EF for emacs-devel@gnu.org; Mon, 14 Sep 2020 08:15:56 -0400 Original-Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:33572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHnOj-0006U5-Ik; Mon, 14 Sep 2020 08:15:55 -0400 Original-Received: by mail-wm1-x32f.google.com with SMTP id e11so8767030wme.0; Mon, 14 Sep 2020 05:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=KnzmaH/Xxd7mHBRTvr96RIN0N01q1JBMVCpIbGZRugc=; b=RMQTnhPKh2P2Or/o8g3bq+Bc2Ke6xOwZw8HEDZlHKzDLRc/dhKqkXN6zUo9gQ8rlx5 zbeVxrGIMugP+hnkfGv2taNzXBHE7w18x5F0zKulqHeOtQ4S7sLEL31Ayhl/fnn0QIId PnJ2tWWi5lal2IZb5rw28VGiO1EMksStxUMdZCXacOxPBrSfZIZwvgCOL30MITpWxT2U GYO0XM2a5ZCigSqrIdcfVfhH/1eH/D/ZaBc6HKzFfVPCr2T6Fk38HImMSQGj1qrpIuvP Hz14GYDuoRmWIqb7z1/OigTITnQSgtceIg1IM84uNteMai2lWQbigqA7naG4y1SvAOvP YOhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=KnzmaH/Xxd7mHBRTvr96RIN0N01q1JBMVCpIbGZRugc=; b=a2rmLHVqutL1sOhnzYnnWlFrr4HptKvWUQVY2rXL8b2nFey6iyd527yRdey6vBkaXv Ye5zfA8IIAsV82ZMCSdeEc6sK08+9Z1Q2vBnHeDcU9SYnKTQiEOc1SmsvxfnTdZzUx5I Orle5p6dV3qPXFzNVbSlmqt+j2DdMJ3oDVDmoTRdPVNURHt/kL740RnzAgC3yPvca/iA +dTqOEUK53JAiqm4ZiQGSOSeO2WTNfks62cYg6gsXO9RuBQ0jy0VTDhbEUDWXY8NZ9o+ 9rats5gSj5XvYoumghwFHtXjoMz1Z6OpLsF9IYJcbAF3Acbzb9P5wa87pnjKcGttbUPr S4ng== X-Gm-Message-State: AOAM533yDNWOcsFVOdn9Tt2q3cQT3noNkTCtbCO1nycOMPZYF9lBYwv+ e2ZhqJU+jPfa38fMnApinEJj06P5DnGL+sfWYZ4= X-Google-Smtp-Source: ABdhPJxacSwxp6bEKVSlPHzhuTVThqqs/MDHgDI5Ote0YBiENTJ/pyP8ZNtVZndFCP1XUZs4Q9XgPK6NhdfOgWzXkRs= X-Received: by 2002:a1c:a746:: with SMTP id q67mr15636550wme.128.1600085751438; Mon, 14 Sep 2020 05:15:51 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=thibaut.verron@gmail.com; helo=mail-wm1-x32f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:255637 Archived-At: --000000000000d31f7a05af44fe61 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le lun. 14 sept. 2020 =C3=A0 13:54, Robert Pluim a =C3= =A9crit : > >>>>> 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=CA=BCt 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) > The save button runs save-buffer, so it should DTRT already, no? > That covers the 'exiting emacs' scenario, we=CA=BCd still need something = to > cover the 'clicked the kill-buffer button'. That's correct, I didn't have this usage in mind. Kill-buffer-hook seems to be more for cleanup, but kill-buffer-query-functions could do the job as a first step (as in, "do you really want to kill without saving?"). I believe that the most natural would be to add such a test to kill-buffer, since it already takes care of modified file buffers. All those approaches would also affect other commands killing the buffer, preventing a user from accidentally losing data because of an unfortunate keypress. 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. > Restoring them as-is is what notepad++ does (or did when I last used it 10 years ago). I personally did not like this behavior, and I didn't have remotely as many open files in notepad++ as I do in a typical emacs session= . On the other hand, auto-saving and offering to restore could be sensible. --000000000000d31f7a05af44fe61 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Le=C2=A0lun. 14 sept. 2020 =C3=A0=C2=A013= :54, Robert Pluim <rpluim@gmail.com<= /a>> a =C3=A9crit=C2=A0:
>>>>> On Mon, 14 Sep = 2020 09:53:28 +0200, Thibaut Verron <thibaut.verron@gmail.com> said:
=C2=A0 =C2=A0 >>
=C2=A0 =C2=A0 >> We could set 'kill-buffer-hook' to a queryin= g function in buffers
=C2=A0 =C2=A0 >> created via the toolbar.
=C2=A0 =C2=A0 >>

=C2=A0 =C2=A0 Thibaut> There is already a (buffer-local) variable buffer= -offer-save which, set to
=C2=A0 =C2=A0 Thibaut> 'always, causes save-some-buffers to query fo= r save the corresponding
=C2=A0 =C2=A0 Thibaut> buffer, if non-empty.

Right, but toolbar-save doesn=CA=BCt 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)

The save button runs s= ave-buffer, so it should DTRT already, no?
=C2=A0
That covers the 'exiting emacs&= #39; scenario, we=CA=BCd still need something to
cover the 'clicked the kill-buffer button'.

That's correct,=C2=A0I didn't have=C2=A0this usage in mind= . Kill-buffer-hook seems to=C2=A0
be more for cleanup, but kill-b= uffer-query-functions could do the job as a=C2=A0
first step (as = in, "do you really want to kill without saving?"). I believe that=
the most natural would be to add such a test to kill-buffer, sin= ce it already
takes care of modified=C2=A0file buffers.

All those approaches would also affect other commands killi= ng the buffer,=C2=A0
preventing a user from accidentally losing d= ata because of an unfortunate=C2=A0
keypress.


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.

R= estoring them as-is is what notepad++ does (or did when I last used it
10 years ago). I personally did not like this behavior, and I didn= 9;t have=C2=A0
remotely as many open files in notepad++ as I do i= n a typical emacs session.

On the other hand, auto= -saving and offering to restore could be sensible.
--000000000000d31f7a05af44fe61--