From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#60968: 30.0.50; M-x shell keeps an old default-directory Date: Fri, 20 Jan 2023 20:00:46 +0100 Message-ID: <87sfg5t4ip.fsf@gmx.de> References: <87tu0l3vdb.fsf@ledu-giraud.fr> Mime-Version: 1.0 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="36108"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 60968@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 20 20:01:22 2023 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 1pIwde-0009Hv-E0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Jan 2023 20:01:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIwdM-0001z9-IR; Fri, 20 Jan 2023 14:01: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 1pIwdK-0001z0-Ez for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 14:01:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIwdK-0007T0-6n for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 14:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIwdK-0005Wy-1g for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 14:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60968 X-GNU-PR-Package: emacs Original-Received: via spool by 60968-submit@debbugs.gnu.org id=B60968.167424125721242 (code B ref 60968); Fri, 20 Jan 2023 19:01:02 +0000 Original-Received: (at 60968) by debbugs.gnu.org; 20 Jan 2023 19:00:57 +0000 Original-Received: from localhost ([127.0.0.1]:47086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIwdE-0005WY-LG for submit@debbugs.gnu.org; Fri, 20 Jan 2023 14:00:56 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:40811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIwdC-0005WG-Gh for 60968@debbugs.gnu.org; Fri, 20 Jan 2023 14:00:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1674241248; bh=lXrHaDLxI5rs1DzCWw3xfxh41Bqshxg7C6rp1OMWu94=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Ho5+PPc3UpIgvbW/BJw+w31UeRbrI/aMA+jnUx6gH4AyKIaKfQFw/LHsIHdRxykL8 QGGSolSrTS7aMfZ43qj8cJlLBMAi7uc0UJwnRTverVEwNTtq3JyTJqPWw2Y/Gdkf7X 6xm+aWISY9p2aUewcIyhUlGirOVLCkV513B5snMGe607UsNxGZJHLZfQ/SvHOINJDo pLwBlp29YpSM2drJZP3kiwvmFFEagNUMFhk3gGsmkuOLyMdEp4kJ6SRPus6hWVnmLN KKb57uGAAFhMvk1ud8HE/K4f4TW8ciKycVo6cnna3nQ02mA/rGJYPMl7+wNfrjSoLu zkkcMNcgYBzXQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.37.45]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MF3DM-1pTw3T3dFI-00FPG9; Fri, 20 Jan 2023 20:00:47 +0100 In-Reply-To: <87tu0l3vdb.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Fri, 20 Jan 2023 19:37:36 +0100") X-Provags-ID: V03:K1:oEyQQmr0Tb1WK5RYFep8tqy6DVJXupxSkxKkKnaRxrIqW2DBcgr sB4hqaI9PLxYUk5AOgDPGA+JFQsRhnRmOuV+AmVwkr7aKL6PKQTyfplhSEYS16glG+yX3c8 BgNn0B97C9G4BLe6lCRckHLRVeM89yW5mChTu1fQ2T4GJ+nyrBJ81py4NWriFdr1tkAs+T/ v/1XaqEDra0B+BWQIt+xA== UI-OutboundReport: notjunk:1;M01:P0:c/0dCjGFkQc=;wlJAH58KfDWPDw61TjuffCi9qrJ HFH6IW8qToUQIC4NXhXU18C7P8jo8hGnTMZ1pCeySnzdMHivL4ZiX2qMZ4UAmDMqEi43BrPN/ PkJmo2BY6iNUEPRIHZ0QPpvYh3ux9HKYLfQOELYgA4FDCCks/7f0he1QAwTGdRfCTjZ8JXHKo hE/YQYN5cJuuEMw6030tdlg0ha0ysyWPkaQXqQRvyZN6gc9ciSHwFB5QYsFZC9biUI26DdRRT LzqPYByptmWBC+KFdl5mLnLTCZrAAA7iggasWFxWwUhWHTaUhW2UatYU4LnmXQI+h+mUV9HjS wzc7X3Jan3CY+0dEsj1WyOqMC3hO7QdetX+wmpIXs3zXVhhp4hAlWxmwHr5OMLiJyYFvCevB0 4I+3TFg8IhwRyVWmsrNPzqp4gYS3iNQAuyAq0QldEFTdMeSvmXL5OGNtsIZ+zJmUnB2CSplGp 1PzJ7TLdYkrxLcx9AZa9MYjwnbsb38nLV6VvgyYOkNszt8Il7FDB9OV71UK53EODhnDq/c+cN 4A7rp76ojs0tzWw9SAa38OB1DRAppDQBMdsYdH49agwzmNZJxxY+Ak+iAAclNYt7w2dxcW9ow PPvVWwk786BSKNfpzIewnTbipNn/eVePpcDfxOh9rxzpRkCHB2dhKNDccS2P/GEvs1ZqmIiVR DFnbl+AvF8oD7ipcAX3pZzTra+K9ofvom939tjQxS1AfTJNvdJ61a6HoBDYy4CKpJBCP3KSyc pNsJT1EFoSaB4qIrJEKnqka6fyQxqMl5e5iHgC4mZfDuBlZh9rqn+A1cCW5zVly/qY4lqXij 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:253792 Archived-At: Manuel Giraud writes: Hi Manuel, > Here is an annoyance I bump into sometimes. Recipe: > > C-x C-f /-:somewhere-remote: > M-x shell ;; Emacs asks me about the remote shell and that is not > ;; what I want > C-g > C-x C-f somewhere-local > M-x shell ;; Emacs still asks me about the previous remote shell > > It seems to come from the fact that when in shell.el line 865 the > "*shell*" buffer is already created and its default-directory set=E2=80= =A6 Or > maybe, I'm just doing it wrong when I want a shell. This is the specified behavior of the `shell' command. From the docstring: --8<---------------cut here---------------start------------->8--- If BUFFER exists but shell process is not running, make new shell. If BUFFER exists and shell process is running, just switch to BUFFER. --8<---------------cut here---------------end--------------->8--- That is, the shell buffer is reused, even if you have interrupted with C-g, and the shell didn't start yet. And so its default-directory. If you want another buffer (and another shell therefore), the following from the docstring is relevant: --8<---------------cut here---------------start------------->8--- Interactively, a prefix arg means to prompt for BUFFER. --8<---------------cut here---------------end--------------->8--- So your use case needs "C-u M-x shell". Or you delete the shell buffer after you have interrupted with C-g. Best regards, Michael.