[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch: ob-screen support for user-specified screenrc [9.3.7 (9.3.7-12-g5
From: |
Ken Mankoff |
Subject: |
patch: ob-screen support for user-specified screenrc [9.3.7 (9.3.7-12-g5d6868-elpaplus @ /home/kdm/.emacs.d/elpa/org-plus-contrib-20200706/)] |
Date: |
Thu, 09 Jul 2020 09:38:15 -0700 |
User-agent: |
mu4e 1.4.3; emacs 26.3 |
Last ob-screen patch. I apologize if these should have been one email but they
are there independent issues.
This patch maintains the default behavior of no screenrc "-c /dev/null", but
adds a :screenrc header arg that allows the user to specify their default or
any file to be used as a screenrc file.
-k.
diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index 75a2dc691..3769a767d 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -29,6 +29,8 @@
;; Adding :cmd and :terminal as header arguments
;; :terminal must support the -T (title) and -e (command) parameter
;;
+;; Adding :screenrc as header arguments. Defaults to /dev/null.
+;;
;; You can test the default setup. (xterm + sh) with
;; M-x org-babel-screen-test RET
@@ -40,7 +42,7 @@
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 +61,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" ,(concat "org-babel-session-"
session)
+ "-c" ,screenrc "-mS" ,(concat "org-babel-session-"
session)
,cmd))
;; XXX: Is there a better way than the following?
(while (not (org-babel-screen-session-socketname session))
- patch: ob-screen support for user-specified screenrc [9.3.7 (9.3.7-12-g5d6868-elpaplus @ /home/kdm/.emacs.d/elpa/org-plus-contrib-20200706/)],
Ken Mankoff <=