Browse Source

fix compiler warnings in ob-picolisp

* lisp/ob-picolisp.el (ob-comint): Required.
  (comint): Required.
  (cl): Required.
  (run-picolisp): Declared.
  (org-babel-execute:picolisp): Capture free variable, and replace
  function from cl-extra with core function.
Eric Schulte 13 years ago
parent
commit
33d764f24e
1 changed files with 11 additions and 5 deletions
  1. 11 5
      lisp/ob-picolisp.el

+ 11 - 5
lisp/ob-picolisp.el

@@ -54,6 +54,11 @@
 ;;; Code:
 (require 'ob)
 (require 'ob-eval)
+(require 'ob-comint)
+(require 'comint)
+(eval-when-compile (require 'cl))
+
+(declare-function run-picolisp "ext:inferior-picolisp" (cmd))
 
 ;; optionally define a file extension for this language
 (add-to-list 'org-babel-tangle-lang-exts '("picolisp" . "l"))
@@ -99,6 +104,7 @@
 	 (session (org-babel-picolisp-initiate-session session-name))
 	 ;; either OUTPUT or VALUE which should behave as described above
 	 (result-type (cdr (assoc :result-type params)))
+	 (result-params (cdr (assoc :result-params params)))
 	 ;; expand the body with `org-babel-expand-body:picolisp'
 	 (full-body (org-babel-expand-body:picolisp body params))
          ;; wrap body appropriately for the type of evaluation and results
@@ -135,18 +141,18 @@
 		       (cond
 			;; remove leading "-> " from return values
 			((and (>= (length line) 3)
-			      (string= "-> " (subseq line 0 3)))
-			 (subseq line 3))
+			      (string= "-> " (substring line 0 3)))
+			 (substring line 3))
 			;; remove trailing "-> <<return-value>>" on the
 			;; last line of output
 			((and (member "output" result-params)
 			      (string-match-p "->" line))
-			 (subseq line 0 (string-match "->" line)))
+			 (substring line 0 (string-match "->" line)))
 			(t line)
 			)
                        ;; (if (and (>= (length line) 3) ;; remove leading "<- "
-                       ;;          (string= "-> " (subseq line 0 3)))
-                       ;;     (subseq line 3)
+                       ;;          (string= "-> " (substring line 0 3)))
+                       ;;     (substring line 3)
                        ;;   line)
 		       )))
                   ;; returns a list of the output of each evaluated expression