From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id qJ3MBrMAWWVXEgAA9RJhRA:P1 (envelope-from ) for ; Sat, 18 Nov 2023 19:21:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qJ3MBrMAWWVXEgAA9RJhRA (envelope-from ) for ; Sat, 18 Nov 2023 19:21:39 +0100 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 93FB346F98 for ; Sat, 18 Nov 2023 19:21:38 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=OIaEqEKf; dmarc=none; arc=pass ("zohomail.com:s=zohoarc:i=1"); 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" ARC-Seal: i=2; s=key1; d=yhetil.org; t=1700331699; a=rsa-sha256; cv=pass; b=RQvxkJhivHsCu0BFgHqquEPdhogXzosBlA5tEqTZNWfYR4TCNfT1jzfJXJYLxA0Amxh4p2 0FvH/K0Lds57wKCx8yMWELguZBDXUrL+8EKpqq79CAz2w//AVawuqkVY6qZixUjkJ0PxVG DEJiLJzHFyh6zQHNnokzNeq2d6ex46FulewLTu7G7nwHdoxRLKAdQ3T9rEIQVFVejQMDYL VtBn1F6W0JKq88f1zyHGrsASWr9M/rA87WHspHzyXqpt1qlHqOioXyPSKu2ea7CwgMiEua pGaJR6L9tsG5zXhP0S/bucCw6pzjMfidRk1HXMnQ07ikmCjTV+Yt24OPqXrLIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700331699; 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=mAPfpD16L2pDXplowhlYWEYWEHy4m8/cEDs60M6SfFY=; b=Aly+3wEWpPjI+3ucM/oaMcwWoHNtO/BtwWjJ2rkxUZltXSVFdo/5VTWFaO+n9Ok4lk9Vst D9KDwBLp+qsAKmo2mBC41n7aXvv1jcNf9GuasKsvUIj2ZkyN7k8JWDn8Qh0o/R9qM6vy3d aCJ0jf0rrRc0z/RAFKy0LoFPeyPOeb7ZYhCajUEgH0rlI7p1KijlDek3nygrira6Sz+u4j SLUk29Zpp10nwCBV+ky2rruqfkTDpw3OkB0fbqSgmq6bAyI50MQSc776Ab5rvWo0TNt93p WA6q4V8vgiPl4DqUnTbrxA+OUt80e7NbpevhmrjAWL+uRc7Zn9CsaCWgbotd5g== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=OIaEqEKf; dmarc=none; arc=pass ("zohomail.com:s=zohoarc:i=1"); 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4PwH-0006VQ-N9; Sat, 18 Nov 2023 13:21:07 -0500 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 1r4Pw6-0006N6-65 for emacs-orgmode@gnu.org; Sat, 18 Nov 2023 13:20:56 -0500 Received: from sender3-op-o18.zoho.com ([136.143.184.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Pw4-0002RA-KE for emacs-orgmode@gnu.org; Sat, 18 Nov 2023 13:20:53 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1700331649; cv=none; d=zohomail.com; s=zohoarc; b=V/lPL42ghU0B0Dbv0038ilyJ+wc1WfAt3Al0m7FBt7nxtzwvni/rySUV+qOVgwt0cyDZvb/VZO3HoRgFAQkLmYLgRygR+SiFsEds4m/PA0ctv917Yguzu+RQslqGVRiDNwXiEbfjVFig63S509Ksz8E2drUnCOuegPSIgoAnH94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700331649; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=mAPfpD16L2pDXplowhlYWEYWEHy4m8/cEDs60M6SfFY=; b=aCjm0O6OoEfVXC5grb5xLzwYxkRRz+UHxwu3RbtxoLKcPUtL34t1qLIaSeQ4UFZav1/PB8D1iheUtTpVx1f99cKe+0aVRoUud/zMAmjAgvWPm+f3kl/4HIkMudn54T9B6nZfiHzGTeXYQNzoxu4sLTfrG+4r0BuH4YfBQzfXrRc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=excalamus.com; spf=pass smtp.mailfrom=matt@excalamus.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1700331649; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:Date:From:From:To:To:Cc:Cc:Message-Id:Message-Id:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Reply-To; bh=mAPfpD16L2pDXplowhlYWEYWEHy4m8/cEDs60M6SfFY=; b=OIaEqEKfY+nDLD6aUx54p2l/r3ymx6FzbUpAQ37waOW4foMhFmcEpPaCWfAfw+vy 17tNRdkCkJRTnAqYJ3zVrFQPqYLM0jRn5tlZRV7qTwmZMPjkgiDbYL6s0eqJN206hN3 E0dCJr0tli4G8AphMhy663Vps/qi6RZ6pFxWyzjc= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 170033164758925.09229768647458; Sat, 18 Nov 2023 10:20:47 -0800 (PST) Date: Sat, 18 Nov 2023 19:20:47 +0100 From: Matt To: "Max Nikulin" Cc: "emacs-orgmode" Message-Id: <18be3a9f244.11331358a3423956.2826184920394948569@excalamus.com> In-Reply-To: References: Subject: [BUG] ob-shell: :cmdline fails with single argument (was Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_11050663_1925682003.1700331647556" Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-1.1.0/200.232.44 Received-SPF: pass client-ip=136.143.184.18; envelope-from=matt@excalamus.com; helo=sender3-op-o18.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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-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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -7.74 X-Migadu-Queue-Id: 93FB346F98 X-Migadu-Spam-Score: -7.74 X-TUID: dubAXZVMGkp+ ------=_Part_11050663_1925682003.1700331647556 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit ---- On Sat, 18 Nov 2023 16:54:39 +0100 Max Nikulin wrote --- > I have faced an inconsistency with :cmdline treatment in ob-shell.el. These are sadly easy to find. If you run: #+begin_src bash :cmdline 1 echo "$1" #+end_src Then it fails with list: Wrong type argument: sequencep, 1 However, running this works: #+begin_src bash :cmdline "1" echo "$1" #+end_src I didn't dig too much into it, but it looks like :cmdline expects a sequence. When multiple arguments are passed, such as :cmdline 1 2 3, then "1 2 3" is passed into process-file. (sequencep "1 2 3") is t. (sequencep 1) is nil. So, to work around this a single :cmdline argument must be surrounded by quotes to make it a sequence. (sequencep "1") is t. Obviously, this should be fixed. Attached is a patch to test for this whenever we're ready to tackle making execution mutually consistent. I'm still reviewing the library and am not quite ready for that yet. ------=_Part_11050663_1925682003.1700331647556 Content-Type: application/octet-stream; name=test-cmdline-with-single-argument-shouldnt-require-quotes.patch Content-Transfer-Encoding: 7bit X-ZM_AttachId: 139196244475570030 Content-Disposition: attachment; filename=test-cmdline-with-single-argument-shouldnt-require-quotes.patch diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el index 879555af0..d41387e57 100644 --- a/testing/lisp/test-ob-shell.el +++ b/testing/lisp/test-ob-shell.el @@ -436,6 +436,19 @@ exiting with a non-zero return code multiple times." (buffer-string))))) (kill-buffer "*Org-Babel Error Output*"))) +(ert-deftest test-cmdline-with-single-argument-shouldnt-require-quotes () + "The original implementation of :cmdline required a single element +to be surrounded by goes to work." + (should + (equal 1 + (org-test-with-temp-text + ;; "#+begin_src sh :cmdline \"1\" :shebang #!/bin/bash + "#+begin_src sh :cmdline 1 #!/bin/bash +echo \"$1\" + +#+end_src" + (org-babel-execute-src-block))))) + (provide 'test-ob-shell) ;;; test-ob-shell.el ends here ------=_Part_11050663_1925682003.1700331647556--