From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Peter Ludemann Newsgroups: gmane.emacs.bugs Subject: bug#55560: 29.0.50; kill-emacs on daemon doesn't remove ~/.emacs.d/.emacs.desktop.lock Date: Sat, 21 May 2022 13:43:42 -0700 Message-ID: References: <837d6e8y27.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000cbbece05df8babf0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19803"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55560@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 21 22:45:30 2022 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 1nsVyb-0004x6-9S for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 May 2022 22:45:29 +0200 Original-Received: from localhost ([::1]:42930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsVyZ-0007Oi-Tk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 May 2022 16:45:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsVyA-0007NN-O6 for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49155) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsVyA-000888-1m for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nsVy9-00058f-VW for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Peter Ludemann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 May 2022 20:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55560 X-GNU-PR-Package: emacs Original-Received: via spool by 55560-submit@debbugs.gnu.org id=B55560.165316587119690 (code B ref 55560); Sat, 21 May 2022 20:45:01 +0000 Original-Received: (at 55560) by debbugs.gnu.org; 21 May 2022 20:44:31 +0000 Original-Received: from localhost ([127.0.0.1]:43052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsVxf-00057W-1Y for submit@debbugs.gnu.org; Sat, 21 May 2022 16:44:31 -0400 Original-Received: from mail-pg1-f171.google.com ([209.85.215.171]:46999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsVxZ-00057G-Dc for 55560@debbugs.gnu.org; Sat, 21 May 2022 16:44:29 -0400 Original-Received: by mail-pg1-f171.google.com with SMTP id j21so10275769pga.13 for <55560@debbugs.gnu.org>; Sat, 21 May 2022 13:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5/zmM2hR+d86tXKNHgMPMOIjfnCgSlvAtOscn68d88w=; b=GwYJj4vo1V0D/0KjvcHwj4mZTRVEMMoWe/fpoE/+7kQXbZITYQ7OEGwf6cJoW5dqLc KfCHgX3FM/jqfIHvlcOfp+vQF4pBEVElUJvBMD1g1Zv0xl1ZJx5YjdLv9OjTVW0L2wQw 0dIcSd2POuhyfHgjtdJ8QneSLx626rwhv3OLYMjHwTCBnMJ//9Ztkopt7+xLi4mg631v 287KGTM9fZ9fRBeh/P9I1hq1UEZpw4ngvHnedrSxDvxVUot/96J+FQ680L58WOmm7Efe 86X2qn+Gzvg1vJ12n8DGMg7zvDhYkjRJh1CMgya/skZFHmrcC65NL0KnvQgUMlCA1q6s LKug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5/zmM2hR+d86tXKNHgMPMOIjfnCgSlvAtOscn68d88w=; b=E/HTKL6aU4YQxqLknlT9lv/Xk/B80+DATD6gIOXwqGZJjPkkoMXKMiTixPvg5g2CAb H8LLNHyenIt+1cvCknNNL1GRZ8ttdQcxiBskzAdptmjhhpiZJYPXGjlogWYHiW2DtihG EFeDyfmkMtAzuix4h8nHXqFktmbLrDx211dUNdtpb2cCsk7nNkNgS1CcJZEyw99DpsYI V/jXKK/1flFagwkuAqT8ktHHV+YDZGu0csOZMO3HNrdNu783kZpBqpoUTT7JTBipHL24 SnVUlavocnFvSeCT7ic+mw5QSWvXibhop3ps0Q3SboDQLklKg5F3GaVDs/tnoCJWtyZi 1KRA== X-Gm-Message-State: AOAM532iFBV2I3w0QqoPP6t5mZh2HNWx0Yt8eyyVGvSLzJFtYTvwDvos OqZwuwHKrQVJGRrfAgYPV/Q1TJpZKvhZPVNw5p/DzTssmEg= X-Google-Smtp-Source: ABdhPJxQXutN0vLaRjYzBpGK5yWYr2FE9H7+luL4u4TnurNYmkkC5Poee91eYRs+5U+ggytzQ0gzVwMXq/4NtsptI+k= X-Received: by 2002:a63:1953:0:b0:3c6:e5e:9190 with SMTP id 19-20020a631953000000b003c60e5e9190mr13786618pgz.286.1653165859256; Sat, 21 May 2022 13:44:19 -0700 (PDT) In-Reply-To: <837d6e8y27.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:232854 Archived-At: --000000000000cbbece05df8babf0 Content-Type: text/plain; charset="UTF-8" The various wikis are somewhat out of date. For example, this shows how to create custom functions that do what save-buffers-kill-emacs does: https://www.emacswiki.org/emacs/EmacsAsDaemon Also, the documentation for kill-buffers and save-buffers-kill-emacs makes no mention of the lock file. Anyway, when I do "emacs --daemon -Q", "emacsclient -e 'save-buffers-kill-emacs'" worked fine; but when I run the daemon without the "-Q", the "emacs -e 'save-buffers-kill-emacs'" command just sits there with no output. The problem seems to be that I have this in my .emacs: (setq kill-emacs-query-functions (cons (lambda () (yes-or-no-p "Really kill Emacs? ")) kill-emacs-query-functions)) which sets kill-emacs-query-functions to: ((lambda nil (yes-or-no-p "Really kill Emacs? ")) desktop-kill) [I don't know where the "desktop-kill" comes from] I often accidentally do ^X-^C when I run emacs in non-daemon mode, so I'd like to keep this hook, or something similar. Is there a better way of getting an "are you sure" message that works with both daemon and non-daemon? --000000000000cbbece05df8babf0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The various wikis are somewhat out of date. Fo= r example, this shows how to create custom functions that do what save-buff= ers-kill-emacs does:=C2=A0https://www.emacswiki.org/emacs/EmacsAsDaemon

Also, the = documentation for kill-buffers and save-buffers-kill-emacs makes no mention= of the lock file.

Anyway, when I do "emacs --daemon -Q", &q= uot;emacsclient -e 'save-buffers-kill-emacs'" worked fine; but= when I run the daemon without the "-Q", the "emacs -e '= save-buffers-kill-emacs'" command just sits there with no output. = The problem seems to be that I have this in my .emacs:

(setq kill-emac= s-query-functions
=C2=A0 =C2=A0 =C2=A0(cons (lambda () (yes-or-no-p &quo= t;Really kill Emacs? "))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0k= ill-emacs-query-functions))

which sets kill-emacs-query-functions = to:
((lambda nil
=C2=A0 =C2=A0(yes-or-no-p "Really kill Emacs? &quo= t;))
=C2=A0desktop-kill)

[I don't know where the=C2=A0"= ;desktop-kill" comes from]

I often accidentally do ^X-^C when I r= un emacs in non-daemon mode,=C2=A0so I'd like to keep this hook, or som= ething similar. Is there a better way of getting an "are you sure"= ; message that works with both daemon and non-daemon?

--000000000000cbbece05df8babf0--