summaryrefslogtreecommitdiff
path: root/lisp/ob-lilypond.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-lilypond.el
parent84539dca3aa301ecfe48858eceef1ced0505388b (diff)
Imported Upstream version 9.0
Diffstat (limited to 'lisp/ob-lilypond.el')
-rw-r--r--lisp/ob-lilypond.el37
1 files changed, 15 insertions, 22 deletions
diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el
index bfbace5..3d2e50f 100644
--- a/lisp/ob-lilypond.el
+++ b/lisp/ob-lilypond.el
@@ -1,4 +1,4 @@
-;;; ob-lilypond.el --- org-babel functions for lilypond evaluation
+;;; ob-lilypond.el --- Babel Functions for Lilypond -*- lexical-binding: t; -*-
;; Copyright (C) 2010-2016 Free Software Foundation, Inc.
@@ -92,7 +92,7 @@ you can leave the string empty on this case."
:version "24.3"
:package-version '(Org . "8.2.7")
:set
- (lambda (symbol value)
+ (lambda (_symbol value)
(setq
org-babel-lilypond-ly-command (nth 0 value)
org-babel-lilypond-pdf-command (nth 1 value)
@@ -123,7 +123,7 @@ blocks.")
(defun org-babel-expand-body:lilypond (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)))
@@ -157,9 +157,8 @@ specific arguments to =org-babel-tangle="
(defun org-babel-lilypond-process-basic (body params)
"Execute a lilypond block in basic mode."
- (let* ((result-params (cdr (assoc :result-params params)))
- (out-file (cdr (assoc :file params)))
- (cmdline (or (cdr (assoc :cmdline params))
+ (let* ((out-file (cdr (assq :file params)))
+ (cmdline (or (cdr (assq :cmdline params))
""))
(in-file (org-babel-temp-file "lilypond-")))
@@ -182,7 +181,7 @@ specific arguments to =org-babel-tangle="
cmdline
in-file) "")) nil)
-(defun org-babel-prep-session:lilypond (session params)
+(defun org-babel-prep-session:lilypond (_session _params)
"Return an error because LilyPond exporter does not support sessions."
(error "Sorry, LilyPond does not currently support sessions!"))
@@ -272,25 +271,19 @@ LINE is the erroneous line"
(defun org-babel-lilypond-parse-line-num (&optional buffer)
"Extract error line number."
- (when buffer
- (set-buffer buffer))
+ (when buffer (set-buffer buffer))
(let ((start
(and (search-backward ":" nil t)
(search-backward ":" nil t)
(search-backward ":" nil t)
- (search-backward ":" nil t)))
- (num nil))
- (if start
- (progn
- (forward-char)
- (let ((num (buffer-substring
- (+ 1 start)
- (- (search-forward ":" nil t) 1))))
- (setq num (string-to-number num))
- (if (numberp num)
- num
- nil)))
- nil)))
+ (search-backward ":" nil t))))
+ (when start
+ (forward-char)
+ (let ((num (string-to-number
+ (buffer-substring
+ (+ 1 start)
+ (- (search-forward ":" nil t) 1)))))
+ (and (numberp num) num)))))
(defun org-babel-lilypond-parse-error-line (file-name lineNo)
"Extract the erroneous line from the tangled .ly file