From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wIFjLXAlD19mLQAA0tVLHw (envelope-from ) for ; Wed, 15 Jul 2020 15:49:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ULJvKXAlD1/PXQAAB5/wlQ (envelope-from ) for ; Wed, 15 Jul 2020 15:49:04 +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 A7B989402D1 for ; Wed, 15 Jul 2020 15:49:03 +0000 (UTC) Received: from localhost ([::1]:35366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvjeX-0007lC-TQ for larch@yhetil.org; Wed, 15 Jul 2020 11:49:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvjdx-0007kk-OQ for emacs-orgmode@gnu.org; Wed, 15 Jul 2020 11:48:25 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:42156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jvjdv-0000o2-Oa for emacs-orgmode@gnu.org; Wed, 15 Jul 2020 11:48:25 -0400 Received: by mail-pg1-x534.google.com with SMTP id m22so3247686pgv.9 for ; Wed, 15 Jul 2020 08:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=m8BL7foCGDxO0VbLduzszXIG1wJfoxU3U1CCnQKYLSQ=; b=UCtFNBmKvaoHkiBdk5rYhCq2PNwQxht0U822vFD8z+/QzYMxaRLTcw35ihA6u+Jjvh C+y9qRHijt+jwhDvu0S9jU8yKA4hYbL0tPRgGpSmAanUtaoEU5aNd6ghlunJ0QevqRkp S4C95ICnPZ4rdsSDdSbSF4wd8Udk5RL/JrkhFiRd+tCKcGxxJa8pmTGpzGOAwtwgOB6o E3QVOHLVZN1tWdxPVl+iVtqT0BtIPPwodZnQXlypPyWcmIZ97bWytWzv1FgtOiGyowKu /kY/CP2um6T4vqJABv5g1nNHLMQPsT5yM5KqmgZ5slxuwKACDOXY0C1bbUX5jhiWucq3 PmKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=m8BL7foCGDxO0VbLduzszXIG1wJfoxU3U1CCnQKYLSQ=; b=Y2OuD8igZ4xKJ3/1mttvMulBxws0CUkNHZ8gluF7/VqHrtH8BWzGPwt3q5tSGV2t2A 2s8XrBsH/IwZ67WluvzOqe2UuOYrgcGmSL89QI/aGk6rIy9upm/2/5iL1xQ1oqjFkI79 IivjWbCpO3J1NZmR0/cJkU+GT5za9J0fJGFPFmjS/tZK41cqCAiwmPvLhY/uwJP1JQeg M0YGlP2HM0wIPGMdZeoW1gzw1c4LuuoJBdmYKq48kaf+tvV8TpjYIrhW8mo1dARjuKh0 npiSPr1AW34yjALRWT+uMcDJ5CJSD8CVYM3fJz3dz9titPjaeo6TuxCttihkuxj44iqY zAdA== X-Gm-Message-State: AOAM532PCJTkLpB3yXPPYAi3y8FtT1vOOIQ2XOkA/WHqQ70YP/woxLul 9uRAcvw9Hkhw7tbLj1iCUF/tTfafBNY= X-Google-Smtp-Source: ABdhPJwclrhNXEgHmkWZQl7Kx28jcoa9LW8MeCzbwIs6Zy7/7Dw04e1auo5QJXr+9sSvw229dZngkA== X-Received: by 2002:a62:545:: with SMTP id 66mr9100922pff.311.1594828101879; Wed, 15 Jul 2020 08:48:21 -0700 (PDT) Received: from geus3064linuxwsm ([152.115.61.173]) by smtp.gmail.com with ESMTPSA id h6sm2603504pfg.25.2020.07.15.08.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 08:48:21 -0700 (PDT) References: <877dvcsmgu.fsf@gmail.com> <874kqa66hb.fsf@kyleam.com> <87h7u93j8b.fsf@gmail.com> <87pn8x4grt.fsf@kyleam.com> User-agent: mu4e 1.4.3; emacs 26.3 From: Ken Mankoff To: Kyle Meyer Subject: Re: [PATCH] 3 improvements to ob-screen In-reply-to: <87pn8x4grt.fsf@kyleam.com> Date: Wed, 15 Jul 2020 08:48:15 -0700 Message-ID: <87365s3hkw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=mankoff@gmail.com; helo=mail-pg1-x534.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=UCtFNBmK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: Tb/lOYrXiPiR --=-=-= Content-Type: text/plain On 2020-07-14 at 20:08 -07, Kyle Meyer wrote... > Could you add a changelog entry to the body of this commit message and > the others? I made the changes you requested. Updated patches attached. -k. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ob-screen-Execute-last-line-in-block-send-newline.patch >From d7b7555969ce0e58653c5b5a78d9a4a0bebbacdf Mon Sep 17 00:00:00 2001 From: "Kenneth D. Mankoff" Date: Tue, 14 Jul 2020 13:29:36 -0700 Subject: [PATCH 1/3] ob-screen: Execute last line in block (send newline) * lisp/ob-screen.el (org-babel-screen-session-write-temp-file): insert newline after body. --- lisp/ob-screen.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el index 75a2dc691..3edc2c265 100644 --- a/lisp/ob-screen.el +++ b/lisp/ob-screen.el @@ -108,6 +108,7 @@ In case you want to use a different screen than one selected by your $PATH") (let ((tmpfile (org-babel-temp-file "screen-"))) (with-temp-file tmpfile (insert body) + (insert "\n") ;; org-babel has superfluous spaces (goto-char (point-min)) -- 2.25.1 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-ob-screen-Respect-session-name.-Don-t-prepend-org-ba.patch >From 05dcb2a9f9acb6d15c88ac67d9268243b620cf5e Mon Sep 17 00:00:00 2001 From: "Kenneth D. Mankoff" Date: Tue, 14 Jul 2020 13:41:35 -0700 Subject: [PATCH 2/3] ob-screen: Respect :session name. Don't prepend 'org-babel-session-' * lisp/ob-screen.el (org-babel-prep-session:screen): Remove concat of "org-babel-session-" string onto session name when creating session. * lisp/ob-screen.el (org-babel-screen-session-socketname): Remove concat of "org-babel-session-" string onto session name searching for existing screen session. --- etc/ORG-NEWS | 7 +++++++ lisp/ob-screen.el | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index c366f61e0..623fa9dc3 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -380,6 +380,13 @@ From ~org-enable-priority-commands~ to ~org-priority-enable-commands~. From ~org-show-priority~ to ~org-priority-show~. ** Miscellaneous +*** =ob-screen.el=: Respect screen =:session= name + +Screen babel session are now named based on the =:session= header +argument (defaults to ~default~). + +Previously all session names had ~org-babel-session-~ prepended. + *** Forward/backward paragraph functions in line with the rest of Emacs ~org-forward-paragraph~ and ~org-backward-paragraph~, bound to ~~ and ~~ functions mimic more closely behaviour of diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el index 3edc2c265..fe4698203 100644 --- a/lisp/ob-screen.el +++ b/lisp/ob-screen.el @@ -62,8 +62,7 @@ In case you want to use a different screen than one selected by your $PATH") (process-name (concat "org-babel: terminal (" session ")"))) (apply 'start-process process-name "*Messages*" terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location - "-c" "/dev/null" "-mS" ,(concat "org-babel-session-" session) - ,cmd)) + "-c" "/dev/null" "-mS" ,session ,cmd)) ;; XXX: Is there a better way than the following? (while (not (org-babel-screen-session-socketname session)) ;; wait until screen session is available before returning @@ -97,8 +96,7 @@ In case you want to use a different screen than one selected by your $PATH") nil (mapcar (lambda (x) - (when (string-match - (concat "org-babel-session-" session) x) + (when (string-match x) x)) sockets))))) (when match-socket (car (split-string match-socket))))) -- 2.25.1 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0003-ob-screen-accept-screenrc-header-argument.patch >From d99c637f1cade54ab2f66b72ec32026a15aa03de Mon Sep 17 00:00:00 2001 From: "Kenneth D. Mankoff" Date: Tue, 14 Jul 2020 13:48:52 -0700 Subject: [PATCH 3/3] ob-screen: accept :screenrc header argument * lisp/ob-screen.el (org-babel-default-header-args:screen): Add default header argument `:screenrc' and value "/dev/null". * lisp/ob-screen.el (org-babel-prep-session:screen): Use header argument in variable `screenrc' and not hard-coded value. --- etc/ORG-NEWS | 6 ++++++ lisp/ob-screen.el | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 623fa9dc3..5fb2af22e 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -229,6 +229,12 @@ directory configured for ClojureScript will /not/ work. Babel Java blocks recognize header argument =:cmdargs= and pass its value in call to =java=. +*** =ob-screen.el=: Screen now accepts =:screenrc= header argument + +Screen blocks now recognize the =:screenrc= header argument and pass +its value to the screen command via the "-c" option. The default +remains =/dev/null= (i.e. a clean screen session) + *** =RET= and =C-j= now obey ~electric-indent-mode~ Since Emacs 24.4, ~electric-indent-mode~ is enabled by default. In diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el index fe4698203..021fef60d 100644 --- a/lisp/ob-screen.el +++ b/lisp/ob-screen.el @@ -40,7 +40,8 @@ In case you want to use a different screen than one selected by your $PATH") (defvar org-babel-default-header-args:screen - '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . "xterm")) + '((:results . "silent") (:session . "default") (:cmd . "sh") + (:terminal . "xterm") (:screenrc . "/dev/null")) "Default arguments to use when running screen source blocks.") (defun org-babel-execute:screen (body params) @@ -59,10 +60,11 @@ In case you want to use a different screen than one selected by your $PATH") (let* ((session (cdr (assq :session params))) (cmd (cdr (assq :cmd params))) (terminal (cdr (assq :terminal params))) + (screenrc (cdr (assq :screenrc params))) (process-name (concat "org-babel: terminal (" session ")"))) (apply 'start-process process-name "*Messages*" terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location - "-c" "/dev/null" "-mS" ,session ,cmd)) + "-c" ,screenrc "-mS" ,session ,cmd)) ;; XXX: Is there a better way than the following? (while (not (org-babel-screen-session-socketname session)) ;; wait until screen session is available before returning -- 2.25.1 --=-=-=--