From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8ISaJwqIvWEMfgAAgWs5BA (envelope-from ) for ; Sat, 18 Dec 2021 08:04:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wuxaIwqIvWFucQAA1q6Kng (envelope-from ) for ; Sat, 18 Dec 2021 07:04:42 +0000 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 DDBC334A64 for ; Sat, 18 Dec 2021 08:04:41 +0100 (CET) Received: from localhost ([::1]:54284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myTlo-0004LT-V3 for larch@yhetil.org; Sat, 18 Dec 2021 02:04:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myTkb-0004Kh-St for emacs-orgmode@gnu.org; Sat, 18 Dec 2021 02:03:26 -0500 Received: from sender3-op-o11.zoho.com ([136.143.184.11]:17724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myTkZ-0006Wv-O1 for emacs-orgmode@gnu.org; Sat, 18 Dec 2021 02:03:25 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1639810994; cv=none; d=zohomail.com; s=zohoarc; b=cmN+CZYGjG9BPjN8HFDA17/eoRK1NQxvLU8C/S+i1tff9wZV/F6+0U2EYIG7lwzLhNqmWcSDs8tWL7C/mIvWMmjzsnxQHywqBS2wfmbJVEra1z7cuj3mk5kE2P9OHm4VA4IQOEGrJyjnX5zmTYkZvfxoG2c2Wsf/UFQ39pNOqj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639810994; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=pA4+/5bZTYx7G2ndTszXyXhvkbrLPUZC/jFXEO9yLpY=; b=egpGlZjjNa772jVaFXMhzafp0DqVZVshyV7cXziA13jFhJKNWA2EDttmSgdYzctCgGOopHK0VcGcMWJnPEx7+nnsNWAvcCppqaw+ChQfuu+j9KVURRBqwcn1Lz+hkQEPASxgmr7WrUpe9mIQ/WO0strgDF/lgbfxO3kj0HJawes= 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=1639810994; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:From:To:Cc:Message-Id:In-Reply-To:References:Subject:MIME-Version:Content-Type; bh=pA4+/5bZTYx7G2ndTszXyXhvkbrLPUZC/jFXEO9yLpY=; b=Fe99OwgDsVxCHYu84/HeMGA8Kbf0YwH7Yu3ouUNJo3OOj7g1Oy1Ps31pPZHZ9Q6h q0geAn61WdNnstKyFhbzjPRO2k+9xdm44gvQuCMYuXK+SevtrGRfvJIoNBD0KLKqjk2 pmy1c8Wl8jj00yQ7O3YPrxlC+b/DyMyIjD72XhgI= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1639810993789719.5385642437641; Fri, 17 Dec 2021 23:03:13 -0800 (PST) Date: Sat, 18 Dec 2021 02:03:13 -0500 From: Matt To: "Thomas S. Dye" Message-Id: <17dcc5a0e3e.d8ca0ef6361712.4976360594738663013@excalamus.com> In-Reply-To: <87bl1u49ru.fsf@tsdye.online> References: <17d48f09729.ddbece82213631.8340272801066201269@excalamus.com> <87pmqs58mx.fsf@gmail.com> <17d53474fd6.c0a62421660695.6561002670353136607@excalamus.com> <87lf13pcme.fsf@gmail.com> <17d8ddd76f7.d167f605179643.3635445903460764440@excalamus.com> <87bl1u49ru.fsf@tsdye.online> Subject: Re: [PATCH] ob-shell-test, test-ob-shell and introduction MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1153277_2043513261.1639810993726" Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-Zoho-Virus-Status: 1 Received-SPF: pass client-ip=136.143.184.11; envelope-from=matt@excalamus.com; helo=sender3-op-o11.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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: emacs-orgmode , Timothy Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639811082; 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=pA4+/5bZTYx7G2ndTszXyXhvkbrLPUZC/jFXEO9yLpY=; b=bwXjz7j5Ay70p8qlRmfon+4ANir/gRuJ6vrZqasoiymiEp3CA/PVrT+0wFqVLq5CgsPJZh G2/HBA4R/iCuYSf3Z/CUykkwfNqF3FZLOGtwsY2V4qK1kxh9E4tWIvtsnNzjMH4PPeRJPa QDdzF2RRG4y1mxqDXuxj0oRJPrIZdwtkUxcUMSlpieNvAg/KxnBIHVneoXA+pkifgMkTjo 1Xv//AK1Ut2AOYS6LtrkOmTuZAOOGeLxB441mXArAPiAEfJ+W2BMIVSGcqcQR2huBw3oEI uydMUUGPsiCBHmKmxJF/0w6nHqrsD4NuttrYWTVDHSYnH4hvfkQJwrp3zdFBLg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1639811082; a=rsa-sha256; cv=fail; b=hO7jtkaIk12l7LmwM/rvI2TH/JTIjmkS5WR3gTMprqdaJOHOv9FM/aRKZlS6qE8rtLd45H 8TDOB7mAr8E/VGYP6zi33vkQRJDvTZaPDtLw+IqCDo8wb+IG/JptuF22QuVTX0Y1Ban1pp FmbaEE6AGyzQuYc4AV2hL3/jLJmH9gYSP2LucrgfodzfijIVeRZDZSApn8FqhlYpjBB6o3 d38glgQgzU4L8Ya7sDkzOmoEXnxxsl8/SL8MtjZfk7y8GpmIg+ubuUWjBA2dgQ4QO3eHZD RIEAP47xYHe6VAraakY8cL+9xCgdBZ3E1n4onWCHkOUCW1P7OIop0EHe7THY1g== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=excalamus.com header.s=zmail header.b=Fe99OwgD; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); dmarc=none; 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: -1.79 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=excalamus.com header.s=zmail header.b=Fe99OwgD; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); dmarc=none; 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: DDBC334A64 X-Spam-Score: -1.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: YLoQnR7uu6VG ------=_Part_1153277_2043513261.1639810993726 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit > Contributions to Worg aren't similarly restricted. Feel free to > push material there in the meantime. Looks like the email finally got sent to the right person at my company. Who knows how long it will take for them to get the FSF disclaimer back to me... Now that I'm on holiday, I've got a little more time to contribute to Worg. Here's a few patches showing what I've come up with. I'll finish it up in the next few days, hopefully. Not sure if the patches are formed correctly, sorry about that if not. It's late here and I wanted to show progress. I'll worry about those kinds of details later. :) ------=_Part_1153277_2043513261.1639810993726 Content-Type: application/octet-stream; name=0001-Draft-introduction-and-setup.patch Content-Transfer-Encoding: 7bit X-ZM_AttachId: 138591037937290040 Content-Disposition: attachment; filename=0001-Draft-introduction-and-setup.patch >From 0d12f927d049749f960a5b4385c1f8029e859a3b Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 18 Dec 2021 01:46:29 -0500 Subject: [PATCH] Draft introduction and setup --- org-contrib/babel/languages/ob-doc-shell.org | 141 ++++++++++++++++--- 1 file changed, 120 insertions(+), 21 deletions(-) diff --git a/org-contrib/babel/languages/ob-doc-shell.org b/org-contrib/babel/languages/ob-doc-shell.org index 46ce0a6f..825e17d2 100644 --- a/org-contrib/babel/languages/ob-doc-shell.org +++ b/org-contrib/babel/languages/ob-doc-shell.org @@ -2,7 +2,7 @@ #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) #+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n) -#+TITLE: Shell Source Code Blocks in Org Mode +#+TITLE: Shell Code Blocks in Babel #+AUTHOR: Matt Trzcinski #+EMAIL: matt[at]excalamus[dot]com #+LANGUAGE: en @@ -10,6 +10,9 @@ #+HTML_LINK_HOME: https://orgmode.org/worg/ #+EXCLUDE_TAGS: noexport +# TODO remove this +#+options: toc:nil + #+name: banner #+begin_export html
@@ -26,21 +29,21 @@ posh.

- - - - zsh, - - - fish, - - - ksh, - - - mksh, and - - + + + + + + + + + +

#+end_export @@ -63,12 +66,84 @@ - [ ] Describe [[Other]] differences from supported languages - [ ] Provide brief [[Examples of Use][Examples of Use]] * Introduction - - Brief description of language. - - Range of typical uses within Org Mode. +# - Brief description of language. +A shell is a user interface for interacting with system services. +File management, process execution, and operating system monitoring +can all be done with a shell. Many shells are plain text only whereas +some support graphics or are themselves fully graphical. Similarities +exist between shells and, though standards exist (such as +POSIX[fn:1]), there is no guarantee that what works in one shell will +work in another. Each shell is a separate application. + +Shells often provide a programming language as well as access to +system utilities, such as the GNU Core Utilities[fn:2]. Users can +stitch utilities together or create their own. + +# - Range of typical uses within Org Mode. +Org Babel lets users run commands[fn:3] in separate shells... + +: #+begin_src sh :results output +: echo PID: $$ +: #+end_src +: +: #+RESULTS: +: : PID: 9952 +: +: #+begin_src sh :results output +: echo PID: $$ +: #+end_src +: +: #+RESULTS: +: : PID: 9990 +: +...or as part of a shared session. + +: #+begin_src sh :results output :session shared +: echo PID: $$ +: export X=1 +: #+end_src +: +: #+RESULTS: +: : PID: 9742 +: +: #+begin_src sh :results output :session shared +: echo PID: $$ +: echo X was set to $X +: #+end_src +: +: #+RESULTS: +: : PID: 9742 +: : X was set to 1 + +Shell blocks can run as standalone scripts or chained processes, be +tangled, use args, work with stdin, have shebangs, and more. + * Requirements and Setup - - Installation and configuration of language software - - Emacs configuration - - Org-mode configuration (org-babel-do-load-languages) +# - Installation and configuration of language software +Org Babel can run many different shells, including [[https://www.gnu.org/software/bash/][sh]], [[https://www.gnu.org/software/bash/][bash]], [[https://www.zsh.org/][zsh]], +[[https://fishshell.com/][fish]], [[https://www.grymoire.com/unix/csh.html][csh]], [[https://www.in-ulm.de/~mascheck/various/ash/][ash]], [[http://gondor.apana.org.au/~herbert/dash/][dash]], [[http://www.kornshell.org/][ksh]], [[https://www.mirbsd.org/mksh.htm][mksh]], and [[https://packages.qa.debian.org/p/posh.html][posh]]. The primary requirement is +that the shell be installed on the system. + +# - Emacs configuration +# - Org-mode configuration (org-babel-do-load-languages) +Once the shell is installed on the system, the Org Babel shell +language facility must be set to load[fn:4]: + +#+begin_example emacs-lisp +;; active Babel languages +(org-babel-do-load-languages + 'org-babel-load-languages + '((shell . t))) +#+end_example + +*NOTE:* This is all that's needed, regardless of the shell you intend +to use! The "shell" loads functionality for /all/ supported +shells. The car of =(shell . t)=, namely "shell", is the name of the +Org Babel module that handles it, =ob-shell.el=. + +*NOTE:* The =ob-shell.el= module used to be named =ob-sh.el=. This was +changed in Org 8.2[fn:5]. + * Babel Features for Language Source Code Blocks ** Header Arguments - Language-specific default values @@ -84,3 +159,27 @@ - Hello World! - Common uses - Links to tutorials and other resources + +* Footnotes + +[fn:1] https://opensource.com/article/19/7/what-posix-richard-stallman-explains + +[fn:2] https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands + +[fn:3] https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#index-_0024_0024 + +[fn:4] https://orgmode.org/worg/org-contrib/babel/languages/index.html#configure + +[fn:5] https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/etc/ORG-NEWS#n3995 + +#+begin_example +,* Version 8.2 + +,** Incompatible changes +,*** =ob-sh.el= renamed to =ob-shell= +This may require two changes in user config. + +1. In =org-babel-do-load-languages=, change =(sh . t)= to =(shell . t)=. +2. Edit =local.mk= files to change the value of =BTEST_OB_LANGUAGES= + to remove "sh" and include "shell". +#+end_example -- 2.34.0 ------=_Part_1153277_2043513261.1639810993726 Content-Type: application/octet-stream; name=0001-org-contrib-babel-languages-ob-doc-shell.org-Create-.patch Content-Transfer-Encoding: 7bit X-ZM_AttachId: 138591037937400000 Content-Disposition: attachment; filename=0001-org-contrib-babel-languages-ob-doc-shell.org-Create-.patch >From 682eb6bd14d7d7246e3f13517adcd9ffb1a38ae0 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 22 Nov 2021 22:57:38 -0500 Subject: [PATCH] org-contrib/babel/languages/ob-doc-shell.org: Create file * ob-doc-shell.org Create file. Fill out links and images. --- org-contrib/babel/languages/ob-doc-shell.org | 86 ++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 org-contrib/babel/languages/ob-doc-shell.org diff --git a/org-contrib/babel/languages/ob-doc-shell.org b/org-contrib/babel/languages/ob-doc-shell.org new file mode 100644 index 00000000..46ce0a6f --- /dev/null +++ b/org-contrib/babel/languages/ob-doc-shell.org @@ -0,0 +1,86 @@ +#+OPTIONS: H:3 num:nil toc:2 \n:nil ::t |:t ^:{} -:t f:t *:t tex:t d:(HIDE) tags:not-in-toc broken-links:nil +#+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks +#+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) +#+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n) +#+TITLE: Shell Source Code Blocks in Org Mode +#+AUTHOR: Matt Trzcinski +#+EMAIL: matt[at]excalamus[dot]com +#+LANGUAGE: en +#+HTML_LINK_UP: index.html +#+HTML_LINK_HOME: https://orgmode.org/worg/ +#+EXCLUDE_TAGS: noexport + +#+name: banner +#+begin_export html +
+

+ Babel shell support, including: sh, + bash, + zsh, + fish, + csh, + ash, + dash, + ksh, + mksh, and + posh. +

+

+ + + + zsh, + + + fish, + + + ksh, + + + mksh, and + + +

+
+#+end_export + +* Template Checklist [4/12] :noexport: + - [X] Revise #+TITLE: + - [X] Indicate #+AUTHOR: + - [X] Add #+EMAIL: + - [X] Revise banner source block [3/3] + - [X] Add link to a useful language web site + - [X] Replace "Language" with language name + - [X] Find a suitable graphic and use it to link to the language + web site + - [ ] Write an [[Introduction]] + - [ ] Describe [[Requirements and Setup][Requirements and Setup]] + - [ ] Replace "Language" with language name in [[Org Mode Features for Language Source Code Blocks][Babel Features for Language Source Code Blocks]] + - [ ] Describe [[Header Arguments][Header Arguments]] + - [ ] Describe support for [[Sessions]] + - [ ] Describe [[Result Types][Result Types]] + - [ ] Describe [[Other]] differences from supported languages + - [ ] Provide brief [[Examples of Use][Examples of Use]] +* Introduction + - Brief description of language. + - Range of typical uses within Org Mode. +* Requirements and Setup + - Installation and configuration of language software + - Emacs configuration + - Org-mode configuration (org-babel-do-load-languages) +* Babel Features for Language Source Code Blocks +** Header Arguments + - Language-specific default values + - Language-specific header arguments +** Sessions + - Support or not + - Typical use for sessions +** Result Types + - Which result types are supported? +** Other + - Differences from other supported languages +* Examples of Use + - Hello World! + - Common uses + - Links to tutorials and other resources -- 2.34.0 ------=_Part_1153277_2043513261.1639810993726--