소스 검색

gnuplot, close output terminal when opened

* lisp/ob-gnuplot.el (org-babel-expand-body:gnuplot): Gnuplot, close
  output terminal when opened.
Eric Schulte 12 년 전
부모
커밋
e1f0232f33
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      lisp/ob-gnuplot.el

+ 5 - 2
lisp/ob-gnuplot.el

@@ -147,8 +147,11 @@ code."
 	(funcall add-to-body (concat "set timefmt \""
 	(funcall add-to-body (concat "set timefmt \""
 				     (or timefmt
 				     (or timefmt
 					 "%Y-%m-%d-%H:%M:%S") "\"")))
 					 "%Y-%m-%d-%H:%M:%S") "\"")))
-      (when out-file (funcall add-to-body (format "set output \"%s\""
-						  out-file)))
+      (when out-file
+	;; set the terminal at the top of the block
+	(funcall add-to-body (format "set output \"%s\"" out-file))
+	;; and close the terminal at the bottom of the block
+	(setq body (concat body "\nset output\n")))
       (when term (funcall add-to-body (format "set term %s" term)))
       (when term (funcall add-to-body (format "set term %s" term)))
       ;; insert variables into code body: this should happen last
       ;; insert variables into code body: this should happen last
       ;; placing the variables at the *top* of the code in case their
       ;; placing the variables at the *top* of the code in case their