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, Re: Changes for emacs 28 Date: Mon, 14 Sep 2020 16:53:07 +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: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4091"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ergus , caiohcs0@gmail.com, emacs-devel , rekado@elephly.net, Stefan Monnier , 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 18:36:08 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 1kHrSa-0000wz-At for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Sep 2020 18:36:08 +0200 Original-Received: from localhost ([::1]:49970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHrSZ-0005fJ-1n for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Sep 2020 12:36:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHpr8-0004u1-7R for emacs-devel@gnu.org; Mon, 14 Sep 2020 10:53:22 -0400 Original-Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:37281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHpr6-0005bE-Hl; Mon, 14 Sep 2020 10:53:21 -0400 Original-Received: by mail-wm1-x342.google.com with SMTP id a9so367642wmm.2; Mon, 14 Sep 2020 07:53:19 -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:content-transfer-encoding; bh=Z+7KI0fvo3qQmSl8zXHiTVaOWZAQS92Q4lFszDXDKKU=; b=VVG5SypGDDaZC+pFsOzcJeWC9W4WtgYHgSGPFAsxD8LAkd7YN5oTdx+sbB6lBAkKmf tpdwyMsweYGeBNZxcJOCYFd+e/MrKTHryPYYHuKTG2ellcLrYYZjFHtZFuQyj6f/Y9tN MgDd/rw/UPWHXjdy5/JRH3P0l+XTOY66EANpw2LM5kylC4Kdo6dTRGCigigNC2XBc0YH Gb9Y7foKLiqQR8sWPyzxl19ytJRsZScRd/ax4A8DsioWPy6mZhriIXtWPY7wjOeC8C5Q bQHmq4hhmdV5zY6O/m6t+IwwLVGntfNTmUGlLBVy8xqZwvcxZ3lR2F3/diXe1UqFMEt6 tbpw== 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:content-transfer-encoding; bh=Z+7KI0fvo3qQmSl8zXHiTVaOWZAQS92Q4lFszDXDKKU=; b=TMWdal0LrZpvmKuKJqiY9tbrpNibtfk1bFr/svZ+yGVWiZkRT5RquLYD6tsSxv3PJ2 unna1Tr87JHR+d0yD9grbiA1TlopWCXRk7nzH5HhiKEOtpQmdZTtdpB4lE/xkkdxFX1y rRyIuNCL7GCbKyG0CyB8NLsRDiYeUiUDhg4Cqr6IPcEsJM5/nqRFWPzo0WuRxXVAqXfS 0DYJWFu8NdPC5jIrGacuBf+ASaWnpU8GJdayxq/hZMG3GCnbURdTAhHLPXtvR2TsVX2a wBcoIgZOiSr3TqQ/AXERKi80PJjMb6kcaG/Hp61NrjJKXnZMK3FXhrWDODgPnyT8wHo5 joiw== X-Gm-Message-State: AOAM5322OAu4sP4qLB0IM4bm2jnIU3dc+6OkRqIw24KVavK+28HctBvT uexNm01BBiRhwpKjbvIvVZfpfyTwgSMtSreR1bM= X-Google-Smtp-Source: ABdhPJzf0I0YYYmnc9WMd14Ouq+avtewOW2jy6hp4DLJu2D3Y1ZFACo12ETZcGq4ZPRV+hXdeQmd/TnNnlhYDt+nGK4= X-Received: by 2002:a1c:a746:: with SMTP id q67mr16319808wme.128.1600095198552; Mon, 14 Sep 2020 07:53:18 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=thibaut.verron@gmail.com; helo=mail-wm1-x342.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, 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:255662 Archived-At: Le lun. 14 sept. 2020 =C3=A0 16:35, Robert Pluim a =C3= =A9crit : > > >>>>> On Mon, 14 Sep 2020 14:15:40 +0200, Thibaut Verron said: > > Thibaut> 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 buffe= rs > >> >> 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 c= ould be > >> added, but it seems people feel toolbar space is precious (here th= e > >> 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=CA=BCt 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 l= ast 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 typica= l emacs session. > > It=CA=BCs a behaviour that=CA=BCs become strongly expected, mainly becaus= e > 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=CA=BCt). That illustrates how confusing the current situation is, I believe. :)