From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Changes for emacs 28, Re: Changes for emacs 28 Date: Mon, 14 Sep 2020 16:35:15 +0200 Message-ID: References: <20200910231420.kvqg6ohvxetpup5c.ref@Ergus> <83d02sfh58.fsf@gnu.org> <83a6xwf9ym.fsf@gnu.org> <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> 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="10143"; 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: Thibaut Verron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 14 16:37:09 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 1kHpbR-0002VS-9f for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Sep 2020 16:37:09 +0200 Original-Received: from localhost ([::1]:46494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHpbQ-0002s1-8G for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Sep 2020 10:37:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHpZh-0001si-BC for emacs-devel@gnu.org; Mon, 14 Sep 2020 10:35:21 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:44510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHpZf-00035v-GR; Mon, 14 Sep 2020 10:35:21 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id s12so18987494wrw.11; Mon, 14 Sep 2020 07:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=oAX+J8Xsl50V9xsDdU7Qm/IFdWUuF0d9OHAeHP6RAoU=; b=gqajeWlBca+fLnR5LXfIc2S4uxvmAJyCK1WbUDil8EGSXf1qLbM7Fdn0gttxMs4Nf1 REIQBR6matY/UDHCtzUVZrJPWALRtLVeUHlD84GdWSIy6DALEBvW7IGMU2bhBtlTYiXf eFDlSda+kSFwNvu8+Hn4/T1dVvuOzOax9igVIUJ7+4pUtdTrDVlBPBdsndIIxdNY04Vb G5mYwZljA+xqIKgkg7FFa95sfOg+WnW107faT7V4mozx6LQi3IVq39iQrX3KD4iLVo03 kz/jVq0p38A0/BuljWJBSZOOj/qCA6WmhpWSismRmJXrKFtFzOZp0SGfIHaPIN52e3ct +ccg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=oAX+J8Xsl50V9xsDdU7Qm/IFdWUuF0d9OHAeHP6RAoU=; b=fLQneIoxJ0bqgxTQOB6CCJkzN49JhUsvyx75oMIcCvraDVU1wzU7KWWESyD3Rs7c9P 2EqBJuvkXYKJN+seyvolUAKijLlCe7R2sK42l1XQdfCfuwnqlTWu6k3Bx/P9hV4Zug1Z 1R31Da70oZ9v9lZ4V2YC8hpStXbbDmKEo/IkYQ+2emajUnzWeGA6j+4aGkeHaCoa2H01 jxwALRuwc8fyUWFlHdYhHt9RMfLpuqpzbniTdgbfIFI7KUH+qIry8ABTxViY5gSOz281 fIsRsm1XTa9duMB3UeHFitEOMPvZGFf47boLSYVs/6XIBTFke/wYN0HPkoNmelbqoXhy wqUQ== X-Gm-Message-State: AOAM533H5ECvFdY+WQHJCQKzRnpxobiS1e23tewprapHxzis4iwHDIcs Qe5lIFOQ+0lYYWyhsv/cND8= X-Google-Smtp-Source: ABdhPJwdH2fsE97jRzOEbTG/f4tRhZQ9plsaffPtcmDahc01wmV+036ensRciK6YRrqacYP0pQF55g== X-Received: by 2002:adf:a35d:: with SMTP id d29mr16414655wrb.307.1600094117501; Mon, 14 Sep 2020 07:35:17 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:5055:7f7f:92a2:59ec]) by smtp.gmail.com with ESMTPSA id j14sm20145183wmj.19.2020.09.14.07.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 07:35:16 -0700 (PDT) In-Reply-To: (Thibaut Verron's message of "Mon, 14 Sep 2020 14:15:40 +0200, Mon, 14 Sep 2020 09:18:29 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=rpluim@gmail.com; helo=mail-wr1-x42b.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:255644 Archived-At: >>>>> 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 buffers >> >> created via the toolbar. >> >> >>=20 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. >>=20 >> Right, but toolbar-save doesn=CA=BCt run save-some-buffers. That cou= ld 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) >>=20 Thibaut> The save button runs save-buffer, so it should DTRT already, n= o? 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) >> That covers the 'exiting emacs' scenario, we=CA=BCd still need somet= hing 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, s= ince 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=CA=BCve tested it, attempting to exit emacs with a modified buffer throws up the GUI version of the 'save/no save/view' question, so that=CA=BCs 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. >>=20 Thibaut> Restoring them as-is is what notepad++ does (or did when I las= t 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=CA=BCs a behaviour that=CA=BCs 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 b= e sensible. >>>>> On Mon, 14 Sep 2020 09:18:29 -0400, Stefan Monnier said: Eli> But with a buffer that doesn't visit a file, you don't get any pro= mpt Eli> at all. The toolbar does not let you create such buffers (I thought it did, but it doesn=CA=BCt). >> 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 "autos= ave". Stefan> Why not create a new and "normal" file-buffer whose file name is Stefan> something like `~/.emacs.d/newfiles/untitled`? See above: the buffer will have an associated file, so autosave should just work. Robert