From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kO6oNxDJ3GQsUQAASxT56A (envelope-from ) for ; Wed, 16 Aug 2023 15:03:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +CdsNxDJ3GTXbwEAauVa8A (envelope-from ) for ; Wed, 16 Aug 2023 15:03:12 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7D9504EFCC for ; Wed, 16 Aug 2023 15:03:12 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=o3OM19Ux; dmarc=pass (policy=reject) header.from=autistici.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692190992; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=puJjs5kd5artPVOx4kBVZyIiGxZXfVoXJmacBbVcH9k=; b=MrrBjEWxYJI+0SFpqojqdef/hpyWpU6pIRZU/UTdBzb4ceQYqqPCAI8d015Kq7o22HIIej 9yQyO0jIU7lp/eZETkHzeStmXiS+Qmi0IqcqJmRvpho2YjOAcSbfV2+OJmLpypsT0STTW/ FtzpmLtjzLO0373ZwCskUOwD8AB8KIRNOK/+ubezmwLf99ihRAquEJ6abde1SEQNsAH0HA JPsctDFedN+AFywd7P1Z3+e90fx/EpHgCvrhDFWLDv2YVyiaTrdMiEwbeQLsD9o3qVqN4B Syd+rzKY4R3HxYj2C7nUSNwf1gIL59o4J34tSkzm1KQ4HwBYFfObdpFP6CjcoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=o3OM19Ux; dmarc=pass (policy=reject) header.from=autistici.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692190992; a=rsa-sha256; cv=none; b=qRhtHf7374N/CrpM6aLrcn1uT1bNbQbkgtejNWBDbARx9P4SCv+sMp3kWhEBPhaf2v4yC4 HdK2vVf9z0sac1bXKU3NBVt7qZME7LSFR665HOm4wOExRMKT+6D3dvqN9KDYLRBoPHzU03 jLE28l3JUTUtMWfqmZaCM7qWPxZnKBicIWdm7EMjJAtW0Bd1ddcl6wIAOC6iGoIvkkbt+6 RStUqqDX96CQTe7/9GOlZcuDcs46VnuDqoDT30IIpR6nvK6zbpg0jLk7THZav0R02DAmuM tPmzajSEnpSkFslS/1pI0fEwT/eKcFNUyugo4TOrduanqfp9ekPYRzgxD7/L1A== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWGAL-0000pz-0Z; Wed, 16 Aug 2023 09:02:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWGA8-0000hK-0w for emacs-orgmode@gnu.org; Wed, 16 Aug 2023 09:02:13 -0400 Received: from confino.investici.org ([2a11:7980:1::2:0]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWG9y-0007yF-N3 for emacs-orgmode@gnu.org; Wed, 16 Aug 2023 09:02:07 -0400 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4RQpDy6rK4z110W; Wed, 16 Aug 2023 13:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1692190914; bh=puJjs5kd5artPVOx4kBVZyIiGxZXfVoXJmacBbVcH9k=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=o3OM19Uxoe3FJBIruPBPw8kZKR7a/PvNnXg1XeKFdlfDqA6mLA4wMqwbDsPKQvnIv b25+Mgvmzb/4AwDFbixRhY16ftXO7NhgjNFXjDAnDJ/4JsM4eN+NjuMpMPhQeHESlF 5+YfWvQ2KV7jIoj4HN44aiRCSFEA2C6DB6jnc0hI= Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: jgregory@autistici.org) by localhost (Postfix) with ESMTPSA id 4RQpDx0yz3z110S; Wed, 16 Aug 2023 13:01:52 +0000 (UTC) References: <87bl9rq29m.fsf@gnu.org> <878rbchyt9.fsf@autistici.org> <87edl3xdhe.fsf@localhost> <87tttyjw6b.fsf@autistici.org> <878rb990n5.fsf@localhost> <87r0p1pk2y.fsf@autistici.org> <87jzus8ive.fsf@localhost> <87mszj99n0.fsf@autistici.org> <87edkvm6kv.fsf@localhost> <87ila696wu.fsf@autistici.org> <87a5vh95wg.fsf@localhost> <875y65cy0r.fsf@autistici.org> <87ila4fpw5.fsf@localhost> <87o7jwazmn.fsf@autistici.org> <87pm4bp4qu.fsf@localhost> <87jzugb914.fsf@autistici.org> <875y60i97y.fsf@localhost> <87fs54b69g.fsf@autistici.org> <87pm3xit7c.fsf@localhost> <87r0obnomm.fsf@autistici.org> <87y1iit5z9.fsf@localhost> User-agent: mu4e 1.9.0; emacs 29.1 From: Jonathan Gregory To: Ihor Radchenko Cc: "Dr. Arne Babenhauserheide" , "Victor A. Stoichita" , 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 In-reply-to: <87y1iit5z9.fsf@localhost> Message-ID: <871qg3w37r.fsf@autistici.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a11:7980:1::2:0; envelope-from=jgrg@autistici.org; helo=confino.investici.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.68 X-Spam-Score: -9.68 X-Migadu-Queue-Id: 7D9504EFCC X-Migadu-Scanner: mx2.migadu.com X-TUID: bMMQvjzU0F2W --=-=-= Content-Type: text/plain; format=flowed 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=bugfix-ob-lilypond.patch commit 8916c9ebbefb1b1d448e0e39998f9b9a3b054680 Author: Jonathan Gregory 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." --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=test.org #+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 --=-=-=--