diff options
author | fpi | 2018-04-14 11:04:17 +0200 |
---|---|---|
committer | fpi | 2018-04-14 11:04:17 +0200 |
commit | 0fce2ce5dddc92cc3391f850731f0c78c4cca4a6 (patch) | |
tree | a14103c0cd5fb9182207d96a967de028f5989d60 | |
parent | Added readme.org (diff) |
Better detection of absolute-paths
-rw-r--r-- | ob-spice.org | 10 |
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)) |