emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ken Mankoff <mankoff@gmail.com>
To: emacs-orgmode@gnu.org
Subject: patch: ob-screen: don't change user-specified session name [9.3.7 (9.3.7-12-g5d6868-elpaplus @ /home/kdm/.emacs.d/elpa/org-plus-contrib-20200706/)]
Date: Thu, 09 Jul 2020 09:14:27 -0700	[thread overview]
Message-ID: <874kqgsm1o.fsf@gmail.com> (raw)


ob-screen prepends "org-babel-session-" to the user-specific screen name for some reason. I suggest this is not necessary nor optimal. One of the key points of 'screen' is that you can detach and attach from elsewhere. The name of the session is an important part of this process, and changing the user-chosen name complicates this. I note that in the other babel :session names I use (shell, Python, jupyter-python, etc.) the :session name is not modified.

  -k.



diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index 75a2dc691..685961a7e 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 session x)
                              x))
                          sockets)))))
     (when match-socket (car (split-string match-socket)))))


             reply	other threads:[~2020-07-09 16:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 16:14 Ken Mankoff [this message]
2020-07-14  5:01 ` Kyle Meyer
2020-07-14  5:02   ` Kyle Meyer
2020-07-15  3:09     ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kqgsm1o.fsf@gmail.com \
    --to=mankoff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: patch: ob-screen: don'\''t change user-specified session name [9.3.7 (9.3.7-12-g5d6868-elpaplus @ /home/kdm/.emacs.d/elpa/org-plus-contrib-20200706/)]' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).