From ba76074ffa830a3d101357bccc022a3223724c9b Mon Sep 17 00:00:00 2001 From: Allard Hendriksen Date: Mon, 16 Jul 2018 12:03:23 +0200 Subject: [PATCH] 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. --- ob-tmux.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ob-tmux.el b/ob-tmux.el index 0a62eac..5a3da51 100644 --- a/ob-tmux.el +++ b/ob-tmux.el @@ -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.