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#54487: 29.0.50; connection-local value for `shell-file-name' not set in Dired buffers over Tramp Date: Tue, 22 Mar 2022 10:44:04 +0100 Message-ID: <878rt2pbiz.fsf@gmx.de> References: <87y213bo13.fsf@gmx.de> <83wngneawo.fsf@gnu.org> <87v8w7pfh7.fsf@gmx.de> <2004fb45-f690-5fa2-be48-f9c1b7f970f9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13678"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54487@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 22 10:46:25 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 1nWb5t-0003OX-3r for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Mar 2022 10:46:25 +0100 Original-Received: from localhost ([::1]:48630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWb5r-0004yQ-Ps for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Mar 2022 05:46:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWb4Y-0003sK-OP for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2022 05:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWb4Y-0004pC-CK for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2022 05:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWb4Y-0005Om-3H for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2022 05:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Mar 2022 09:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54487 X-GNU-PR-Package: emacs Original-Received: via spool by 54487-submit@debbugs.gnu.org id=B54487.164794225420677 (code B ref 54487); Tue, 22 Mar 2022 09:45:02 +0000 Original-Received: (at 54487) by debbugs.gnu.org; 22 Mar 2022 09:44:14 +0000 Original-Received: from localhost ([127.0.0.1]:39211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWb3m-0005NR-DV for submit@debbugs.gnu.org; Tue, 22 Mar 2022 05:44:14 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:42287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWb3k-0005NB-8Z for 54487@debbugs.gnu.org; Tue, 22 Mar 2022 05:44:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1647942246; bh=VYyitCPmBmlH/ZLE1HAJu1kfqaQeGJfMZ4Os5v97daE=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ZERHmOLerkovqZ7Cpn0hDbGser3dI3YwKTLENVMU+pMyL8smKOWi/H4w/OjYRiCbX LGQycvdpza4TXRcl+cN9lGLXN19dkCUhIpOUlkIze26D1rH++1taofubWUdNlfrhAM ZtuuXrPYesX/UElGgFfHtBQPb7d8BF+tNkpl7ohc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.91.238.210]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1McpJg-1o6Cn939hC-00a0Zf; Tue, 22 Mar 2022 10:44:05 +0100 In-Reply-To: <2004fb45-f690-5fa2-be48-f9c1b7f970f9@gmail.com> (Jim Porter's message of "Mon, 21 Mar 2022 11:04:32 -0700") X-Provags-ID: V03:K1:rs4hHt08yWpRQFNsDYJsaml9GK6VrbzgM2QdVQu4XXOb4s1vwU2 pQOEsZ15JTCcLftI8EAvAO2VAa4Eq9mPekocCQ17cNrNPMI1mD7V7NG6UipbWQOBEDen8IX RGGkQwaieffjxgj2xaX+2NUyCSOtsYljKSsbxjr2FPgEogHSLEKhUO/ZBbx4LU0O+X1LRkG NHYrIJpo4M6mVrhJ5z08g== X-UI-Out-Filterresults: notjunk:1;V03:K0:8vnGpueSGOQ=:BsIeptsyAOYs+zVdtDUxFu otqqxkkbT+u4igMxiBrACqdTNr9x5gsYIh8N3Tup9BbXG5eRwymOj1Fgq+jhryv1N0bpOVQbU XUxicS63k0+tikFLCM2G9VcaeaxJ/EFvOl1a66JXa8Ul7I7F2A8OwpsGb4m6DafS0fDpP/NKa hTwRPove1DKQMWOC1IFi6CiX6Uo1esUUwJIM+MKE9bStMzGa2Mg2k9Zc4IoHjE1LbwWjqHibK fLopgoumOBU9/NZ0OfFDFKzgaZdKNtEmXrvtTqlr5wJFlyn0R0t/VBGrOpT35VOBUBiW+DYT4 L7NaBXhIHRqTvPft1dJc6yl/SzRl7l+6BR7PAWBtBO8wkaJQyDlikk0iRf08ysWryB6U9cmqC P7A/IaYwIhj8nZ1QJIIqebpNqvpLUVMSr+kVHqZnSiFHU7m6CnefbLKywXlBTNLgh/5Bp5400 ohohd/ed2lMuWwZMGA0FgK7ugHoSKEwkuZV4MFn+psGAXrhkz5rQ45mCechsFI1CXAwKDCUgA 3PcQUZmRg8Jd+p5RZxE/mcvOKS1fUYgxETeP10LUfAsgvUp/zLbu62m1DwvnTycyUpKZ3Is45 9+K5DXCC+N+RmfKAwv9xwOUOrEsc6oygQrAwSxAtFuBWI6c4P6otBZ3Le0po0Qu0DlCS+eHp2 qauYhoh+rzyr+b/R7n4UWEBkHHghFWrxRNCkU9wXQNZBTjyWAP3flZ19LxtXGrMzWVxzi2h/E RrlUgptqhNI380tUuwR28XeX3Uuw7QuW7EnB2wu3YD0W7j9mYKqkovbrMmQxvdCCS5fSX6EP 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:228741 Archived-At: Jim Porter writes: Hi Jim, > On 3/21/2022 7:06 AM, Michael Albinus wrote: >> I'll wait until Jim confirms that this works in general, then I would >> apply a patch along this spec. I've pushed a fix to master. It is different from what I have shown before, but shall serve as well. > The patch you posted works for me. Setting `shell-file-name' to > "/bin/sh" worked in my tests because it makes the function > `w32-shell-dos-semantics' return nil, so this condition in > `shell-quote-argument' isn't matched: > > ((and (eq system-type 'windows-nt) (w32-shell-dos-semantics)) > > That makes the shell-quoting use POSIX-style rules instead, which is > what we want if the default-directory is remote. Reading that code, I > think the `w32-shell-dos-semantics' part of that condition is there to > handle things like Cygwin builds, so maybe it's not quite right to > rely on that for the case I described in the original report. (That > said, I think it would only be an issue for some truly esoteric > configurations.) Fiddling with shell-file-name doesn't help in this case, because connection-local variables are not applied in every remote buffer, like in dired buffers. The more general collection of Tramp-aware connection-local variables could damage something else, that's why it is appled on programmatic request only. > On the other hand, I think I like the idea of having grep be aware of > connection-local variables even better. That's more flexible, and also > should work for the reverse case: if you call rgrep from a Tramp file > buffer, but change the search directory to a local path, rgrep uses > POSIX shell-quoting. It should use MS-Windows shell-quoting in that > case (since it's running the command on the local Windows system). Yep, I'll start now to work on this. The plan is to collect these specific connection-local variables in an own :application, so that they are set only with the given "grep" scope. For the scope of this bug report, it could be closed. But I'll like to keep it open for now in order to discuss possible problems with the connection-local variables approach. Best regards, Michael.