From unknown Tue Jun 17 20:15:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#77276 <77276@debbugs.gnu.org> To: bug#77276 <77276@debbugs.gnu.org> Subject: Status: 30.1; find-alternate-file no longer disconnects emacsclient Reply-To: bug#77276 <77276@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:15:37 +0000 retitle 77276 30.1; find-alternate-file no longer disconnects emacsclient reassign 77276 emacs submitter 77276 "Jay Berkenbilt" severity 77276 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 07:45:03 2025 Received: (at submit) by debbugs.gnu.org; 26 Mar 2025 11:45:03 +0000 Received: from localhost ([127.0.0.1]:41800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txPBt-00018V-PC for submit@debbugs.gnu.org; Wed, 26 Mar 2025 07:45:03 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38700) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txPBp-00017t-PZ for submit@debbugs.gnu.org; Wed, 26 Mar 2025 07:44:59 -0400 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 1txPBj-0003Vd-NK for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2025 07:44:51 -0400 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1txPBg-0008LN-C2 for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2025 07:44:51 -0400 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 2C67825400DE for ; Wed, 26 Mar 2025 07:44:44 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-07.internal (MEProxy); Wed, 26 Mar 2025 07:44:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ql.org; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm1; t=1742989484; x=1743075884; bh=Je/Vtmtus5wqvT3KSjAlTnM8q/kDQVAp 6PuR9nubZ7Q=; b=kdWJeHrtoVsO3t7uliw+fO/PdN+HBSdNQkZoRAdXiWuoQRxd HA7H2OeO+0JBktPBxOCx14MEVvS9+089oSMt+FkBhun3JmtFEl1RGujhhyWKxxQV KR6JZVr2mxwfNbC47DPq6L7z2kgvD2fHkaIMJphqP4tiWrqXEZupsyKJoxPQXGFe Tt/SkIhDwszpc8Ary1xIeIiLriLrqtWPdMcqCKj+6SSZYbSvepdWg1BMKqWKfKz9 wMtVX5NoLnfmP75q8PmEUR0zjdFBBDXaightQd3Yqnblprfaox9ZgXnQS4nK1Wq0 vwQK+SBVRKxz5REZFPalfEv4Xlr5Uivvn4qXJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1742989484; x= 1743075884; bh=Je/Vtmtus5wqvT3KSjAlTnM8q/kDQVAp6PuR9nubZ7Q=; b=E 27NrFN8i4jlIWt05b/VpVTXOsfizM09h4eb/s6EGSPvPDrxrSd4Och1TedRpV4Ph GT7iXhSIv+INuS0tI6OztZg1YUmhzUhj8tiAWF0lFVh0jp4DuW1IvT+dBxoVUPaF N6oisTraanslIyaY9VMto1XcV7/DYQjUr4P9IJCjbbDeytdBLW3N4HRqsY4zIozk YmgfknJw1AqJvZqtxhPdJNcoFIbHySilny433G8PNjwFNTwKMbCQ7hSPCAtLwdfB HktRcs5Vm+3WF9nOLaxV7aB1Z75dvQO8EGvN7D2gw12m4Yc7aLQJkf1bFaEfzLMU E9gazwb/fe1egO3wTn08w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieehgeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefogg ffhffvkffutgesrgdtreerredttdenucfhrhhomhepfdflrgihuceuvghrkhgvnhgsihhl thdfuceovghjsgesqhhlrdhorhhgqeenucggtffrrghtthgvrhhnpedtieekhefhgeelff ehieeiudetueekffejtdeltdeltddugfduhfehleehvefhgfenucffohhmrghinhepvghm rggtshdrrghpphenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegvjhgssehqlhdrohhrghdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhht phhouhhtpdhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: ibd3147ef:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A4309780068; Wed, 26 Mar 2025 07:44:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Wed, 26 Mar 2025 07:43:42 -0400 From: "Jay Berkenbilt" To: bug-gnu-emacs@gnu.org Message-Id: Subject: 30.1; find-alternate-file no longer disconnects emacsclient Content-Type: multipart/alternative; boundary=8979b2c266374655a65fcc86d4c83541 Received-SPF: pass client-ip=202.12.124.157; envelope-from=ejb@ql.org; helo=fhigh-b6-smtp.messagingengine.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --8979b2c266374655a65fcc86d4c83541 Content-Type: text/plain Content-Transfer-Encoding: 7bit The issue I'm describing occurs in emacs 30 but not emacs 29 or earlier. I noticed it in during emacs 30.0.93 but didn't immediately recognize it as a bug. You can see the generated information below, but I have also reproduced this on macOS with emacs -Q, and it also happens on my Linux system (with emacs -Q) where I build emacs myself, so I don't believe this is environment-specific. When you run emacsclient to open a file in an existing emacs, and then run M-x find-alternate-file on the same file (e.g., C-x C-v RET), the file loses its connection with emacsclient, but emacsclient does not exit. In prior versions, emacsclient would exit after C-x C-v RET. emacs 30: shell% emacsclient /tmp/a emacs: C-x C-v RET ;; emacsclient is still waiting emacs: C-x # ;; nothing happens; the buffer is no longer connected with emacsclient emacs 29 and earlier: shell% emacsclient /tmp/a emacs: C-x C-v RET ;; emacsclient exits emacs: C-x # ;; nothing happens; the buffer is no longer connected with emacsclient Explicitly killing the buffer with C-x k does cause emacsclient to exit. This is probably related to a change in find-alternate-file as the problem occurs with emacs 30 and emacsclient from emacs 29 but not with emacs 29 and emacsclient from emacs 30. I consider the older behavior to be more desirable and less surprising as emacsclient shouldn't hang around waiting for an event that will never occur. In both emacs 29 and 30, CTRL-c on emacsclient will cause the buffer to be removed from emacs before but not after C-x C-v, which I consider to be correct/expected behavior. The fact that CTRL-c on emacsclient after C-x C-v leaves the buffer alone also shows that emacsclient is no longer connected to the file in emacs 30 after C-x C-v. Note that explicitly killing the buffer with C-x k still causes emacsclient to exit. I have been using this technique since the dawn of time, perhaps as long as I've been using emacsclient (which probably goes back to emacs 18 for me) to intentionally disconnect a file from emacsclient. I'm not sure whether there's a better way. I'm trying to retrain my muscle memory to emacsclient -n, but this change of behavior has made me realize how deeply this is ingrained into my habits. Anyway, it's not uncommon for me to do something like `emacsclient *.tf` and then flip through the files doing C-x # on the ones I don't want and C-x C-v RET on the ones I do. Generated information below. In GNU Emacs 30.1 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.65 Version 12.7.6 (Build 21H1320)) of 2025-02-24 built on armbob.lan Windowing system distributor 'Apple', version 10.3.2575 System Description: macOS 15.3.2 Configured using: 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no' Configured features: ACL GLIB GMP GNUTLS JPEG LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Terraform Minor modes in effect: terraform-format-on-save-mode: t server-mode: t global-visual-wrap-prefix-mode: t visual-wrap-prefix-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /Users/ejb/.emacs.d/elpa/editorconfig-20240604.602/editorconfig hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig /Users/ejb/.emacs.d/elpa/editorconfig-20240604.602/editorconfig-core hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-core /Users/ejb/.emacs.d/elpa/editorconfig-20240604.602/editorconfig-conf-mode hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-conf-mode /Users/ejb/elisp/startup hides /Applications/Emacs.app/Contents/Resources/lisp/startup /Users/ejb/.emacs.d/elpa/editorconfig-20240604.602/editorconfig-tools hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-tools /Users/ejb/.emacs.d/elpa/editorconfig-20240604.602/editorconfig-core-handle hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-core-handle /Users/ejb/.emacs.d/elpa/editorconfig-20240604.602/editorconfig-fnmatch hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-fnmatch Features: (shadow sort flyspell ispell mail-extr warnings emacsbug imenu terraform-mode dash hcl-mode shell pcomplete yaml-mode misearch multi-isearch vc-git diff-mode track-changes easy-mmode markdown-mode color thingatpt noutline outline cap-words superword subword use-package-ensure cl-extra help-mode use-package-core vc-svn vc vc-dispatcher qmime qmime-compose qmime-view filecache server compile-eslint rx compile ange-ftp comint ansi-osc ansi-color ring message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader cc-styles cc-align cc-engine cc-vars cc-defs jka-compr visual-wrap cus-load advice ahk-mode-autoloads cmake-mode-autoloads company-autoloads dockerfile-mode-autoloads flycheck-golangci-lint-autoloads flymake-go-staticcheck-autoloads go-mode-autoloads groovy-mode-autoloads jinja2-mode-autoloads json-mode-autoloads kotlin-mode-autoloads lsp-mode-autoloads ht-autoloads lua-mode-autoloads lv-autoloads markdown-mode-autoloads mermaid-mode-autoloads prettier-autoloads editorconfig-autoloads nvm-autoloads f-autoloads iter2-autoloads rust-mode-autoloads spinner-autoloads terraform-mode-autoloads hcl-mode-autoloads tide-autoloads flycheck-autoloads s-autoloads info dash-autoloads typescript-mode-autoloads web-mode-autoloads xterm-color-autoloads yaml-mode-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 153394 31179) (symbols 48 15524 0) (strings 32 44243 2071) (string-bytes 1 1173627) (vectors 16 23749) (vector-slots 8 232341 13472) (floats 8 195 122) (intervals 56 1844 55) (buffers 992 17)) --8979b2c266374655a65fcc86d4c83541 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
The issue I'm describing occurs in emacs 30 but not emacs = 29 or earlier. I noticed it in during emacs 30.0.93 but didn't immediate= ly recognize it as a bug. You can see the generated information below, b= ut I have also reproduced this on macOS with emacs -Q, and it also happe= ns on my Linux system (with emacs -Q) where I build emacs myself, so I d= on't believe this is environment-specific.

