Add option to set a default window name

If net set by the user, the first window will not be named "1" by
default anymore.
hello-test
Allard Hendriksen 2018-07-16 12:03:23 +02:00
parent 0b09770835
commit ba76074ffa
1 changed files with 5 additions and 1 deletions

View File

@ -45,6 +45,10 @@ In case you want to use a different tmux than one selected by your $PATH")
(defvar org-babel-tmux-session-prefix "org-babel-session-"
"The string that will be prefixed to tmux sessions started by ob-tmux")
(defvar org-babel-tmux-default-window-name "ob1"
"The default tmux window name used for windows that are not
explicitly named in an org session.")
(defvar org-babel-default-header-args:tmux
'((:results . "silent")
(:session . "default")
@ -189,7 +193,7 @@ Can return nil if no window specified."
"Extracts the tmux window from the org session string.
Returns '1' if no window specified."
(let* ((tmux-window (cadr (split-string org-session ":"))))
(if tmux-window tmux-window "1")))
(if tmux-window tmux-window org-babel-tmux-default-window-name)))
(defun org-babel-tmux-target-session (org-session)
"Constructs a tmux target from the org session string.