From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Oliver Taylor Newsgroups: gmane.emacs.devel Subject: Re: Variable for Confirming Killing a Buffer Date: Fri, 3 Dec 2021 11:45:35 -0800 Message-ID: <3E13280E-45F8-4958-BE9B-C19FE2E5235B@me.com> References: <9EA40AE1-5B31-45D9-AF71-17BB3C6AB8A3@me.com> <87tufpvd5z.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) 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="35911"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 03 20:48:03 2021 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 1mtEXL-0009Cq-4f for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Dec 2021 20:48:03 +0100 Original-Received: from localhost ([::1]:58324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtEXJ-0007ZT-Qp for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Dec 2021 14:48:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtEV2-00069E-EW for emacs-devel@gnu.org; Fri, 03 Dec 2021 14:45:41 -0500 Original-Received: from mr85p00im-hyfv06011301.me.com ([17.58.23.184]:46454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtEV0-0007s5-VK for emacs-devel@gnu.org; Fri, 03 Dec 2021 14:45:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1638560738; bh=dErrkA1oh1sJMu39VsY94ZkQx3SnGyPmypP34W/n07o=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=JLH7mY1DyNrKTXmwPVr5UGmL0U5IzYZ6waiKnKzM8A0sFEZLfhvzPZYjxwaiVu5aw EhX3axcs9aSFCNBlsICDhDcr7OGdVgNu89xBWEBQHKyPDxGL2eaUCXJH/Q/ktV2y/c N09Wqhkzb9A0irFBxWA+T/Lx+biXCgEzYCcyBAwrSaCAiIX1Yn00B44MIjaeG0MoOB ZeUodTjeSnN9H9V0FExxemOzYp3xNWZ52IEyids5fq2H1/HTz0wjE5ekK3GBy/NAc/ R+twmIViy6PNHP0u86P/cq6e4C+q8TPB5wKpKarXbda0KKtm47ANMLU/Z8ulH6yUae pwtYzazCdDPzA== Original-Received: from smtpclient.apple (071-084-214-239.biz.spectrum.com [71.84.214.239]) by mr85p00im-hyfv06011301.me.com (Postfix) with ESMTPSA id 9494F5805D6; Fri, 3 Dec 2021 19:45:37 +0000 (UTC) In-Reply-To: <87tufpvd5z.fsf@gnus.org> X-Mailer: Apple Mail (2.3693.20.0.1.32) X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.790,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2021-12-03=5F07:2021-12-02=5F01,2021-12-03=5F07,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=675 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 clxscore=1011 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2112030128 Received-SPF: pass client-ip=17.58.23.184; envelope-from=olivertaylor@me.com; helo=mr85p00im-hyfv06011301.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.29 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:280868 Archived-At: > On Dec 3, 2021, at 8:58 AM, Lars Ingebrigtsen wrote: >=20 >> (add-hook 'kill-buffer-query-functions #'buffer-confirm-kill-p) >=20 > I'm not sure this is the best way to achieve this -- and it'll get in > the way of some things that create buffers and then expect to be able = to > kill them off without any queries, I think. Yes, I would expect that there=E2=80=99s a better way to do this. But = as-is this doesn=E2=80=99t get in the way simply because it requires the = buffer-local variable to be explicitly set. > Perhaps we should instead bind `C-x k' to a new command that calls > kill-buffer after (possibly) querying the user instead. I would imagine the flaw with this is that there are probably a lot of = different ways buffers get killed, and a key binding is only one of = them, so it would only offer a little protection. > As for the feature itself, I expect people to want to be able to kill > some buffers without query, anyway, so perhaps it should allow a list = of > major modes that should be queried? Would this be better accomplished by setting the variable via a = mode-hook?