When you run e= macsclient to open a file in an existing emacs, and then run M-x find-al= ternate-file on the same file (e.g., C-x C-v RET), the file loses its co= nnection with emacsclient, but emacsclient does not exit. In prior versi= ons, emacsclient would exit after C-x C-v RET.

emacs 30:<= br>
shell% emacsclient /tmp/a
=
emacs: C-x C-v RET  &n= bsp; ;; emacsclient is still waiting
emacs: C-x #   ;; nothing happens; the buffer is no lo= nger connected with emacsclient

emacs 29 and earlier:
=
shell% emacsclient /tmp/a
emacs: C-x C-v RET   = ; ;; emacsclient exits
emacs: C-x= #   ;; nothing happens; the buffer is no longer connected wit= h emacsclient

Explicitly killing the buffer with C-x k do= es cause emacsclient to exit.
This is probably related to a c= hange in find-alternate-file as the problem occurs with emacs 30 and ema= csclient from emacs 29 but not with emacs 29 and emacsclient from emacs = 30.

I consider the older behavior to be more desirable and le= ss surprising as emacsclient shouldn't hang around waiting for an event = that will never occur. In both emacs 29 and 30, CTRL-c on emacsclient wi= ll cause the buffer to be removed from emacs before but not after C-x C-= v, which I consider to be correct/expected behavior. The fact that CTRL-= c on emacsclient after C-x C-v leaves the buffer alone also shows that e= macsclient is no longer connected to the file in emacs 30 after C-x C-v.=  Note that explicitly killing the buffer with C-x k still causes em= acsclient to exit.

