From: Jonathan Gregory <jgrg@autistici.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: "Dr. Arne Babenhauserheide" <arne_bab@web.de>,
"Victor A. Stoichita" <victor@svictor.net>,
emacs-orgmode@gnu.org
Subject: Re: [BUG] WORG example for ob-lilypond is no longer working as described (was: Moving some lisp/ob-*.el files to org-contrib - your advice?)
Date: Wed, 16 Aug 2023 09:54:44 -0300 [thread overview]
Message-ID: <871qg3w37r.fsf@autistici.org> (raw)
In-Reply-To: <87y1iit5z9.fsf@localhost>
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
Hi Ihor,
On 11 Aug 2023, Ihor Radchenko wrote:
> Ok. Would you mind adding a commit message, as described in
> https://orgmode.org/worg/org-contribute.html#first-patch?
Patch attached. I also attached a test file.
> And do I understand correctly that no changes in
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
> are needed?
Probably not, but I'll check.
--
Jonathan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bugfix-ob-lilypond.patch --]
[-- Type: text/x-diff, Size: 2444 bytes --]
commit 8916c9ebbefb1b1d448e0e39998f9b9a3b054680
Author: Jonathan Gregory <jgrg@autistici.org>
Date: Wed Aug 16 09:47:09 2023 -0300
lisp/ob-lilypond.el: Prevent full page results in basic-mode
* ob-lilypond.el (org-babel-lilypond-paper-settings): New variable.
Link: https://list.orgmode.org/87a5w15jur.fsf@localhost/
TINYCHANGE
diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el
index 9693b89e2..ad8371c5f 100644
--- a/lisp/ob-lilypond.el
+++ b/lisp/ob-lilypond.el
@@ -175,31 +175,51 @@ specific arguments to =org-babel-tangle=."
(if (org-babel-tangle nil "yes" "lilypond")
(org-babel-lilypond-execute-tangled-ly) nil))
+;; 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.")
+
(defun org-babel-lilypond-process-basic (body params)
"Execute a lilypond block in basic mode."
(let* ((out-file (cdr (assq :file params)))
+ (file-type (file-name-extension out-file))
(cmdline (or (cdr (assq :cmdline params))
""))
(in-file (org-babel-temp-file "lilypond-")))
(with-temp-file in-file
- (insert (org-babel-expand-body:generic body params)))
+ (insert
+ (format org-babel-lilypond-paper-settings file-type)
+ (org-babel-expand-body:generic body params)))
(org-babel-eval
(concat
org-babel-lilypond-ly-command
" -dbackend=eps "
"-dno-gs-load-fonts "
"-dinclude-eps-fonts "
- (or (cdr (assoc (file-name-extension out-file)
- '(("pdf" . "--pdf ")
- ("ps" . "--ps ")
- ("png" . "--png "))))
+ (or (assoc-default file-type
+ '(("pdf" . "--pdf ")
+ ("eps" . "--eps ")))
"--png ")
"--output="
(file-name-sans-extension out-file)
" "
cmdline
- in-file) "")) nil)
+ in-file)
+ ""))
+ nil)
(defun org-babel-prep-session:lilypond (_session _params)
"Return an error because LilyPond exporter does not support sessions."
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: test.org --]
[-- Type: text/x-org, Size: 591 bytes --]
#+title: Test
#+PROPERTY: header-args:lilypond :noweb yes :exports results
#+PROPERTY: header-args:lilypond :prologue (org-babel-ref-resolve "settings[]")
Some text.
#+begin_src lilypond :file myfile.pdf
\score {
\new Staff \relative c' {
\tempo 4 = 160
c4 e g b
c4 b d c
\tempo 4 = 96
d,4 fis a cis
d4 cis e d
}
\layout { }
\midi { }
}
#+end_src
#+results:
[[file:myfile.pdf]]
Click [[file:myfile.midi][here]] to listen to the MIDI output.
#+name: settings
#+begin_src lilypond :exports none
\version "2.24.1"
% More lilypond settings here...
#+end_src
next prev parent reply other threads:[~2023-08-16 13:03 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 15:13 Moving some lisp/ob-*.el files to org-contrib - your advice? Bastien
2021-05-03 17:49 ` Timothy
2021-05-03 18:05 ` Bastien
2021-05-03 19:36 ` Palak Mathur
2021-05-03 19:44 ` Timothy
2021-05-03 19:47 ` Palak Mathur
2021-05-03 20:34 ` Bastien
2021-05-03 20:33 ` Bastien
2021-05-04 7:55 ` Eric S Fraga
2021-05-19 3:36 ` Jack Kamm
2021-05-03 20:52 ` Victor A. Stoichita
2021-05-04 10:19 ` Dr. Arne Babenhauserheide
2021-05-04 11:28 ` Bastien
2021-05-04 18:38 ` Victor A. Stoichita
2023-07-12 13:40 ` [BUG] WORG example for ob-lilypond is no longer working as described (was: Moving some lisp/ob-*.el files to org-contrib - your advice?) Ihor Radchenko
2023-07-12 22:35 ` Jonathan Gregory
2023-07-13 6:52 ` Dr. Arne Babenhauserheide
2023-07-13 10:08 ` Ihor Radchenko
2023-07-13 11:04 ` Jonathan Gregory
2023-07-14 12:38 ` Jonathan Gregory
2023-07-14 13:15 ` Dr. Arne Babenhauserheide
2023-07-14 13:52 ` Ihor Radchenko
2023-07-14 18:06 ` Ihor Radchenko
2023-07-17 17:02 ` Jonathan Gregory
2023-07-18 9:38 ` Ihor Radchenko
2023-07-19 12:17 ` Jonathan Gregory
2023-07-20 7:13 ` Ihor Radchenko
2023-07-20 17:53 ` Jonathan Gregory
2023-07-21 7:36 ` Ihor Radchenko
2023-07-21 11:38 ` Jonathan Gregory
2023-07-22 8:12 ` Ihor Radchenko
2023-07-25 16:16 ` Henrik Frisk
2023-07-25 16:26 ` Henrik Frisk
2023-07-25 17:17 ` Jonathan Gregory
2023-07-25 21:40 ` Henrik Frisk
2023-07-25 17:29 ` Jonathan Gregory
2023-07-26 8:15 ` Ihor Radchenko
2023-07-26 12:35 ` Jonathan Gregory
2023-07-27 7:21 ` Ihor Radchenko
2023-07-27 12:42 ` Jonathan Gregory
2023-07-28 7:37 ` Ihor Radchenko
2023-07-28 14:02 ` Jonathan Gregory
2023-07-29 7:16 ` Ihor Radchenko
2023-07-31 11:14 ` Jonathan Gregory
2023-07-31 11:58 ` Ihor Radchenko
2023-07-31 12:42 ` Jonathan Gregory
2023-08-08 13:01 ` Ihor Radchenko
2023-08-10 11:05 ` Jonathan Gregory
2023-08-11 7:04 ` Ihor Radchenko
2023-08-15 7:33 ` Henrik Frisk
2023-08-15 10:41 ` Ihor Radchenko
2023-08-15 15:57 ` Henrik Frisk
2023-08-15 16:04 ` Ihor Radchenko
2023-08-16 12:54 ` Jonathan Gregory [this message]
2023-08-17 10:26 ` Ihor Radchenko
2023-08-19 12:56 ` Jonathan Gregory
2023-08-20 7:20 ` Ihor Radchenko
2023-08-20 12:47 ` Jonathan Gregory
2023-08-20 13:46 ` Dr. Arne Babenhauserheide
2023-08-21 7:48 ` Ihor Radchenko
2023-07-13 6:33 ` [BUG] WORG example for ob-lilypond is no longer working as described Dr. Arne Babenhauserheide
2023-07-13 7:03 ` Dr. Arne Babenhauserheide
2023-07-13 8:03 ` Jean Abou Samra
2023-07-16 12:21 ` Graham King
2023-07-16 12:30 ` Ihor Radchenko
2021-05-04 11:32 ` Moving some lisp/ob-*.el files to org-contrib - your advice? Bastien
2021-05-03 22:19 ` Tim Cross
2021-05-03 23:15 ` Bastien
2021-05-04 10:19 ` Dr. Arne Babenhauserheide
2021-05-04 11:10 ` Bastien
2021-09-26 8:17 ` Bastien
2021-05-06 9:19 ` Jean Louis
2021-05-06 9:39 ` Bastien
2021-05-14 18:23 ` Greg Minshall
2021-05-17 16:39 ` Greg Minshall
2021-09-26 12:50 ` Bastien Guerry
2021-10-02 17:11 ` Bastien Guerry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qg3w37r.fsf@autistici.org \
--to=jgrg@autistici.org \
--cc=arne_bab@web.de \
--cc=emacs-orgmode@gnu.org \
--cc=victor@svictor.net \
--cc=yantar92@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).