Skip to content

Commit

Permalink
Remove use of org-babel--get-vars to support older org-mode
Browse files Browse the repository at this point in the history
Closes #13, #14
  • Loading branch information
ljos committed Mar 26, 2018
1 parent e70a9f9 commit efa86bb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ob-prolog.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Bjarte Johansen
;; Keywords: literate programming, reproducible research
;; URL: https://github.com/ljos/ob-prolog
;; Version: 1.0.1
;; Version: 1.0.2

;; This file is NOT part of GNU Emacs.

Expand Down Expand Up @@ -82,10 +82,13 @@
(org-babel-prolog--elisp-to-pl (cdr pair))))

(defun org-babel-variable-assignments:prolog (params)
(let ((strs (mapcar #'org-babel-prolog--variable-assignment
(org-babel--get-vars params))))
(when strs
(list (concat ":- " (mapconcat #'identity strs ", ") ".\n")))))
(let (vars)
(dolist (param params vars)
(when (eq (car param) :var)
(setq vars (cons (org-babel-prolog--variable-assignment (cdr param))
vars))))
(when vars
(list (concat ":- " (mapconcat #'identity vars ", ") ".\n")))))

(defun org-babel-prolog--parse-goal (goal)
"Evaluate inline emacs-lisp in prolog goal parameter.
Expand Down

0 comments on commit efa86bb

Please sign in to comment.