From 0fce2ce5dddc92cc3391f850731f0c78c4cca4a6 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 14 Apr 2018 11:04:17 +0200 Subject: Better detection of absolute-paths --- ob-spice.org | 10 +++++----- 1 file 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)) -- cgit v1.2.3