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 +LyeLqp3uWTbcAAASxT56A (envelope-from ) for ; Thu, 20 Jul 2023 20:06:34 +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 oCOzLqp3uWRqfwAAauVa8A (envelope-from ) for ; Thu, 20 Jul 2023 20:06:34 +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 453D141DA4 for ; Thu, 20 Jul 2023 20:06:34 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=BGvljndy; 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=1689876394; 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=beuyXa9QEdw8kzPjesVHE7tBr8PxBYMibudeGuLVHB0=; b=Ze1onfHM2JyqqJXxQ776RZt6DCx1wuH5zwfdC4iguVIkbK7wIrrTIbtYCrDND5pcWj9N2y 3NywzKpgBBv5CfJ2eXIYlH6qyosTVdNthINu/LK7oyilBntK8+Y771ibOPAI3ll0T+Fwtp OrCFlZyVc6alr5qPoS0aMJB93N8uUBRDCNABZpYiXGCdFAEGGnru35v/gUPKfhtsQS6wyr Kc5XJvW/iiZ4btFuIkQwiAeyQ3FU6ZJs7zuskxpRfMPnb8aMIhV1t6nV4tlBBhyLMpL/v4 lSaoEbo1VHA8xK9MABVmFs75fZmqEZzX7O737Q6InblVzDgAJGReZ3OXHU6gNw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689876394; a=rsa-sha256; cv=none; b=A6LEDSHldJrgsr7wTpSvKP3FDbPrxxspva/56r0uGSsQHz/fm4Y0RC0szc3UAKAEu+QTbh e1jTZiG3ITOItrJ4uKBYhxE1cLevEwKkkNx+oCWeVZddyyW7/XTEaEnVCCx3kb+oFKlcHE Ie5IEy3nlkK5mUD6GHZgX7sWcrnK9R1e7jQeX9J2C1Tfs+rotjHuzPtN8ex0effLuKOjTc A+gh1PgIe1o5a8TCkr0udv1dKz72btuk+HjAyAMU2mMlL91HGEbIHr+TS+Fj9Gm0QK6HsM 0ioSFk5bJYfD1OXrmj7RQBVIF9kkTRH1elLfGE2cz4T5J9ItLoLguYWL4ckxQA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=BGvljndy; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMY1x-0000Rj-GO; Thu, 20 Jul 2023 14:05:37 -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 1qMY1u-0000RV-OJ for emacs-orgmode@gnu.org; Thu, 20 Jul 2023 14:05:34 -0400 Received: from devianza.investici.org ([198.167.222.108]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMY1p-0000BC-KY for emacs-orgmode@gnu.org; Thu, 20 Jul 2023 14:05:34 -0400 Received: from mx2.investici.org (unknown [127.0.0.1]) by devianza.investici.org (Postfix) with ESMTP id 4R6LFd5SPbz6vFw; Thu, 20 Jul 2023 18:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1689876325; bh=beuyXa9QEdw8kzPjesVHE7tBr8PxBYMibudeGuLVHB0=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=BGvljndyQKZUtJXkxkT9u9D70HJwwGYtYtYJ7bszm79j2cguomMC35p6CHyG0d/6e Z8H1nbGRwjRNuwLjBSsFel/axVXCFet8APD/UzsaKTgcXQpH5R8Yyw8YgLfBrT8guy eA8Lj+WdtB9Ltp+10XICRiEC6Pb+Cnet8XBsOY08= Received: from [198.167.222.108] (mx2.investici.org [198.167.222.108]) (Authenticated sender: jgregory@autistici.org) by localhost (Postfix) with ESMTPSA id 4R6LFb6Zdxz6v7l; Thu, 20 Jul 2023 18:05:23 +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> <878rbchyt9.fsf@autistici.org> <87edl3xdhe.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: Thu, 20 Jul 2023 14:53:21 -0300 In-reply-to: <87edl3xdhe.fsf@localhost> Message-ID: <87tttyjw6b.fsf@autistici.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=198.167.222.108; envelope-from=jgrg@autistici.org; helo=devianza.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, RCVD_IN_DNSWL_NONE=-0.0001, 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-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -9.64 X-Spam-Score: -9.64 X-Migadu-Queue-Id: 453D141DA4 X-TUID: x/1AD1wzEjLC --=-=-= Content-Type: text/plain; format=flowed On 20 Jul 2023, Ihor Radchenko wrote: > With your patch, I cannot produce png output. The file is just > not created: [...] You're right. Thanks for the feedback. I've made some changes and was able to produce the correct results using pdf, eps, and png (tested with 2.20.0 and 2.24.1). I think this gets us closer to the old behaviour, assuming there are no other issues, of course. -- 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..8533cd8c7 100644 --- a/lisp/ob-lilypond.el +++ b/lisp/ob-lilypond.el @@ -178,28 +178,39 @@ specific arguments to =org-babel-tangle=." (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))) + ;; 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. See: + ;; https://lilypond.org/doc/v2.24/Documentation/usage/other-programs + (insert + (format "#(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)))\n" + 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." --=-=-=--