summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfpi2018-04-14 11:04:17 +0200
committerfpi2018-04-14 11:04:17 +0200
commit0fce2ce5dddc92cc3391f850731f0c78c4cca4a6 (patch)
treea14103c0cd5fb9182207d96a967de028f5989d60
parentAdded readme.org (diff)
Better detection of absolute-paths
-rw-r--r--ob-spice.org10
1 files changed, 5 insertions, 5 deletions
diff --git a/ob-spice.org b/ob-spice.org
index 02cbd40..32e84a5 100644
--- a/ob-spice.org
+++ b/ob-spice.org
@@ -314,13 +314,13 @@ default-directory or DIR if specified."
(let* ((sessionname (if (or (not session) (string= session "none"))
"spice" session))
(session (make-comint sessionname org-babel-spice-command)))
- (if (and dir (string-match "^/" dir))
- ;; absolute dir
- (comint-simple-send session (format "cd %s" dir))
+ (if (and dir (file-name-absolute-p dir))
+ ;; absolute dir
+ (comint-simple-send session (format "cd %s" dir))
;; relative dir
- (comint-simple-send session (format "cd %s%s" default-directory (or dir ""))))
+ (comint-simple-send session (format "cd %s" default-directory))
session
- ))
+ )))
(defun org-babel-prep-session:spice (session params)
"Prepare SESSION according to header arguments in PARAMS."
(let ((session (org-babel-spice-initiate-session session))