=
I have been using this technique since= the dawn of time, perhaps as long as I've been using emacsclient (which= probably goes back to emacs 18 for me) to intentionally disconnect a fi= le from emacsclient. I'm not sure whether there's a better way. I'm tryi= ng to retrain my muscle memory to emacsclient -n, but this change of beh= avior has made me realize how deeply this is ingrained into my habits. A= nyway, it's not uncommon for me to do something like `emacsclient *.tf` = and then flip through the files doing C-x # on the ones I don't want and= C-x C-v RET on the ones I do.
Generated information below.

In GNU Emacs 30.1 (build 1, aarch64-apple-darwin21.6.0, NS=
appkit-2113.65 Version 12.7.= 6 (Build 21H1320)) of 2025-02-24 built on
armbob.lan
Wi= ndowing system distributor 'Apple', version 10.3.2575
System De= scription:  macOS 15.3.2
<= /div>

Configured using:
'configure --with-ns '--enable-locallisppath=3D/Library/Application<= br style=3D"max-width:100%;height:auto;">
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules 'CFLAGS=3D-DFD_SETSIZE=3D10000=
-DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=3Dno'
Configured features:
ACL GLIB GMP GNUTLS JPEG LIBXML2 MO= DULES NOTIFY KQUEUE NS PDUMPER PNG
RSVG SQLITE3 THREADS TIFF TO= OLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB

Important= settings:
  value of $LANG: en_US.UTF-8
  l= ocale-coding-system: utf-8-unix

