unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thibaut Verron <thibaut.verron@gmail.com>
To: Robert Pluim <rpluim@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:53:07 +0200	[thread overview]
Message-ID: <CAFsi02RK5BHzYO4Sk+Dkqjk82JW1yX=RZXrSJEbyZs9MQGJ02A@mail.gmail.com> (raw)
In-Reply-To: <m2y2lcl93w.fsf@gmail.com>

Le lun. 14 sept. 2020 à 16:35, Robert Pluim <rpluim@gmail.com> a écrit :
>
> >>>>> 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)

I think that you missed a message in the long thread.

To clarify, currently, the "new" button is "find-file", so it does
expect a file name and a path.
The suggestion is to maybe replace it with a function creating an
anonymous buffer, leaving the choice of a path (if necessary) to the
point of saving.

In essence, something like

> (defun my/new-buffer ()
>   (interactive)
>   (let ((buffer (generate-new-buffer "*unnamed*")))
>     (pop-to-buffer buffer)
>     (setq buffer-offer-save 'always)))

Save-buffer should still work as expected, just as if you were calling
it from a normal non-file buffer, and so should save-some-buffers and
the like.

But kill-buffer will not offer to save, as of now, as you pointed out.

>
>     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.

There are packages going in that direction, if you are interested, but
it is really a complicated matter. Anonymous user-generated buffers
are not the biggest problem there. Web-browsers can just reload the
content of most of their "buffers", that's a luxury emacs does not
have.

> The toolbar does not let you create such buffers (I thought it did,
> but it doesnʼt).

That illustrates how confusing the current situation is, I believe. :)



  reply	other threads:[~2020-09-14 14:53 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                               ` Changes for emacs 28, " Robert Pluim
2020-09-14 14:53                                 ` Thibaut Verron [this message]
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='CAFsi02RK5BHzYO4Sk+Dkqjk82JW1yX=RZXrSJEbyZs9MQGJ02A@mail.gmail.com' \
    --to=thibaut.verron@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=rpluim@gmail.com \
    --cc=spacibba@aol.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).