From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter 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: Mon, 21 Mar 2022 11:04:32 -0700 Message-ID: <2004fb45-f690-5fa2-be48-f9c1b7f970f9@gmail.com> References: <87y213bo13.fsf@gmx.de> <83wngneawo.fsf@gnu.org> <87v8w7pfh7.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37290"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54487@debbugs.gnu.org To: Michael Albinus , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 21 19:05:51 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 1nWMPe-0009UK-5Q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 19:05:50 +0100 Original-Received: from localhost ([::1]:44786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWMPc-0000AQ-IZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 14:05:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWMOu-0000AE-Do for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 14:05:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWMOs-0003Gw-Ds for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 14:05:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWMOs-000793-9B for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 18:05: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.164788588127430 (code B ref 54487); Mon, 21 Mar 2022 18:05:02 +0000 Original-Received: (at 54487) by debbugs.gnu.org; 21 Mar 2022 18:04:41 +0000 Original-Received: from localhost ([127.0.0.1]:38170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWMOX-00078M-8t for submit@debbugs.gnu.org; Mon, 21 Mar 2022 14:04:41 -0400 Original-Received: from mail-pf1-f181.google.com ([209.85.210.181]:39634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWMOW-000789-2n for 54487@debbugs.gnu.org; Mon, 21 Mar 2022 14:04:40 -0400 Original-Received: by mail-pf1-f181.google.com with SMTP id u22so4776446pfg.6 for <54487@debbugs.gnu.org>; Mon, 21 Mar 2022 11:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=g3ppqSjGzVvf37LzCAsw0j99HKiwRUa/LXitVbimkFU=; b=XLsJ2sq/nAkpJDx7DhAxBXBE2vnLxv7ThATvr8Rln7FoCR0HTcLbXb9ems2S3KwKS1 eb5ArT/hnt5+rgoxKKGDSDskdHl9tcl/QEV2gaRJt1tfRyY6kgZ2eZgQh394jr6TNZ0I zR/VuQ8peRFUuaRMdKKDheQVzP8CHLo46QecB9f47OX4arZt5/ne58nvMazkGi4eJ+u9 isCE2mxtG9AV/wRsH9Y1oPera2dqKLvTOyWNJRciOa6/ChJlFysPxh8t4cPL15gYNHro zGoDKm3HkJjfcdh6G5poFN7eTZxamr7AxCp3tKt2iYBRon9OlWDUvNax56N4w+sNy+B6 T7Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=g3ppqSjGzVvf37LzCAsw0j99HKiwRUa/LXitVbimkFU=; b=1tauGxcZANt3SY0hbhRhT1lla/XOeoMMAHBEE6OdX14BKVxVrgkbyCSPALyR998mDd Q0306ZzLnGWnOlv9Z0D6Ngo3QXm+PI/dFR53doPX1M/l9k99grcY1IH4RQavKgSLrdx4 WSEbZQbWlCbH/dRVAEX+jVNkbmiO3NSl24qiKkpXD5zNEX08KKsrpN27fVE7f3t2gcNy 659DMQMyhLheKtuMDK1/vxafxDCi+aRyO4B0RN/8cEHnjHFSS3fAnlCx0HUDpcZs6Pmw x1vs3iCQVtgWWlE6o+5SUcXnL/zOKegFW6WuG/iIEOeDot9l0l+Ov8wgfuKPd3EhX2NG IG3w== X-Gm-Message-State: AOAM533u06KQLq0jbrEKdUb3zTZSe7DOglWub5H7QRnzQJ/AotdmhCvo s4JkwSc0vMdfhFnYfMa6S0M95unmFz4= X-Google-Smtp-Source: ABdhPJwOeQw+rOfncsL7QDp9H23HyCXyXsEVV04bBCfnFHzUfugAz6XuQig/04XKgtkb14FwX8XwEQ== X-Received: by 2002:a63:540b:0:b0:380:a069:c53c with SMTP id i11-20020a63540b000000b00380a069c53cmr19042965pgb.31.1647885874204; Mon, 21 Mar 2022 11:04:34 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id rm2-20020a17090b3ec200b001bf5647492esm134557pjb.20.2022.03.21.11.04.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Mar 2022 11:04:33 -0700 (PDT) In-Reply-To: <87v8w7pfh7.fsf@gmx.de> Content-Language: en-US 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:228704 Archived-At: 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. 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.) 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).