Major mode: Terraform=

Minor modes in effect:
  terraform-for= mat-on-save-mode: t
  server-mode: t
  globa= l-visual-wrap-prefix-mode: t
  visual-wrap-prefix-mode: t<= br style=3D"max-width:100%;height:auto;">
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t<= br style=3D"max-width:100%;height:auto;">
  mouse-wheel-mode: t
  file-name-shadow-mod= e: t
  global-font-lock-mode: t
  font-lock-= mode: t
  blink-cursor-mode: t
  minibuffer-= regexp-mode: t
  column-number-mode: t
  lin= e-number-mode: t
  auto-composition-mode: t
 = ; auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/Users/ejb/.emacs.d/elpa/edito= rconfig-20240604.602/editorconfig hides /Applications/Emacs.app/Contents/Resou= rces/lisp/editorconfig
/Users/ejb/.emacs.d/elpa/editorconfi= g-20240604.602/editorconfig-core hides /Applications/Emacs.app/Contents/R= esources/lisp/editorconfig-core
/Users/ejb/.emacs.d/elpa/ed= itorconfig-20240604.602/editorconfig-conf-mode hides /Applications/E= macs.app/Contents/Resources/lisp/editorconfig-conf-mode
/Us= ers/ejb/elisp/startup hides /Applications/Emacs.app/Contents/Resources/lisp/startup=
/Users/ejb/.emacs.d/elpa/editorconfig-20240604.602/editorc= onfig-tools hides /Applications/Emacs.app/Contents/Resources/lisp/editor= config-tools
/Users/ejb/.emacs.d/elpa/editorconfig-20240604= .602/editorconfig-core-handle hides /Applications/Emacs.app/Conten= ts/Resources/lisp/editorconfig-core-handle
/Users/ejb/.emac= s.d/elpa/editorconfig-20240604.602/editorconfig-fnmatch hides /Applicati= ons/Emacs.app/Contents/Resources/lisp/editorconfig-fnmatch

Features:
(shadow sort flyspell ispell mail-extr wa= rnings emacsbug imenu
terraform-mode dash hcl-mode shell pcompl= ete yaml-mode misearch
multi-isearch vc-git diff-mode track-cha= nges easy-mmode markdown-mode
<= /div>
color thingatpt noutline outline = cap-words superword subword
use-package-ensure cl-extra help-mo= de use-package-core vc-svn vc
<= /div>
vc-dispatcher qmime qmime-compose= qmime-view filecache server
compile-eslint rx compile ange-ftp= comint ansi-osc ansi-color ring
message sendmail yank-media pu= ny dired dired-loaddefs rfc822 mml mml-sec
epa derived epg rfc6= 068 epg-config gnus-util text-property-search
time-date mm-deco= de mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-ut= il ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailhe= ader cc-styles cc-align cc-engine cc-vars cc-defs jka-compr
vis= ual-wrap cus-load advice ahk-mode-autoloads cmake-mode-autoloads
company-autoloads dockerfile-mode-autoloads
flycheck-golangci= -lint-autoloads flymake-go-staticcheck-autoloads
go-mode-autolo= ads groovy-mode-autoloads jinja2-mode-autoloads
json-mode-autol= oads kotlin-mode-autoloads lsp-mode-autoloads
ht-autoloads lua-= mode-autoloads lv-autoloads markdown-mode-autoloads
mermaid-mod= e-autoloads prettier-autoloads editorconfig-autoloads
nvm-autol= oads f-autoloads iter2-autoloads rust-mode-autoloads
spinner-au= toloads terraform-mode-autoloads hcl-mode-autoloads
tide-autolo= ads flycheck-autoloads s-autoloads info dash-autoloads
typescri= pt-mode-autoloads web-mode-autoloads xterm-color-autoloads
yaml= -mode-autoloads package browse-url url url-proxy url-privacy
ur= l-expand url-methods url-history url-cookie generate-lisp-file
ur= l-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs icons password-cache json subr-x map byte-= opt
gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc is= o-transl
tooltip cconv eldoc paren electric uniquify ediff-hook= vc-hooks
lisp-float-type elisp-mode mwheel term/ns-win ns-win = ucs-normalize
mule-util term/common-win tool-bar dnd fontset imag= e regexp-opt fringe
tabulated-list replace newcomment text-mode= lisp-mode prog-mode register
<= /div>
page tab-bar menu-bar rfn-eshadow= isearch easymenu timer select
=
scroll-bar mouse jit-lock font-l= ock syntax font-core term/tty-colors
frame minibuffer nadvice s= eq simple cl-generic indonesian philippine
cham georgian utf-8-= lang misc-lang vietnamese tibetan thai tai-viet lao
korean japa= nese eucjp-ms cp51932 hebrew greek romanian slovak czech
europe= an ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclos= ure
cl-preloaded button loaddefs theme-loaddefs faces cus-face = macroexp
files window text-properties overlay sha1 md5 base64 f= ormat env
code-pages mule custom widget keymap hashtable-print-= readable backquote
threads kqueue cocoa ns multi-tty make-netwo= rk-process emacs)

