浏览代码

babel: set default-directory in org-babel-pop-to-session

Dan Davison 15 年之前
父节点
当前提交
485781ed40
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      contrib/babel/lisp/org-babel.el

+ 4 - 1
contrib/babel/lisp/org-babel.el

@@ -271,7 +271,10 @@ of the source block to the kill ring."
          (lang (first info))
          (body (second info))
          (params (third info))
-         (session (cdr (assoc :session params))))
+         (session (cdr (assoc :session params)))
+	 (dir (cdr (assoc :dir params)))
+	 (default-directory
+	   (or (and dir (file-name-as-directory dir)) default-directory)))
     (unless (member lang org-babel-interpreters)
       (error "Language is not in `org-babel-interpreters': %s" lang))
     ;; copy body to the kill ring