summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-11-12 17:02:24 -0700
committerEric Schulte <schulte.eric@gmail.com>2010-11-12 17:02:24 -0700
commit5da47e2c2ec83a4856a1360d2add3337b89eedfb (patch)
tree282b80e40889d0d145481cebbb245291af800c8d
parentc303127cee79496233c427019b760fe3cf1bd961 (diff)
downloadorg-mode-5da47e2c2ec83a4856a1360d2add3337b89eedfb.tar.gz
babel: fix a number of compiler warnings
* Makefile (LISPF): Add ob-calc.el to compiled files. * lisp/ob-calc.el (org-babel-execute:calc): Fix compiler warnings. * lisp/ob-lisp.el (slime-process): Declare an external function. (slime-eval): Declare an external function. (slime-connected-p): Declared an external function. (org-babel-lisp-cmd): Add a group to the defcustom specification. (org-babel-execute:lisp): Require slime inside function. (org-babel-lisp-initiate-session): Require slime inside function.
-rw-r--r--Makefile1
-rw-r--r--lisp/ob-calc.el8
-rw-r--r--lisp/ob-lisp.el11
3 files changed, 14 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 0b15abe..e6bdfbe 100644
--- a/Makefile
+++ b/Makefile
@@ -125,6 +125,7 @@ LISPF = org.el \
ob-eval.el \
ob-keys.el \
ob-C.el \
+ ob-calc.el \
ob-ditaa.el \
ob-haskell.el \
ob-perl.el \
diff --git a/lisp/ob-calc.el b/lisp/ob-calc.el
index eb6d970..64feb53 100644
--- a/lisp/ob-calc.el
+++ b/lisp/ob-calc.el
@@ -48,7 +48,7 @@
(calc-push-list (list (cdr pair)))
(calc-store-into (car pair)))
vars)
- (mapcar
+ (mapc
(lambda (line)
(when (> (length line) 0)
(cond
@@ -80,13 +80,13 @@
(calc-pop 1)))
el))
;; parse line into calc objects
- (first (math-read-exprs line))))))))
+ (car (math-read-exprs line))))))))
(calc-eval line))))))))
(mapcar #'org-babel-trim
(split-string (org-babel-expand-body:calc body params) "[\n\r]"))))
(save-excursion
- (set-buffer (get-buffer "*Calculator*"))
- (calc-eval (calc-top 1))))
+ (with-current-buffer (get-buffer "*Calculator*")
+ (calc-eval (calc-top 1)))))
(provide 'ob-calc)
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index f550a54..1089e4c 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -41,13 +41,18 @@
(require 'ob-ref)
(require 'ob-comint)
(require 'ob-eval)
-(require 'slime)
+
+(declare-function slime-eval "ext:slime" (sexp &optional package))
+(declare-function slime-process "ext:slime" (&optional connection))
+(declare-function slime-connected-p "ext:slime" ())
(defvar org-babel-default-header-args:lisp '()
"Default header arguments for lisp code blocks.")
(defcustom org-babel-lisp-cmd "sbcl --script"
- "Name of command used to evaluate lisp blocks.")
+ "Name of command used to evaluate lisp blocks."
+ :group 'org-babel
+ :type 'string)
(defun org-babel-expand-body:lisp (body params)
"Expand BODY according to PARAMS, return the expanded body."
@@ -63,6 +68,7 @@
(defun org-babel-execute:lisp (body params)
"Execute a block of Lisp code with org-babel.
This function is called by `org-babel-execute-src-block'"
+ (require 'slime)
(message "executing Lisp source code block")
(let* ((session (org-babel-lisp-initiate-session
(cdr (assoc :session params))))
@@ -94,6 +100,7 @@ This function is called by `org-babel-execute-src-block'"
(defun org-babel-lisp-initiate-session (&optional session)
"If there is not a current inferior-process-buffer in SESSION
then create. Return the initialized session."
+ (require 'slime)
(unless (string= session "none")
(save-window-excursion
(or (slime-connected-p)