From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uEPiOoh0FGMNHAEAbAwnHQ (envelope-from ) for ; Sun, 04 Sep 2022 11:48:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IFkoO4h0FGMk4QAA9RJhRA (envelope-from ) for ; Sun, 04 Sep 2022 11:48:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DDC7E3A470 for ; Sun, 4 Sep 2022 11:48:55 +0200 (CEST) Received: from localhost ([::1]:52854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUmFK-0001Ec-BK for larch@yhetil.org; Sun, 04 Sep 2022 05:48:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUmEh-0001EF-Br for emacs-orgmode@gnu.org; Sun, 04 Sep 2022 05:48:15 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:37502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUmEf-0004nm-F9; Sun, 04 Sep 2022 05:48:15 -0400 Received: by mail-pg1-x52e.google.com with SMTP id bh13so5740812pgb.4; Sun, 04 Sep 2022 02:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=fH/krCR2kmoBZas4XdS2M98wkLboEfnHADnkXHw/vLw=; b=L4OzwBByl9GTEoA7gYbMLIS9p23H91r1xWttPFDXKf1/H97nqvymOHN70ppllzIVxA oniEDltQLX1OwZgNPj70PBbgfNJTZwu+co9Wk/nJU5Nb5KYwvMODG+QVPVFKT0hSuxgA q8KWM+vb9A4iwEzxaUxVdxmtJAr8PGeHBpucRGEladMYP+KnTj9M5NtTwdaYAkQAG2ky +ftzMdzmJd5TQpPHQu4K+Z98TaCLzdtaZmoUWiu9csmVskRphOW54f+/SIFhOyg3X7xi 99Icuwo16F9UolAfKMDINDKMFL50GavS0Xe05BxGyXZg5zGKd+iliu8D1D6GIIemy3hd acGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=fH/krCR2kmoBZas4XdS2M98wkLboEfnHADnkXHw/vLw=; b=rVDUQlQrhCG2ZLWATm/om4SzWh/KClZXhvPgjg9cN/4ggKc4CWyvEn7vpOBgXwYt08 w5rYTA1frm7yPag2mpkjvdAPtmxSY3tPxrZivqjm3osa90ooZ/mX9+4x0tPB2pbCoRo9 Oz4K8B6DM5e4STEc1qeKp7XQ3tTaFE2H4X5Iz4sufG+yTcqzqh+nbUHELeC3qqvIJEo9 Wmgq5Rx6RWj7Hu50IlfZdlr3b3DmCzWj2JN8D9s8anzQd8y92xemmNVoVuUdr/XIFdmk 831+6W6hokFxBybARPDlwDzJk+1o9woOjRUneLdS5yDnm/Rl3dr0xKA2OXZfkhHd4gE1 Ye1g== X-Gm-Message-State: ACgBeo12qU5IAwgnLr472OEwLLzkq6eLIJVFnPgGzWFvlWWjddp9uyoB Z92AtdCmEm9szFLsJAIy5O0= X-Google-Smtp-Source: AA6agR6RVrFJEeHrl8YC7heE09VHAr5xJsh1K3NWXoslqGv1S6Ot+eoqXmCujDiERZ1yujt6mA9Mlw== X-Received: by 2002:a63:54a:0:b0:42b:22fa:bc4c with SMTP id 71-20020a63054a000000b0042b22fabc4cmr38110130pgf.434.1662284891583; Sun, 04 Sep 2022 02:48:11 -0700 (PDT) Received: from localhost ([2409:8a70:2b2:5800:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id f8-20020a170902ce8800b001714e7608fdsm5043069plg.256.2022.09.04.02.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 02:48:10 -0700 (PDT) From: Ihor Radchenko To: Bruno Barbier , Bastien Cc: Felix Freeman , emacs-orgmode@gnu.org Subject: Re: [BUG] ob-shell: cmdline and stdin broken when used with TRAMP In-Reply-To: References: <87k097a6on.fsf@localhost> Date: Sun, 04 Sep 2022 17:49:08 +0800 Message-ID: <87h71nxyej.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662284936; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fH/krCR2kmoBZas4XdS2M98wkLboEfnHADnkXHw/vLw=; b=Jq7TQqaf9KfK9LA3s6x18c2tp98ztTH8bimtgzEA2ePhSg+ez7pW8MSZUVyRHEqAx0D/WL PsBAa1+YYdm3JN8qpchSHf4+y+OZn7LXyzkrLo1rjG6skDh2MCTkOkuSVtO8NSp3LNx1w5 0RGmWC0FO7ncYCoWzU+Qw21FMZEmHqJR6UkQ5KspagodDHKfQ9WCtVVERvTMTSXuZHL861 unBCQpyXuDN1aW2PVW+2dHFy/U5T6ix+kkfQOaMDECSyIqC/++J2ykdg40iUEBcnU2FJo1 vTOXDp5TiQ/L0pno1S9ePmtjssYMpsd31pcscifXSsu4bF6715GTN2AIkHhDXQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662284936; a=rsa-sha256; cv=none; b=FsmGl7CDdPZKh2lP948IKY44Po2nhp/GKvNzIomqDkfmoGIYGvwsoBGGMAmwTKGGLazXmM Sem4D+P3AeX9e1CE3Hfsx1gfWcqThcBjv5cuT4L7mmkznq1tqN12FxVpPcWgiHcyc90wD0 1Q+niimnmLN1naNuDUGfOTItnuTEliIo3fRlC3OyrOl6iUzVJ3JxCjq7fufok+XY1QJryP 3SuR/dl/j2Zea47m1hug0S5tREXLmFwc8nkhlr/oqMRQrqU+l8CdAm2qoyDutcpITjT5pK mTYgmZ/bzdoabOAQWJBpcnoeoDxjCedBMwXCLnaCvYZM4YQ8fGA44YRfz7Yqig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=L4OzwBBy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.88 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=L4OzwBBy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DDC7E3A470 X-Spam-Score: -2.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: Er+yzOnxa/V+ Bruno Barbier writes: >> You patch is >15LOC so we do need your copyright assignment before >> merging. Let me know if you face any difficulties with the copyright >> process. Note that FSF should reply within 5 working days. > > Done. I just learnt a few days ago the process is done. Thanks! Bastien, could you please check the FSF record. >> > + (list shell-command-switch >> > + (concat (file-local-name script-file) " " cmdline))) >> >> Probably you do not need concat here. >> AFAIU, (list shell-command-switch (file-local-name script-file) cmdline) >> should be good enough as ARGS argument of `process-file'. > > The shell process should receive 2 arguments: the switch and the > command to execute. I think the 'concat' is mandatory here. > Am I missing something? You are probably right. `concat' does not heart anyway. >>> +(defconst org-test-tramp-remote-dir "/mock::/tmp/" >>> + "Remote tramp directory. >>> +We really should use 'tramp-test-temporary-file-directory', but that would require TRAMP sources.") >> >> Since TRAMP sources are not normally available, we can add this variable >> as defined in tramp-tests.el somewhere into testing/org-test.el, for >> example. > > > I've copy/pasted the logic used in GNU Emacs Tramp and added a macro. > I've added (require 'tramp) in the body; should I move it to the top > of the file ? Should not be a big deal to keep the require inside. > From d9abfb423bff620dee15d204f4bab48e2ec8dc4e Mon Sep 17 00:00:00 2001 > From: Bruno BARBIER > Date: Sat, 18 Jun 2022 09:48:01 +0200 > Subject: [PATCH] ob-shell: Use 'process-file' when stdin or cmdline '->` :: `process-file' > lib/ob-shell.el (org-babel-sh-evaluate): Use `process-file' (instead lisp/ob-shell.el > + (with-connection-local-variables I tried to test your patch on various Emacs versions. `with-connection-local-variables' is not yet available in Emacs 26. Emacs 26 has `with-connection-local-profiles' though I am not sure if it is a full equivalent. If not, you may need to create a compatibility wrapper for Emacs 26. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92