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: Sat, 04 Jan 2025 15:09:17 +0200 Message-ID: <86v7uud8ua.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24145"; 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 Sat Jan 04 14:10:24 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 1tU3v5-00068k-Tn for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 14:10:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tU3un-0004zB-CR; Sat, 04 Jan 2025 08:10:05 -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 1tU3ul-0004xX-BO for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 08:10:03 -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 1tU3ul-0000DR-0C for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 08:10:03 -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=T3QVHTRoS200WphlvyQWsMc9n77b5fIWLgkSheszN1g=; b=cRaEUuw0u2S8FP3u5gCyCm85tbErDovIVVh8ktiZwlYPsPIwLW55lIghwrZKHr1x1nw+f24s+w7DFFiu89+Z2sHGcqb0UMjxMFlAq+9KduWqDJelvXJJvM04eVwPv2457Tm9A0gYx3894ogSwWCkb2OXMyXDc7gkiDrmjHPIBE5AVZyTPHNUyv6v1dD603cDt9UZ32GqkbBO3YgyLYEBYFBp6NZVBrPCmvI9FI8H/iQRKduZBymgHnxeuAGyC2Qq6R6y5PWwkb00fa2zs6PkoNGfOzyCGTJNcFh85wExU48vkqUyi3/IWmim8vjpG52i3ChQWVYscj7pa4VZpBCnCw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tU3uj-0007E0-Q2 for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 08:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2025 13:10:01 +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.173599617527717 (code B ref 65719); Sat, 04 Jan 2025 13:10:01 +0000 Original-Received: (at 65719) by debbugs.gnu.org; 4 Jan 2025 13:09:35 +0000 Original-Received: from localhost ([127.0.0.1]:53860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tU3uG-0007Ct-3X for submit@debbugs.gnu.org; Sat, 04 Jan 2025 08:09:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54372) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tU3uA-0007Ca-Ik for 65719@debbugs.gnu.org; Sat, 04 Jan 2025 08:09:29 -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 1tU3u4-00009H-Ij; Sat, 04 Jan 2025 08:09:20 -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=T3QVHTRoS200WphlvyQWsMc9n77b5fIWLgkSheszN1g=; b=S0Fk+5lEcqwv z4tAMwb14IYcTXc2c691JYAvNlp3xdFbVHJLEhqJHTpy1MkPOJLFj5B4KPSUOHWN0O3Oh0rGps3kV hRqZGH4ite178Sxsy4VKf6kYVQaoDNc1G2cUlMWzSCV/3VqW8FItv287yVRXIDnWW2titk584wNcF ZfCpe6W+jEVl5cQXlWlsc2Qb2wtlD46U8BRgCkp7P/KEz3hH1+/f81NNZPxpnZq3QhOFCJRkNTi4Q kCF+tuAd4ymWJSq8ptNVpK/FqqizzycjKSf6BqCvYzoxYrW7SwuysUl1kxgysyymgzhMhSkOtJnQX 4RB0UHPD/82Odag8ghuvdw==; In-Reply-To: <60592464472415a836939db15e38a8cf@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:298393 Archived-At: > Date: Thu, 02 Jan 2025 14:07:33 +0000 > From: me@elken.dev > Cc: 65719@debbugs.gnu.org, stefankangas@gmail.com > > On 2024-02-12 17:35, Eli Zaretskii wrote: > > [Please use Reply All to reply, to keep everybody CC'ed.] > > > >> Date: Mon, 12 Feb 2024 17:21:04 +0000 > >> From: Elken > >> > >> The use case that raised it for me was loading perspective workspaces > >> when I restart in place (due to a > >> configuration change or other reason) but I don't want to load the > >> workspaces every time I start Emacs. > > > > And why cannot you use kill-emacs-query-functions for this purpose? > > Bumping this patch again as it would be nice to have in. To answer the > question more clearly (I thought I did before, my apologies) using > kill-emacs-query-functions would technically work but also add another > prompt every time I quit or restart. It makes sense to have a clear > separation of quitting for good and restarting in place. Sorry, I still don't follow. What does your kill-emacs-query-functions hook do when passed the RESTART argument that is different from RESTART being nil (i.e. killing Emacs without restarting it)? And what does "loading workspaces" mean in this context? > I also noticed this morning that `kill-emacs` and `restart-emacs` don't > handle the prefix argument for the hooks. What would these hooks do with the prefix argument? In any case, the prefix argument is available via current-prefix-arg.