branch: externals-release/org
commit e4c0281d23b6fdca33dda255eef412066779e34d
Author: Jonathan Gregory <[email protected]>
Commit: Bastien <[email protected]>
Set the MIDI file extension conditionally
* lisp/ob-lilypond.el (org-babel-lilypond-attempt-to-play-midi): By
default, LilyPond outputs .mid files for Windows and .midi for
everything else.
See: <https://lists.gnu.org/r/emacs-orgmode/2021-08/msg00379.html>
TINYCHANGE
---
lisp/ob-lilypond.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el
index fbdd905..e0557eb 100644
--- a/lisp/ob-lilypond.el
+++ b/lisp/ob-lilypond.el
@@ -328,7 +328,9 @@ If TEST is non-nil, the shell command is returned and is
not run."
FILE-NAME is full path to lilypond file.
If TEST is non-nil, the shell command is returned and is not run."
(when org-babel-lilypond-play-midi-post-tangle
- (let ((midi-file (org-babel-lilypond-switch-extension file-name ".midi")))
+ (let* ((ext (if (eq system-type 'windows-nt)
+ ".mid" ".midi"))
+ (midi-file (org-babel-lilypond-switch-extension file-name ext)))
(if (file-exists-p midi-file)
(let ((cmd-string
(concat org-babel-lilypond-midi-command " " midi-file)))