summaryrefslogtreecommitdiff
path: root/lisp/ob-abc.el
diff options
context:
space:
mode:
authorS├ębastien Delafond <sdelafond@gmail.com>2016-11-07 10:41:54 +0100
committerS├ębastien Delafond <sdelafond@gmail.com>2016-11-07 10:41:54 +0100
commitec84430cf4e09ba25ec675debdf802bc28111e06 (patch)
tree9c64bc8a0cd5e8cac82aa5fdf369d40529f140f8 /lisp/ob-abc.el
parent84539dca3aa301ecfe48858eceef1ced0505388b (diff)
Imported Upstream version 9.0
Diffstat (limited to 'lisp/ob-abc.el')
-rw-r--r--lisp/ob-abc.el20
1 files changed, 9 insertions, 11 deletions
diff --git a/lisp/ob-abc.el b/lisp/ob-abc.el
index 36ad55d..6872b1c 100644
--- a/lisp/ob-abc.el
+++ b/lisp/ob-abc.el
@@ -1,4 +1,4 @@
-;;; ob-abc.el --- org-babel functions for template evaluation
+;;; ob-abc.el --- Org Babel Functions for ABC -*- lexical-binding: t; -*-
;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
@@ -42,7 +42,7 @@
(defun org-babel-expand-body:abc (body params)
"Expand BODY according to PARAMS, return the expanded body."
- (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
+ (let ((vars (org-babel--get-vars params)))
(mapc
(lambda (pair)
(let ((name (symbol-name (car pair)))
@@ -59,12 +59,10 @@
"Execute a block of ABC code with org-babel. This function is
called by `org-babel-execute-src-block'"
(message "executing Abc source code block")
- (let* ((result-params (split-string (or (cdr (assoc :results params)))))
- (cmdline (cdr (assoc :cmdline params)))
- (out-file ((lambda (el)
- (or el
- (error "abc code block requires :file header argument")))
- (replace-regexp-in-string "\.pdf$" ".ps" (cdr (assoc :file params)))))
+ (let* ((cmdline (cdr (assq :cmdline params)))
+ (out-file (let ((file (cdr (assq :file params))))
+ (if file (replace-regexp-in-string "\.pdf$" ".ps" file)
+ (error "abc code block requires :file header argument"))))
(in-file (org-babel-temp-file "abc-"))
(render (concat "abcm2ps" " " cmdline
" -O " (org-babel-process-file-name out-file)
@@ -79,14 +77,14 @@
(file-name-extension out-file))
out-file t))
;;; if we were asked for a pdf...
- (when (string= (file-name-extension (cdr (assoc :file params))) "pdf")
- (org-babel-eval (concat "ps2pdf" " " out-file " " (cdr (assoc :file params))) ""))
+ (when (string= (file-name-extension (cdr (assq :file params))) "pdf")
+ (org-babel-eval (concat "ps2pdf" " " out-file " " (cdr (assq :file params))) ""))
;;; indicate that the file has been written
nil))
;; This function should be used to assign any variables in params in
;; the context of the session environment.
-(defun org-babel-prep-session:abc (session params)
+(defun org-babel-prep-session:abc (_session _params)
"Return an error because abc does not support sessions."
(error "ABC does not support sessions"))