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.devel Subject: Re: master f8b2a01a9e: * lisp/shell.el (shell): Query shell file name from `interactive` Date: Sun, 29 May 2022 19:13:25 +0200 Message-ID: <87leukw9ca.fsf@gmx.de> References: <165365729037.13166.16983049289085077158@vcs2.savannah.gnu.org> <20220527131450.B347BC01683@vcs2.savannah.gnu.org> <87zgj2vwtz.fsf@gmx.de> <87v8tpwrzq.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22903"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 29 19:14:34 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nvMUr-0005mS-P5 for ged-emacs-devel@m.gmane-mx.org; Sun, 29 May 2022 19:14:33 +0200 Original-Received: from localhost ([::1]:41350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvMUo-0005iN-7j for ged-emacs-devel@m.gmane-mx.org; Sun, 29 May 2022 13:14:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvMTt-0004wj-CO for emacs-devel@gnu.org; Sun, 29 May 2022 13:13:33 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:48749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvMTr-0006sf-CG for emacs-devel@gnu.org; Sun, 29 May 2022 13:13:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1653844407; bh=M7Gd5uhHOdUbFWvzI2LYKnCwGgPExfaXv6iOegiLolA=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=hEOo+icspXSUkxTn2ecX4gV4+DE/Crh4R//uCAXlYCX9JxuMObj/PtoIlyXh9yO5t iHzESh4zeOv7D8Lmgsgl9QQIztJVwoACmk45smKFp3o2lmcIg74iN2N8mhoN2SDMoV I3Rm/2oE/KhMlmQ9xgZ0S3HgJG0fyf3xxhLnBx/A= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.159.102]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTiU3-1oOoWJ3vdl-00U1s4; Sun, 29 May 2022 19:13:27 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 28 May 2022 13:58:35 -0400") X-Provags-ID: V03:K1:li54PkCfH2fytM6ya19hAH8VAYg7poo7fDHUNSPhtgJN6q3tZjb wxqsYCeqhPL30xr4yqPSyc7/yrZgb/QX4XBGwKaj3rI26Zzi0o2Q30L4gWq1r2GHCrIUDcj X5YMe7VC/brQd87H89hWxOAuTqU+eSUNdYmG2AFCgDDyhYPsiBjKlAql2sorT/YXE/wJVqp I6mkhWtgjCtLvt7iZFRdg== X-UI-Out-Filterresults: notjunk:1;V03:K0:rAXcYBL/a4M=:s8D7dGHCZPdzgpNKf8JwYS aOLd3l4CdJbPbXSAH5V3Q39HEg09f7tj/qtY78xcY82edA1D5egixb9Jdfe4hGpisDr0vC3nU Re9cUjvqt/cpzFIGXj7lalDFM/nYGSVdWDLFr0L5ZndTGQ3aU43Ft4sH7sO3Mf/dKDR/LZAIl j6P6p8Bfus2U22iBm6J5T93AWvUwSqjb+WP552e3CA0wgT/PwntL8i+719PZ/54MWTLD1Z4nU pVweXGC7UqNgXufgyvAYRDnu2e8HjmhI5QLKIPrHRvQbuF6tngvKMdO2sqEr+GA2ScLnfyQId GqCN9tOQbYGHCBDvFNoCAUtQgR0gG5BgLCXDf3KdJMEq8MuDr4vujg9GG/WZaP3OCF1Q9NBZd mfnnRZ4vAotqb/Hp+1BuO5cFkLjviD4y6cHfY8MeppzDaM6q5ARdFRR++cLloSdM2wnM/qVWd AqdtMO7kr5+A4AYHl8hK6n8i011tSEFpnrI/wHGMU+KGsQY/VuaJVXh1fyIJuhbTW7R9qOTyz hnbDapqc8RboLEmX0H8tATJMc2UU+ggeR3Y5b7NRXs/qTVVtuw+sYcjA2Ier3uD9LMw226yvO wDMu1ThxIh5KFx52IMvo80IAVTdUf3uQA6AOjsXat/+rkGm4XVGksdr5u7NqX289dSmsCJrVf 8qSNBT9mQ6vOs0cPN82ygVdCGct9e5OvCnfhOng/fbAsv2bw5o4LdX8UJgF4qvP/PKQJLqqff 52irHaIIWQYbRUDBweLqgWBpcrS+Cz1IV0IGidV1pviII8KNKlMBwWPjcd8eNl7p0CIyp5uP Received-SPF: pass client-ip=212.227.15.15; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290356 Archived-At: Stefan Monnier writes: Hi Stefan, >>> Does the patch below look correct to you? >>> It also tries to address the FIXME while we're at it. >> I'm not sure. You use `buffer', and not `buf' for the interactive spec. > > Could you clarify what you mean by that? > > I check nullness of `buffer` so as to preserve the existing behavior > where we prompt for the shell's directory only when current-prefix-arg > is specified. > > And the interactive spec returns (list buffer ...) rather than (list > buf ...) again so as to preserve the existing behavior (tho I don't > think it would make any difference in practice other than the > information it leaves in `command-history`). > >> OTOH, you set `default-directory' in `buf', which might cure it. > > Cure what? I've tested the patch now, it looks correct. >> Anyway, it would be an incompatible (but appreciated) change. > > What change are you referring to? Forget it. I hoped, that if you re-use the *shell* buffer, which has an exited shell, that this buffer would change it's default-directory to the default-directory of the current buffer when the shell is re-invoked. Something like this: --8<---------------cut here---------------start------------->8--- M-x cd RET /tmp M-x shell ; You're in the *shell* buffer, running the shell on your local host. exit ; The *shell* buffer has exited the shell. C-x b M-x cd RET /ssh:remotehost:/tmp M-x shell ; The *shell* buffer shall be remote now. --8<---------------cut here---------------end--------------->8--- But this didn't happen :-( >> If you have an existing shell buffer, it would be reused as-it-is, and >> you cannot change its remoteness. Something, which has been plagued me >> since ever. > > Hmm... I don't understand. AFAICT both with my new code and with the > existing code `C-u M-x shell` will prompt for the shell's directory if > it's done from within (and "to") a shell buffer with remote > default-directory, no? I'm speaking about reusing an existing *shell* buffer, and invoking M-x shell w/o a prefix. It would be helpful, if there could be an interaction when the remoteness of default-directory of the current and the *shell* buffer don't match. >> Hmm, do we have test cases for this, for both the local and the remote >> case, for both an existing and a new shell buffer? > > AFAICT we don't (we have rather few tests in `shell-tests.el`). > >> (If not, I could volunteer to write them, but it might take some >> days then.) > > That would be very appreciated. I'll see what can be done. > Stefan Best regards, Michael.