Quellcode durchsuchen

babel: org-babel-c now responds to :cmdline header argument

Eric Schulte vor 15 Jahren
Ursprung
Commit
2675848d37
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      contrib/babel/lisp/langs/org-babel-C.el

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

@@ -74,6 +74,7 @@ called by `org-babel-execute-src-block'."
                                          ('cpp ".cpp"))))
          (tmp-bin-file (make-temp-file "org-babel-C-bin"))
          (tmp-out-file (make-temp-file "org-babel-C-out"))
+         (cmdline (cdr (assoc :cmdline params)))
          (flags (cdr (assoc :flags params)))
          (vars (second processed-params))
          (includes (org-babel-read
@@ -117,7 +118,9 @@ called by `org-babel-execute-src-block'."
          (org-babel-trim
           (with-temp-buffer
             (org-babel-shell-command-on-region
-             (point-min) (point-max) tmp-bin-file (current-buffer) 'replace)
+             (point-min) (point-max)
+             (concat tmp-bin-file (if cmdline (concat " " cmdline) ""))
+             (current-buffer) 'replace)
             (buffer-string))))
       (progn
         (with-current-buffer error-buf