Browse Source

babel: tangled files which include shebang lines are now made executable

Eric Schulte 15 years ago
parent
commit
ceeb4681ef
1 changed files with 2 additions and 0 deletions
  1. 2 0
      contrib/babel/lisp/org-babel-tangle.el

+ 2 - 0
contrib/babel/lisp/org-babel-tangle.el

@@ -139,6 +139,8 @@ exported source code blocks by language."
 			  (goto-char (point-max))
 			  (insert content)
 			  (write-region nil nil file-name))))
+		    ;; if files contain she-bangs, then make the executable
+		    (when she-bang (set-file-modes file-name ?\755))
                     ;; update counter
                     (setq block-counter (+ 1 block-counter))
                     (add-to-list 'path-collector file-name)))))