瀏覽代碼

babel: can now tangle files without extensions

Dan Davison 15 年之前
父節點
當前提交
21849af58b
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      contrib/babel/lisp/org-babel-tangle.el

+ 4 - 3
contrib/babel/lisp/org-babel-tangle.el

@@ -102,9 +102,10 @@ exported source code blocks by language."
                                      ((> (length tangle) 0) tangle))
                                     target-file))
                      (file-name (when base-name
-                                  (if (string= base-name
-                                               (file-name-sans-extension base-name))
-                                      (concat base-name "." ext) base-name))))
+                                  (if (and ext
+                                          (string= base-name
+                                                   (file-name-sans-extension base-name)))
+                                     (concat base-name "." ext) base-name))))
                 ;; ;; debugging
                 ;; (message "tangle=%S base-name=%S file-name=%S"
                 ;;          tangle base-name file-name)