From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OP1UL9HWt2SMfAAASxT56A (envelope-from ) for ; Wed, 19 Jul 2023 14:28:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EKYzL9HWt2QcKAAA9RJhRA (envelope-from ) for ; Wed, 19 Jul 2023 14:28:01 +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 3F7B349CF4 for ; Wed, 19 Jul 2023 14:28:01 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=L4f8UdYL; 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"; dmarc=pass (policy=reject) header.from=autistici.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689769681; 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=0vXuqwBVNlA86whicYWbgQrCrjsTuT1oo6t+X7PdyVI=; b=e8dmf/08Zi746+n796CSk88PLsEl0+CFpceDI1qxVvwJAdJDb7VZ8GbfAXmg2HdjuDwvFy qD4tlxDJDQ/U75O7oOhie17WupcuUAa82KBVxg7q6tszcs5EsQecZ3RJg2LpQz9IYCZmYi pfipy4ifEFy53bW4tZt+qi/dwqdW1yAnutuovBy1ieSILHw7k6sqcLe9aGzQqs56TZpfaY 7iii7gEWkvY67EyI04HgGHMfn9HY9q29N1LlznhL+yxJ4hHPLTlAVdLzh55SQIAEQwjcmn IJSQEg7Au3QtGVx9bpKVJaNVVSeSb0XpFw0KxfdZDmRmSccYGnHAIyH5+HysJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=L4f8UdYL; 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"; dmarc=pass (policy=reject) header.from=autistici.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689769681; a=rsa-sha256; cv=none; b=knH/0Kbz8qw6IuAqR88SKk0jEtBTtsidlkJ32f/uU93YwIzg85ABHQY91kmqEjWPUdEByE QhgoXYGNSPMsU3BPvYH3uly1c98LJwidC+aPWRmc/EpoLD1XFLhOlCuhClFJ0v/HNVkLAc Pxl7R+H+Y2uS7MOnFVd5K4pccXnJMKo3r4Qs9QnLjCTLbAGLAYzH9TzCvLFc7f5CkWxvvY aa3/+QooHKxEwW0dH9K/A0UThLz+9ZrGVzcxdbF7oWOZBwAgnA8UI8Qx2/R5rXLhMLrw+q uXTDnmH+YfcsSdHimXLzaHk2pR1R40XGirzfM8TOcWUllVOvdwddBVOdCnVV6w== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qM6Gt-0004mi-Tw; Wed, 19 Jul 2023 08:27:11 -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 1qM6Gr-0004mL-FV for emacs-orgmode@gnu.org; Wed, 19 Jul 2023 08:27:09 -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 1qM6Go-0003Oa-CS for emacs-orgmode@gnu.org; Wed, 19 Jul 2023 08:27:09 -0400 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4R5ZnZ6Gtlz111H; Wed, 19 Jul 2023 12:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1689769618; bh=0vXuqwBVNlA86whicYWbgQrCrjsTuT1oo6t+X7PdyVI=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=L4f8UdYLmPUYM7VuhHoOiQUjzwbgut2StD4WUhrHYthomar5Et/fTEKbfWKgliv8Y srzNf0yL8WHdXHPJAt/IGpVTtIfbSrZmZGRpcUzOIG7YeFIAm8N2V0lpXJpKhhhxdL +tBK9ukNyhPv18nA+1/QD5+VUBv9G4vOG+GWbLcY= Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: jgregory@autistici.org) by localhost (Postfix) with ESMTPSA id 4R5ZnY0Hdrz1107; Wed, 19 Jul 2023 12:26:56 +0000 (UTC) References: <87bl9rq29m.fsf@gnu.org> <875yzzilq0.fsf@cnrs.fr> <871ram4x83.fsf@web.de> <87a5w15jur.fsf@localhost> <87fs5svjqb.fsf@autistici.org> <87a5w0yvhf.fsf@localhost> <87ilam3bv1.fsf@autistici.org> <877cr2id09.fsf@localhost> <87zg3uxyba.fsf@autistici.org> <87sf9lv9ta.fsf@localhost> User-agent: mu4e 1.9.0; emacs 28.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, 19 Jul 2023 09:17:40 -0300 In-reply-to: <87sf9lv9ta.fsf@localhost> Message-ID: <878rbchyt9.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, T_SCC_BODY_TEXT_LINE=-0.01 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-Spam-Score: -9.63 X-Migadu-Queue-Id: 3F7B349CF4 X-Migadu-Spam-Score: -9.63 X-Migadu-Scanner: mx0.migadu.com X-TUID: cwktgSjjD8MT --=-=-= Content-Type: text/plain; format=flowed On 18 Jul 2023, Ihor Radchenko wrote: > Jonathan Gregory writes: > >>> I also checked what will happen with future versions, and it >>> looks like \version "2.24.1" actually means >=. >> >> That's good to know. >> >> I know version 2.20.0 works without the update, so perhaps we >> could set those variables conditionally, WDYT? >> >> \version "2.20" >> #(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 'pdf))) > > I do not mind. But remember that we are talking just about an > example file. What you are suggesting appears to be closer to > what we might do in ob-lilypond itself, when calculating default > layout. That would be even better, I agree. Can you test my patch? Command-line options are normally added to `org-babel-lilypond-ly-command`, but since we're trying to set variables conditionally to accommodate different versions, I don't see how we can do this without using scheme. WDYT? > Side note: ob-lilypond even has > `org-babel-lilypond-toggle-midi-play' that plays sound > corresponding to the lilypond source. Pretty cool, especially in > the context of the discussion about non-textual output types in > babel. > https://list.orgmode.org/orgmode/87ttu95xst.fsf@localhost/ Sure, I'll think about adding a MIDI example as well. -- Jonathan --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=ob-lilypond.el.diff diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el index 9693b89e2..3cbdd2b27 100644 --- a/lisp/ob-lilypond.el +++ b/lisp/ob-lilypond.el @@ -183,6 +183,12 @@ specific arguments to =org-babel-tangle=." (in-file (org-babel-temp-file "lilypond-"))) (with-temp-file in-file + ;; To create music fragments suitable for mixing music and text, + ;; newer versions of lilypond require setting at least the + ;; following two variables introduced in version 2.22. + (insert "#(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 'pdf)))\n") (insert (org-babel-expand-body:generic body params))) (org-babel-eval (concat @@ -199,7 +205,9 @@ specific arguments to =org-babel-tangle=." (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." --=-=-=--