2015-10-25 20:56:00 -04:00
|
|
|
;;; ob-lilypond.el --- Babel Functions for Lilypond -*- lexical-binding: t; -*-
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2024-01-01 20:47:10 -05:00
|
|
|
;; Copyright (C) 2010-2024 Free Software Foundation, Inc.
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2011-06-30 14:06:22 -04:00
|
|
|
;; Author: Martyn Jago
|
2012-03-17 11:28:46 -04:00
|
|
|
;; Keywords: babel language, literate programming
|
2021-09-26 03:44:29 -04:00
|
|
|
;; URL: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2011-06-30 14:06:22 -04:00
|
|
|
;; This file is part of GNU Emacs.
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2011-06-30 14:06:22 -04:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2011-06-28 20:40:17 -04:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2011-06-30 14:06:22 -04:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2011-06-28 20:40:17 -04:00
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-06-30 14:06:22 -04:00
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-06-28 20:40:17 -04:00
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
2011-06-30 14:06:22 -04:00
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 18:52:52 -04:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2011-06-30 14:06:22 -04:00
|
|
|
;;; Commentary:
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
;; Installation, ob-lilypond documentation, and examples are available at
|
2018-01-16 11:22:00 -05:00
|
|
|
;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
|
2012-03-19 16:38:12 -04:00
|
|
|
;;
|
|
|
|
;; Lilypond documentation can be found at
|
2021-03-21 14:55:14 -04:00
|
|
|
;; https://lilypond.org/manuals.html
|
2014-05-09 08:54:33 -04:00
|
|
|
;;
|
2021-03-21 14:55:14 -04:00
|
|
|
;; This depends on epstopdf --- See https://www.ctan.org/pkg/epstopdf.
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2011-06-30 14:06:22 -04:00
|
|
|
;;; Code:
|
2022-08-04 09:53:05 -04:00
|
|
|
|
|
|
|
(require 'org-macs)
|
|
|
|
(org-assert-version)
|
|
|
|
|
2011-06-28 20:40:17 -04:00
|
|
|
(require 'ob)
|
2017-12-06 10:03:23 -05:00
|
|
|
|
2022-01-16 02:07:25 -05:00
|
|
|
(declare-function org-fold-show-all "org-fold" (&optional types))
|
2017-12-06 10:03:23 -05:00
|
|
|
|
2011-06-28 20:40:17 -04:00
|
|
|
(add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly"))
|
2023-07-20 02:51:24 -04:00
|
|
|
(add-to-list 'org-src-lang-modes '("lilypond" . "LilyPond"))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2011-07-07 21:33:56 -04:00
|
|
|
(defvar org-babel-default-header-args:lilypond '()
|
2012-03-19 16:38:12 -04:00
|
|
|
"Default header arguments for lilypond code blocks.
|
|
|
|
NOTE: The arguments are determined at lilypond compile time.
|
2021-01-01 21:18:37 -05:00
|
|
|
See `org-babel-lilypond-set-header-args'
|
|
|
|
To configure, see `ob-lilypond-header-args'
|
|
|
|
.")
|
|
|
|
|
|
|
|
(defvar ob-lilypond-header-args
|
|
|
|
'((:results . "file") (:exports . "results"))
|
|
|
|
"User-configurable header arguments for lilypond code blocks.
|
|
|
|
NOTE: The final value used by org-babel is computed at compile-time
|
|
|
|
and stored in `org-babel-default-header-args:lilypond'
|
2019-09-20 18:27:53 -04:00
|
|
|
See `org-babel-lilypond-set-header-args'.")
|
2011-07-07 21:33:56 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-compile-post-tangle t
|
2023-08-24 08:20:22 -04:00
|
|
|
"When non-nil, compile tangled file after `org-babel-tangle'.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-display-pdf-post-tangle t
|
2023-08-24 08:20:22 -04:00
|
|
|
"When non-nil, display pdf after successful LilyPond compilation.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-play-midi-post-tangle t
|
2023-08-24 08:20:22 -04:00
|
|
|
"When non-nil, play midi file after successful LilyPond compilation.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2015-05-26 15:37:04 -04:00
|
|
|
(defvar org-babel-lilypond-ly-command ""
|
|
|
|
"Command to execute lilypond on your system.
|
|
|
|
Do not set it directly. Customize `org-babel-lilypond-commands' instead.")
|
2020-02-11 02:51:30 -05:00
|
|
|
|
2015-05-26 15:37:04 -04:00
|
|
|
(defvar org-babel-lilypond-pdf-command ""
|
|
|
|
"Command to show a PDF file on your system.
|
|
|
|
Do not set it directly. Customize `org-babel-lilypond-commands' instead.")
|
2020-02-11 02:51:30 -05:00
|
|
|
|
2015-05-26 15:37:04 -04:00
|
|
|
(defvar org-babel-lilypond-midi-command ""
|
|
|
|
"Command to play a MIDI file on your system.
|
|
|
|
Do not set it directly. Customize `org-babel-lilypond-commands' instead.")
|
2020-02-11 02:51:30 -05:00
|
|
|
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(defcustom org-babel-lilypond-commands
|
|
|
|
(cond
|
|
|
|
((eq system-type 'darwin)
|
|
|
|
'("/Applications/lilypond.app/Contents/Resources/bin/lilypond" "open" "open"))
|
|
|
|
((eq system-type 'windows-nt)
|
|
|
|
'("lilypond" "" ""))
|
|
|
|
(t
|
|
|
|
'("lilypond" "xdg-open" "xdg-open")))
|
|
|
|
"Commands to run lilypond and view or play the results.
|
|
|
|
These should be executables that take a filename as an argument.
|
|
|
|
On some system it is possible to specify the filename directly
|
|
|
|
and the viewer or player will be determined from the file type;
|
|
|
|
you can leave the string empty on this case."
|
|
|
|
:group 'org-babel
|
|
|
|
:type '(list
|
|
|
|
(string :tag "Lilypond ")
|
|
|
|
(string :tag "PDF Viewer ")
|
|
|
|
(string :tag "MIDI Player"))
|
2017-09-07 16:56:11 -04:00
|
|
|
:version "24.4"
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
:package-version '(Org . "8.2.7")
|
|
|
|
:set
|
2020-02-11 02:51:30 -05:00
|
|
|
(lambda (symbol value)
|
2022-06-11 12:59:15 -04:00
|
|
|
(set-default-toplevel-value symbol value)
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(setq
|
|
|
|
org-babel-lilypond-ly-command (nth 0 value)
|
|
|
|
org-babel-lilypond-pdf-command (nth 1 value)
|
|
|
|
org-babel-lilypond-midi-command (nth 2 value))))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-gen-png nil
|
2015-05-26 15:37:04 -04:00
|
|
|
"Non-nil means image generation (PNG) is turned on by default.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-gen-svg nil
|
2015-05-26 15:37:04 -04:00
|
|
|
"Non-nil means image generation (SVG) is be turned on by default.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-gen-html nil
|
2015-05-26 15:37:04 -04:00
|
|
|
"Non-nil means HTML generation is turned on by default.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-gen-pdf nil
|
2015-05-26 15:37:04 -04:00
|
|
|
"Non-nil means PDF generation is be turned on by default.")
|
2012-03-19 16:38:12 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-use-eps nil
|
2015-05-26 15:37:04 -04:00
|
|
|
"Non-nil forces the compiler to use the EPS backend.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defvar org-babel-lilypond-arrange-mode nil
|
2015-05-26 15:37:04 -04:00
|
|
|
"Non-nil turns Arrange mode on.
|
|
|
|
In Arrange mode the following settings are altered from default:
|
2011-07-06 09:17:29 -04:00
|
|
|
:tangle yes, :noweb yes
|
|
|
|
:results silent :comments yes.
|
|
|
|
In addition lilypond block execution causes tangling of all lilypond
|
2015-05-26 15:37:04 -04:00
|
|
|
blocks.")
|
2011-06-28 20:40:17 -04:00
|
|
|
|
|
|
|
(defun org-babel-expand-body:lilypond (body params)
|
|
|
|
"Expand BODY according to PARAMS, return the expanded body."
|
2023-10-19 04:59:27 -04:00
|
|
|
(let ((vars (org-babel--get-vars params))
|
|
|
|
(prologue (cdr (assq :prologue params)))
|
|
|
|
(epilogue (cdr (assq :epilogue params))))
|
2011-06-28 20:40:17 -04:00
|
|
|
(mapc
|
|
|
|
(lambda (pair)
|
|
|
|
(let ((name (symbol-name (car pair)))
|
|
|
|
(value (cdr pair)))
|
|
|
|
(setq body
|
|
|
|
(replace-regexp-in-string
|
2015-09-17 19:08:20 -04:00
|
|
|
(concat "$" (regexp-quote name))
|
2011-06-28 20:40:17 -04:00
|
|
|
(if (stringp value) value (format "%S" value))
|
|
|
|
body))))
|
|
|
|
vars)
|
2023-10-19 04:59:27 -04:00
|
|
|
(concat
|
|
|
|
(and prologue (concat prologue "\n"))
|
|
|
|
body
|
|
|
|
(and epilogue (concat "\n" epilogue "\n")))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
2011-06-28 20:40:17 -04:00
|
|
|
(defun org-babel-execute:lilypond (body params)
|
2023-09-03 15:41:51 -04:00
|
|
|
"Execute LilyPond src block according to arrange mode.
|
2023-08-24 08:20:22 -04:00
|
|
|
See `org-babel-execute-src-block' for BODY and PARAMS.
|
|
|
|
When in arrange mode, tangle all blocks and process the result.
|
|
|
|
Otherwise, execute block according to header settings."
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-set-header-args org-babel-lilypond-arrange-mode)
|
|
|
|
(if org-babel-lilypond-arrange-mode
|
|
|
|
(org-babel-lilypond-tangle)
|
|
|
|
(org-babel-lilypond-process-basic body params)))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-tangle ()
|
2023-08-24 08:20:22 -04:00
|
|
|
"Tangle lilypond blocks, then `org-babel-liypond-execute-tangled-ly'."
|
2011-06-28 20:40:17 -04:00
|
|
|
(interactive)
|
|
|
|
(if (org-babel-tangle nil "yes" "lilypond")
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-execute-tangled-ly) nil))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2023-08-17 06:20:08 -04:00
|
|
|
;; https://lilypond.org/doc/v2.24/Documentation/usage/other-programs
|
|
|
|
(defvar org-babel-lilypond-paper-settings
|
|
|
|
"#(if (ly:get-option 'use-paper-size-for-page)
|
|
|
|
(begin (ly:set-option 'use-paper-size-for-page #f)
|
|
|
|
(ly:set-option 'tall-page-formats '%s)))
|
|
|
|
\\paper {
|
|
|
|
indent=0\\mm
|
|
|
|
tagline=\"\"
|
|
|
|
oddFooterMarkup=##f
|
|
|
|
oddHeaderMarkup=##f
|
|
|
|
bookTitleMarkup=##f
|
|
|
|
scoreTitleMarkup=##f
|
|
|
|
}\n"
|
|
|
|
"The paper settings required to generate music fragments.
|
|
|
|
They are needed for mixing music and text in basic-mode.")
|
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-process-basic (body params)
|
2023-08-24 08:20:22 -04:00
|
|
|
"Execute a lilypond block in basic mode.
|
|
|
|
See `org-babel-execute-src-block' for BODY and PARAMS."
|
2016-09-22 13:45:15 -04:00
|
|
|
(let* ((out-file (cdr (assq :file params)))
|
2023-08-17 06:20:08 -04:00
|
|
|
(file-type (file-name-extension out-file))
|
2016-09-22 13:45:15 -04:00
|
|
|
(cmdline (or (cdr (assq :cmdline params))
|
2011-07-06 09:17:29 -04:00
|
|
|
""))
|
2011-07-07 21:33:56 -04:00
|
|
|
(in-file (org-babel-temp-file "lilypond-")))
|
2011-07-06 09:17:29 -04:00
|
|
|
|
|
|
|
(with-temp-file in-file
|
2023-08-17 06:20:08 -04:00
|
|
|
(insert
|
|
|
|
(format org-babel-lilypond-paper-settings file-type)
|
|
|
|
(org-babel-expand-body:generic body params)))
|
2011-07-06 09:17:29 -04:00
|
|
|
(org-babel-eval
|
|
|
|
(concat
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
org-babel-lilypond-ly-command
|
2011-07-06 09:17:29 -04:00
|
|
|
" -dbackend=eps "
|
|
|
|
"-dno-gs-load-fonts "
|
|
|
|
"-dinclude-eps-fonts "
|
2023-08-17 06:20:08 -04:00
|
|
|
(or (assoc-default file-type
|
|
|
|
'(("pdf" . "--pdf ")
|
|
|
|
("eps" . "--eps ")))
|
2013-01-31 05:17:18 -05:00
|
|
|
"--png ")
|
2011-07-06 09:17:29 -04:00
|
|
|
"--output="
|
|
|
|
(file-name-sans-extension out-file)
|
|
|
|
" "
|
|
|
|
cmdline
|
2023-08-17 06:20:08 -04:00
|
|
|
in-file)
|
|
|
|
""))
|
|
|
|
nil)
|
2011-07-06 09:17:29 -04:00
|
|
|
|
2015-10-25 20:56:00 -04:00
|
|
|
(defun org-babel-prep-session:lilypond (_session _params)
|
2011-06-28 20:40:17 -04:00
|
|
|
"Return an error because LilyPond exporter does not support sessions."
|
|
|
|
(error "Sorry, LilyPond does not currently support sessions!"))
|
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-execute-tangled-ly ()
|
2011-06-28 20:40:17 -04:00
|
|
|
"Compile result of block tangle with lilypond.
|
2019-09-20 18:27:53 -04:00
|
|
|
If error in compilation, attempt to mark the error in lilypond org file."
|
2014-08-20 15:10:00 -04:00
|
|
|
(when org-babel-lilypond-compile-post-tangle
|
|
|
|
(let ((org-babel-lilypond-tangled-file (org-babel-lilypond-switch-extension
|
2021-09-29 03:22:47 -04:00
|
|
|
(buffer-file-name) ".lilypond"))
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-temp-file (org-babel-lilypond-switch-extension
|
2021-09-29 03:22:47 -04:00
|
|
|
(buffer-file-name) ".ly")))
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(if (not (file-exists-p org-babel-lilypond-tangled-file))
|
|
|
|
(error "Error: Tangle Failed!")
|
|
|
|
(when (file-exists-p org-babel-lilypond-temp-file)
|
|
|
|
(delete-file org-babel-lilypond-temp-file))
|
|
|
|
(rename-file org-babel-lilypond-tangled-file
|
|
|
|
org-babel-lilypond-temp-file))
|
2020-02-17 03:04:19 -05:00
|
|
|
(org-switch-to-buffer-other-window "*lilypond*")
|
2011-06-28 20:40:17 -04:00
|
|
|
(erase-buffer)
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-compile-lilyfile org-babel-lilypond-temp-file)
|
2011-06-28 20:40:17 -04:00
|
|
|
(goto-char (point-min))
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(if (org-babel-lilypond-check-for-compile-error org-babel-lilypond-temp-file)
|
|
|
|
(error "Error in Compilation!")
|
|
|
|
(other-window -1)
|
|
|
|
(org-babel-lilypond-attempt-to-open-pdf org-babel-lilypond-temp-file)
|
|
|
|
(org-babel-lilypond-attempt-to-play-midi org-babel-lilypond-temp-file)))))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2023-08-24 09:32:27 -04:00
|
|
|
;;Ignoring second arg for pre Org 9.7 compatibility
|
|
|
|
(defun org-babel-lilypond-compile-lilyfile (filename &optional _)
|
|
|
|
"Compile Lilypond FILENAME and check for compile errors."
|
|
|
|
(message "Compiling %s..." filename)
|
|
|
|
(let ((args (delq nil (list
|
|
|
|
(and org-babel-lilypond-gen-png "--png")
|
|
|
|
(and org-babel-lilypond-gen-html "--html")
|
|
|
|
(and org-babel-lilypond-gen-pdf "--pdf")
|
|
|
|
(and org-babel-lilypond-use-eps "-dbackend=eps")
|
|
|
|
(and org-babel-lilypond-gen-svg "-dbackend=svg")
|
|
|
|
(concat "--output=" (file-name-sans-extension filename))
|
|
|
|
filename))))
|
|
|
|
(apply #'call-process org-babel-lilypond-ly-command nil
|
|
|
|
"*lilypond*" 'display args)))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-check-for-compile-error (file-name &optional test)
|
2011-06-28 20:40:17 -04:00
|
|
|
"Check for compile error.
|
|
|
|
This is performed by parsing the *lilypond* buffer
|
|
|
|
containing the output message from the compilation.
|
|
|
|
FILE-NAME is full path to lilypond file.
|
|
|
|
If TEST is t just return nil if no error found, and pass
|
2019-09-20 18:27:53 -04:00
|
|
|
nil as file-name since it is unused in this context."
|
2011-06-28 20:40:17 -04:00
|
|
|
(let ((is-error (search-forward "error:" nil t)))
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(if test
|
|
|
|
is-error
|
|
|
|
(when is-error
|
|
|
|
(org-babel-lilypond-process-compile-error file-name)))))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-process-compile-error (file-name)
|
2011-06-28 20:40:17 -04:00
|
|
|
"Process the compilation error that has occurred.
|
2019-09-20 18:27:53 -04:00
|
|
|
FILE-NAME is full path to lilypond file."
|
2014-08-20 15:10:00 -04:00
|
|
|
(let ((line-num (org-babel-lilypond-parse-line-num)))
|
|
|
|
(let ((error-lines (org-babel-lilypond-parse-error-line file-name line-num)))
|
|
|
|
(org-babel-lilypond-mark-error-line file-name error-lines)
|
2011-06-28 20:40:17 -04:00
|
|
|
(error "Error: Compilation Failed!"))))
|
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-mark-error-line (file-name line)
|
2011-06-28 20:40:17 -04:00
|
|
|
"Mark the erroneous lines in the lilypond org buffer.
|
|
|
|
FILE-NAME is full path to lilypond file.
|
2019-09-20 18:27:53 -04:00
|
|
|
LINE is the erroneous line."
|
2020-02-17 03:04:19 -05:00
|
|
|
(org-switch-to-buffer-other-window
|
2011-06-28 20:40:17 -04:00
|
|
|
(concat (file-name-nondirectory
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-switch-extension file-name ".org"))))
|
2011-06-28 20:40:17 -04:00
|
|
|
(let ((temp (point)))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(setq case-fold-search nil)
|
|
|
|
(if (search-forward line nil t)
|
|
|
|
(progn
|
2022-01-16 02:07:25 -05:00
|
|
|
(org-fold-show-all)
|
2011-06-28 20:40:17 -04:00
|
|
|
(set-mark (point))
|
|
|
|
(goto-char (- (point) (length line))))
|
|
|
|
(goto-char temp))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-parse-line-num (&optional buffer)
|
2023-08-24 08:20:22 -04:00
|
|
|
"Extract error line number in BUFFER or `current-buffer'."
|
2015-10-25 20:56:00 -04:00
|
|
|
(when buffer (set-buffer buffer))
|
2011-06-28 20:40:17 -04:00
|
|
|
(let ((start
|
|
|
|
(and (search-backward ":" nil t)
|
|
|
|
(search-backward ":" nil t)
|
|
|
|
(search-backward ":" nil t)
|
2015-10-25 20:56:00 -04:00
|
|
|
(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)))))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-parse-error-line (file-name lineNo)
|
2019-09-20 18:27:53 -04:00
|
|
|
"Extract the erroneous line from the tangled .ly file.
|
2011-06-28 20:40:17 -04:00
|
|
|
FILE-NAME is full path to lilypond file.
|
2019-09-20 18:27:53 -04:00
|
|
|
LINENO is the number of the erroneous line."
|
2011-07-01 15:22:05 -04:00
|
|
|
(with-temp-buffer
|
2014-08-20 15:10:00 -04:00
|
|
|
(insert-file-contents (org-babel-lilypond-switch-extension file-name ".ly")
|
2011-07-01 15:22:05 -04:00
|
|
|
nil nil nil t)
|
|
|
|
(if (> lineNo 0)
|
|
|
|
(progn
|
|
|
|
(goto-char (point-min))
|
|
|
|
(forward-line (- lineNo 1))
|
2022-08-22 22:54:57 -04:00
|
|
|
(buffer-substring (point) (line-end-position)))
|
2011-07-01 15:22:05 -04:00
|
|
|
nil)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test)
|
2019-09-20 18:27:53 -04:00
|
|
|
"Attempt to display the generated pdf file.
|
|
|
|
FILE-NAME is full path to lilypond file.
|
|
|
|
If TEST is non-nil, the shell command is returned and is not run."
|
2014-08-20 15:10:00 -04:00
|
|
|
(when org-babel-lilypond-display-pdf-post-tangle
|
|
|
|
(let ((pdf-file (org-babel-lilypond-switch-extension file-name ".pdf")))
|
2011-06-28 20:40:17 -04:00
|
|
|
(if (file-exists-p pdf-file)
|
|
|
|
(let ((cmd-string
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(concat org-babel-lilypond-pdf-command " " pdf-file)))
|
2011-06-28 20:40:17 -04:00
|
|
|
(if test
|
|
|
|
cmd-string
|
2012-03-19 16:38:12 -04:00
|
|
|
(start-process
|
|
|
|
"\"Audition pdf\""
|
|
|
|
"*lilypond*"
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
org-babel-lilypond-pdf-command
|
2012-03-19 16:38:12 -04:00
|
|
|
pdf-file)))
|
|
|
|
(message "No pdf file generated so can't display!")))))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-attempt-to-play-midi (file-name &optional test)
|
2019-09-20 18:27:53 -04:00
|
|
|
"Attempt to play the generated MIDI file.
|
|
|
|
FILE-NAME is full path to lilypond file.
|
|
|
|
If TEST is non-nil, the shell command is returned and is not run."
|
2014-08-20 15:10:00 -04:00
|
|
|
(when org-babel-lilypond-play-midi-post-tangle
|
2021-08-30 12:49:48 -04:00
|
|
|
(let* ((ext (if (eq system-type 'windows-nt)
|
|
|
|
".mid" ".midi"))
|
|
|
|
(midi-file (org-babel-lilypond-switch-extension file-name ext)))
|
2011-06-28 20:40:17 -04:00
|
|
|
(if (file-exists-p midi-file)
|
|
|
|
(let ((cmd-string
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(concat org-babel-lilypond-midi-command " " midi-file)))
|
2011-06-28 20:40:17 -04:00
|
|
|
(if test
|
|
|
|
cmd-string
|
2012-03-19 16:38:12 -04:00
|
|
|
(start-process
|
|
|
|
"\"Audition midi\""
|
|
|
|
"*lilypond*"
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
org-babel-lilypond-midi-command
|
2012-03-19 16:38:12 -04:00
|
|
|
midi-file)))
|
2011-06-28 20:40:17 -04:00
|
|
|
(message "No midi file generated so can't play!")))))
|
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-toggle-midi-play ()
|
2012-07-30 04:08:15 -04:00
|
|
|
"Toggle whether midi will be played following a successful compilation."
|
2011-06-28 20:40:17 -04:00
|
|
|
(interactive)
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-play-midi-post-tangle
|
|
|
|
(not org-babel-lilypond-play-midi-post-tangle))
|
2011-06-28 20:40:17 -04:00
|
|
|
(message (concat "Post-Tangle MIDI play has been "
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-play-midi-post-tangle
|
2011-06-28 20:40:17 -04:00
|
|
|
"ENABLED." "DISABLED."))))
|
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-toggle-pdf-display ()
|
2012-07-30 04:08:15 -04:00
|
|
|
"Toggle whether pdf will be displayed following a successful compilation."
|
2011-06-28 20:40:17 -04:00
|
|
|
(interactive)
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-display-pdf-post-tangle
|
|
|
|
(not org-babel-lilypond-display-pdf-post-tangle))
|
2011-06-28 20:40:17 -04:00
|
|
|
(message (concat "Post-Tangle PDF display has been "
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-display-pdf-post-tangle
|
2011-06-28 20:40:17 -04:00
|
|
|
"ENABLED." "DISABLED."))))
|
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-toggle-png-generation ()
|
2012-07-30 04:08:15 -04:00
|
|
|
"Toggle whether png image will be generated by compilation."
|
2011-06-28 20:40:17 -04:00
|
|
|
(interactive)
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-gen-png (not org-babel-lilypond-gen-png))
|
2011-06-28 20:40:17 -04:00
|
|
|
(message (concat "PNG image generation has been "
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-gen-png "ENABLED." "DISABLED."))))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-toggle-html-generation ()
|
2012-07-30 04:08:15 -04:00
|
|
|
"Toggle whether html will be generated by compilation."
|
2011-06-28 20:40:17 -04:00
|
|
|
(interactive)
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-gen-html (not org-babel-lilypond-gen-html))
|
2011-06-28 20:40:17 -04:00
|
|
|
(message (concat "HTML generation has been "
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-gen-html "ENABLED." "DISABLED."))))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-toggle-pdf-generation ()
|
2012-07-30 04:08:15 -04:00
|
|
|
"Toggle whether pdf will be generated by compilation."
|
2012-03-19 16:38:12 -04:00
|
|
|
(interactive)
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-gen-pdf (not org-babel-lilypond-gen-pdf))
|
2012-03-19 16:38:12 -04:00
|
|
|
(message (concat "PDF generation has been "
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-gen-pdf "ENABLED." "DISABLED."))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-toggle-arrange-mode ()
|
2012-07-30 04:08:15 -04:00
|
|
|
"Toggle whether in Arrange mode or Basic mode."
|
2011-07-06 09:17:29 -04:00
|
|
|
(interactive)
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-arrange-mode
|
|
|
|
(not org-babel-lilypond-arrange-mode))
|
2011-07-06 09:17:29 -04:00
|
|
|
(message (concat "Arrange mode has been "
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-arrange-mode "ENABLED." "DISABLED."))))
|
2011-07-06 09:17:29 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-switch-extension (file-name ext)
|
2019-09-20 18:27:53 -04:00
|
|
|
"Utility command to swap current FILE-NAME extension with EXT."
|
2011-06-28 20:40:17 -04:00
|
|
|
(concat (file-name-sans-extension
|
2020-02-18 17:24:09 -05:00
|
|
|
file-name)
|
2021-09-29 03:22:47 -04:00
|
|
|
ext))
|
2011-06-28 20:40:17 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-get-header-args (mode)
|
2019-09-20 18:27:53 -04:00
|
|
|
"Default arguments to use when evaluating a lilypond source block.
|
|
|
|
These depend upon whether we are in Arrange mode i.e. MODE is t."
|
2011-07-06 09:17:29 -04:00
|
|
|
(cond (mode
|
|
|
|
'((:tangle . "yes")
|
|
|
|
(:noweb . "yes")
|
|
|
|
(:results . "silent")
|
2012-03-19 16:38:12 -04:00
|
|
|
(:cache . "yes")
|
2011-07-06 09:17:29 -04:00
|
|
|
(:comments . "yes")))
|
|
|
|
(t
|
2021-09-29 03:22:47 -04:00
|
|
|
ob-lilypond-header-args)))
|
2011-07-06 09:17:29 -04:00
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
(defun org-babel-lilypond-set-header-args (mode)
|
2023-08-24 08:20:22 -04:00
|
|
|
"Set lilypond babel header according to MODE."
|
2011-07-06 09:17:29 -04:00
|
|
|
(setq org-babel-default-header-args:lilypond
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-get-header-args mode)))
|
2011-07-06 09:17:29 -04:00
|
|
|
|
2011-06-28 20:40:17 -04:00
|
|
|
(provide 'ob-lilypond)
|
2011-06-30 14:06:22 -04:00
|
|
|
|
2011-06-28 20:40:17 -04:00
|
|
|
;;; ob-lilypond.el ends here
|