From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65719: [PATCH] Pass restart argument to 'kill-emacs-query-functions' Date: Tue, 07 Jan 2025 18:38:04 +0200 Message-ID: <86jzb64m1f.fsf@gnu.org> References: <329566cab29d3bdd4cd7f2257ec9f92a@elken.dev> <0817cde8dd8dab055dafe2e8aa3d30d5@elken.dev> <2aae66e7-f7e3-4da4-aee8-0ff9a8db1f0a@elken.dev> <0d97a409-b9c4-4204-b5d0-1bb386056c56@elken.dev> <86v86tr5dj.fsf@gnu.org> <86sf1xr3ep.fsf@gnu.org> <60592464472415a836939db15e38a8cf@elken.dev> <86v7uud8ua.fsf@gnu.org> <9422f3bb7316d0fb3eba6dcc832e26c5@elken.dev> <86cyh2d5ty.fsf@gnu.org> <681a879f34e51bf76bea93a65822b572@elken.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19284"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65719@debbugs.gnu.org, stefankangas@gmail.com To: me@elken.dev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 07 17:39:26 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tVCc2-0004s5-6v for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jan 2025 17:39:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVCbg-0008Nh-Jw; Tue, 07 Jan 2025 11:39:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVCbe-0008NS-QN for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:39:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVCbe-0004Pu-Hq for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:39:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=gqJvjDVSJzoqwG4yWeQo6bGWvRvQzWICxbeqehPUeqA=; b=hQBsF8bFVYOAx9oBjSUooNdtSd6ap2ANrgfmxfFERADLUih/KgB450qBpGEpGhAsAF8/DNamsWegVVnLXoZUur3gPU6nNDgq2A0lZVMm0ixUrWrMlktO7KHbUsePtOdh4/2O/YD4bItLrkemUnkxugfWcbEyNSigD/pTh8Z3kDsrzoXDLAz7H0nST2GfQbE2ba5axK9nIgFrMMlSx51cwd7F7Lwvwpw9pVmBSob0dtWGlmlNEG4alVuJV0+N1qCjvvdEgL96zhGWuOQ3/dPgLpPB0gmguWv53q4QaBSLoLzCZS5g473Ly7Y1RC0vyIV/x2O1pPOlXnbY4GLzq1vsXg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVCbe-0000Kz-3V for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2025 16:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65719 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65719-submit@debbugs.gnu.org id=B65719.17362678991201 (code B ref 65719); Tue, 07 Jan 2025 16:39:02 +0000 Original-Received: (at 65719) by debbugs.gnu.org; 7 Jan 2025 16:38:19 +0000 Original-Received: from localhost ([127.0.0.1]:44387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVCat-0000J8-QM for submit@debbugs.gnu.org; Tue, 07 Jan 2025 11:38:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34742) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVCar-0000Io-8D for 65719@debbugs.gnu.org; Tue, 07 Jan 2025 11:38:13 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVCal-0004N2-Ec; Tue, 07 Jan 2025 11:38:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gqJvjDVSJzoqwG4yWeQo6bGWvRvQzWICxbeqehPUeqA=; b=bKkmzO403l2J d96oNlLR7j1abassn/Erl7aKZ68oIDaHDtxqT4pBUCdztWy9hZafTLDKyjIH5EPfajBupp/uAIw+e xG5MATNh6MlVWdfuZlaUdRXrQpY3rzx3j2T7wiRIGVXv0uRzVfYUtxj7FDrRhb92qF+ww4wI8dk5M 2SfMRI1K02JtyGMlIfelMpWTfalMARplY44kwy21bRQVxNUcFKw2HBcwwQnZrmkJpPn1ExbIXLTXp LjBj4Ug4zGx6PyVsmx0fWCAFr1uLctiffQryL10MHFXRroYoTPAOYtAdpuIW7FOsRPMcI4ZglNe15 S2crAfTbLOvRkQqzqdJb7A==; In-Reply-To: <681a879f34e51bf76bea93a65822b572@elken.dev> (me@elken.dev) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298730 Archived-At: > Date: Tue, 07 Jan 2025 15:54:42 +0000 > From: me@elken.dev > Cc: 65719@debbugs.gnu.org, stefankangas@gmail.com > > > It's a strange (and maybe even dangerous) distinction. > > I'm afraid I don't see this, could you elaborate? > > > But in any case, I think a cleaner solution would be to bind a > > variable inside restart-emacs, and then your hook could examine it. > > Alternatively, ... > > > >> > In any case, the prefix argument is available via current-prefix-arg. > >> > >> Yes you're right, I realised after I sent it.... > > > > ...you could invoke restart-emacs with a prefix argument, and examine > > that in your kill-emacs-query-functions hook. AFAICT, this should > > work without any changes. > > I'm afraid I also don't follow here, how is that cleaner than > introducing > a specific hook? Rather than needing to specifically modify a function > to work with the prefix argument, you can just add it to the hook. It isn't necessarily cleaner, but it is a local solution for what I consider a local and very specialized problem. There's no reason to expect Emacs to have an OOTB solution for every possible niche use case that some user needs to handle. Adding a hook means we all have to pay the price in documenting it, maintaining it, etc. Each request for adding a new feature should have a solid enough basis before we must consider it for addition. FWIW, I don't yet see why this particular request qualifies.