Memory information:
((cons= es 16 153394 31179) (symbols 48 15524 0) (strings 32 44243 2071)
(string-bytes 1 1173627) (vectors 16 23749)
(vector-slots 8 2= 32341 13472) (floats 8 195 122)
(intervals 56 1844 55) (buffers= 992 17))

--8979b2c266374655a65fcc86d4c83541-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 09:02:51 2025 Received: (at 77276) by debbugs.gnu.org; 26 Mar 2025 13:02:51 +0000 Received: from localhost ([127.0.0.1]:42037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txQPC-00088S-VQ for submit@debbugs.gnu.org; Wed, 26 Mar 2025 09:02:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50844) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txQPA-00088F-Ag for 77276@debbugs.gnu.org; Wed, 26 Mar 2025 09:02:48 -0400 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 1txQP4-0004DW-BN; Wed, 26 Mar 2025 09:02:42 -0400 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=CCv5rBjwPaX2BL8A5+Ihxng7PP4qkQebSSNPG3V8/1U=; b=q6JhBVDsUTWn yEaTz3kGEwpzYhkV/KAxYkqKNezg9rmfv+Dwyi/DPowYYBUKGjk8z2F6y9C3NLlT8S2+8VAbWWozq RLsi2BIYXcsEpYUSc56A099n+JmSsxPMMjOjTD9IrC/fvoEzKuSuHg855xyBo0uOQGBV0l0w9bUuU R4/ss/84459b+z+hPiJUsopDdlBt9EYb1DqypcBR3EyvjKP4AsTkws7BLGSJun7bgxVRGJtI38OkJ JTihnuYQpEhyqkphw44Xy1ti1p+ybYDaPDNoU8Tgt2ALzP3ps0PnXIlvEDbLYScAv1Stslm0O+r1x qDEtjjHUVgV4sNMv85dy/g==; Date: Wed, 26 Mar 2025 15:02:38 +0200 Message-Id: <861pukdjwx.fsf@gnu.org> From: Eli Zaretskii To: "Jay Berkenbilt" In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#77276: 30.1; find-alternate-file no longer disconnects emacsclient References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77276 Cc: 77276@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 26 Mar 2025 07:43:42 -0400 > From: "Jay Berkenbilt" via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > The issue I'm describing occurs in emacs 30 but not emacs 29 or earlier. I noticed it in during emacs 30.0.93 > but didn't immediately recognize it as a bug. You can see the generated information below, but I have also > reproduced this on macOS with emacs -Q, and it also happens on my Linux system (with emacs -Q) where I > build emacs myself, so I don't believe this is environment-specific. > > When you run emacsclient to open a file in an existing emacs, and then run M-x find-alternate-file on the > same file (e.g., C-x C-v RET), the file loses its connection with emacsclient, but emacsclient does not exit. In > prior versions, emacsclient would exit after C-x C-v RET. > > emacs 30: > shell% emacsclient /tmp/a > emacs: C-x C-v RET ;; emacsclient is still waiting > emacs: C-x # ;; nothing happens; the buffer is no longer connected with emacsclient > > emacs 29 and earlier: > shell% emacsclient /tmp/a > emacs: C-x C-v RET ;; emacsclient exits > emacs: C-x # ;; nothing happens; the buffer is no longer connected with emacsclient > > Explicitly killing the buffer with C-x k does cause emacsclient to exit. > > This is probably related to a change in find-alternate-file as the problem occurs with emacs 30 and > emacsclient from emacs 29 but not with emacs 29 and emacsclient from emacs 30. This was a deliberate change, see bug#65277. The previous behavior was surprising at least, if not a simple bug. > I consider the older behavior to be more desirable and less surprising as emacsclient shouldn't hang around > waiting for an event that will never occur. In both emacs 29 and 30, CTRL-c on emacsclient will cause the > buffer to be removed from emacs before but not after C-x C-v, which I consider to be correct/expected > behavior. The fact that CTRL-c on emacsclient after C-x C-v leaves the buffer alone also shows that > emacsclient is no longer connected to the file in emacs 30 after C-x C-v. Note that explicitly killing the buffer > with C-x k still causes emacsclient to exit. > > I have been using this technique since the dawn of time, perhaps as long as I've been using emacsclient > (which probably goes back to emacs 18 for me) to intentionally disconnect a file from emacsclient. I'm not > sure whether there's a better way. I'm trying to retrain my muscle memory to emacsclient -n, but this change > of behavior has made me realize how deeply this is ingrained into my habits. Anyway, it's not uncommon for > me to do something like `emacsclient *.tf` and then flip through the files doing C-x # on the ones I don't want > and C-x C-v RET on the ones I do. I don't think we should go back to previous behavior, but we might have a user option to get that old behavior back. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 14:19:41 2025 Received: (at 77276) by debbugs.gnu.org; 26 Mar 2025 18:19:41 +0000 Received: from localhost ([127.0.0.1]:44354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txVLo-00059N-DL for submit@debbugs.gnu.org; Wed, 26 Mar 2025 14:19:41 -0400 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]:56085) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txVLl-000592-Fp for 77276@debbugs.gnu.org; Wed, 26 Mar 2025 14:19:38 -0400 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 134E32540096 for <77276@debbugs.gnu.org>; Wed, 26 Mar 2025 14:19:31 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-07.internal (MEProxy); Wed, 26 Mar 2025 14:19:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ql.org; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1743013170; x=1743099570; bh=rG2wo8mFWDC4St1GN4iAjK0pb9DEJfQiP/cboeSautk=; b= yctlmOqa8BBSBhxNTBchSOBmt4jKKi8TDix2Fn1XUOCLkdFa9wRxEmWqlqnQ5jls 6WCxHIL0QWkRIbDS4sMI46mFINT+/Vx2W6BqidYMnaQ6ij94XfmxARP6tjUMasIb hE9/B+DCvk0O7i65na1DYsdrPzHEsr+bll/hdBptyXo3ZBKf9eWqWAv1jBMXZk5d VJHgoCSn0DgSb+MU0lIAqv1sxvbA8IAlrCO4fLWkQZCg3IbckQULB0i/akF/6WYM RVOmr1Pr1Gz8ZfeQcoZtT/PrYsfoZUihL5UiompoTCkVE1N8OIQdR2nCNWyuwyTz czqrkqTNQCJQ9G6T1O8tsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1743013170; x=1743099570; bh=r G2wo8mFWDC4St1GN4iAjK0pb9DEJfQiP/cboeSautk=; b=C0JAjIMUfx1EcBuQY RL0UK5cwoxM+gG3ipHS7TTuryAw5jvB/xwn0OGyX+0NXCn3zZa/F0Ibt9ON90IkA K6fZ//q4rtmXO1o2SGiQok3Xja0nidWdMxxG5pQrAbYi0rH/Sp0G8XXBFA2lB4Ma mn2McCx5+Jw4vZrO7wKCFlvOSUGYMqazPNGHs5/962vZk4bJkERsmC3T0Z12AanN K4muu+brjdsZAAVsAnTZYK95Yz8J65H9azQr4V9fFi6VPrzJiYtX+IUDoYqMnleG M671Hz5k+rPaNNLpy9Zmy+wWN1Gu3T0445UO5hVJegysvDlJuANWrFNui2ArvKze 1plmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieeivdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefogg ffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedflfgrhicuuegvrhhkvghn sghilhhtfdcuoegvjhgssehqlhdrohhrgheqnecuggftrfgrthhtvghrnhepgfdvvdduhf evtdfflefghfeugfdvteehvefhffdtvefggfehkeeugfevudeuueejnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghjsgesqhhlrdhorhhgpd hnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeejjedv jeeiseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ibd3147ef:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 60884780068; Wed, 26 Mar 2025 14:19:30 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: T4aac12ad4f25ab45 Date: Wed, 26 Mar 2025 14:19:10 -0400 From: "Jay Berkenbilt" To: 77276@debbugs.gnu.org Message-Id: <9bd9e782-a875-4803-a238-48e44ab557fe@app.fastmail.com> In-Reply-To: <861pukdjwx.fsf@gnu.org> References: <861pukdjwx.fsf@gnu.org> Subject: Re: bug#77276: 30.1; find-alternate-file no longer disconnects emacsclient Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77276 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Wed, Mar 26, 2025, at 9:02 AM, Eli Zaretskii wrote: > > Date: Wed, 26 Mar 2025 07:43:42 -0400 > > From: "Jay Berkenbilt" via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > > > > The issue I'm describing occurs in emacs 30 but not emacs 29 or earlier. I noticed it in during emacs 30.0.93 > > but didn't immediately recognize it as a bug. You can see the generated information below, but I have also > > reproduced this on macOS with emacs -Q, and it also happens on my Linux system (with emacs -Q) where I > > build emacs myself, so I don't believe this is environment-specific. > > > > When you run emacsclient to open a file in an existing emacs, and then run M-x find-alternate-file on the > > same file (e.g., C-x C-v RET), the file loses its connection with emacsclient, but emacsclient does not exit. In > > prior versions, emacsclient would exit after C-x C-v RET. > > > > emacs 30: > > shell% emacsclient /tmp/a > > emacs: C-x C-v RET ;; emacsclient is still waiting > > emacs: C-x # ;; nothing happens; the buffer is no longer connected with emacsclient > > > > emacs 29 and earlier: > > shell% emacsclient /tmp/a > > emacs: C-x C-v RET ;; emacsclient exits > > emacs: C-x # ;; nothing happens; the buffer is no longer connected with emacsclient > > > > Explicitly killing the buffer with C-x k does cause emacsclient to exit. > > > > This is probably related to a change in find-alternate-file as the problem occurs with emacs 30 and > > emacsclient from emacs 29 but not with emacs 29 and emacsclient from emacs 30. > > This was a deliberate change, see bug#65277. The previous behavior > was surprising at least, if not a simple bug. Reading through that bug, it looks like the intention was that emacsclient _should_ exit with find-alternate-file, and there was a lot of back and forth with various patches. In the end, perhaps the original issue was addressed, but it looks like the problem of find-alternate-file leaving emacsclient still running but C-x # not doing anything persists. This was even noted in an earlier stage of the patching in that issue and acknowledged as a problem, if I'm reading it right. I'm not suggesting that we should revert to some earlier behavior, but I think perhaps the bug wasn't fixed correctly and had this unintended side effect. I haven't studied the patches in detail, so I may be wrong about the sequence of events, but it does appear that the discussion acknowledges a running emacsclient with C-x # not doing anything as a problem. I think either emacsclient should exit, or the newly found file should replace the old one and C-x # should cause that to go away, but I think that would be counterintuitive. I find the new behavior to be surprising and a departure from how it's always worked (as I believe you actually pointed out), but I also see it as an unintended consequence of a different fix. > > I consider the older behavior to be more desirable and less surprising as emacsclient shouldn't hang around > > waiting for an event that will never occur. In both emacs 29 and 30, CTRL-c on emacsclient will cause the > > buffer to be removed from emacs before but not after C-x C-v, which I consider to be correct/expected > > behavior. The fact that CTRL-c on emacsclient after C-x C-v leaves the buffer alone also shows that > > emacsclient is no longer connected to the file in emacs 30 after C-x C-v. Note that explicitly killing the buffer > > with C-x k still causes emacsclient to exit. > > > > I have been using this technique since the dawn of time, perhaps as long as I've been using emacsclient > > (which probably goes back to emacs 18 for me) to intentionally disconnect a file from emacsclient. I'm not > > sure whether there's a better way. I'm trying to retrain my muscle memory to emacsclient -n, but this change > > of behavior has made me realize how deeply this is ingrained into my habits. Anyway, it's not uncommon for > > me to do something like `emacsclient *.tf` and then flip through the files doing C-x # on the ones I don't want > > and C-x C-v RET on the ones I do. > > I don't think we should go back to previous behavior, but we might > have a user option to get that old behavior back. If the old behavior includes the original problem of a frame unexpectedly disappearing, then maybe not. Perhaps we should focus just on eliminated this specific behavior of emacsclient sitting around waiting for something that is never going to happen. My $0.02. Thanks as always for the quick response.