From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Gregory Subject: Re: Org-babel-lilypond always renders full pages Date: Thu, 02 Apr 2020 19:56:22 -0300 Message-ID: <87zhbt4hux.fsf@autistici.org> References: <3891f510-f05e-103b-6deb-a8db8a741a83@posteo.de> <87mu7y7lyb.fsf@autistici.org> <914ed623-88fc-7d93-6df6-408297c3086d@posteo.de> <871rpaievd.fsf@gmail.com> <87y2rigz8y.fsf@gmail.com> <87h7y463eu.fsf@autistici.org> <87wo6ymgjq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:38942) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK8lN-000156-JA for emacs-orgmode@gnu.org; Thu, 02 Apr 2020 18:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK8lM-0007dS-62 for emacs-orgmode@gnu.org; Thu, 02 Apr 2020 18:56:41 -0400 Received: from latitanza.investici.org ([82.94.249.234]:29085) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jK8lL-0007aJ-Mv for emacs-orgmode@gnu.org; Thu, 02 Apr 2020 18:56:40 -0400 In-reply-to: <87wo6ymgjq.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: numbchild@gmail.com Cc: Oliver Heck , emacs-orgmode@gnu.org Hi On 02 Apr 2020, stardiviner wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > Jonathan Gregory writes: > >> Hi >> >> On 30 Mar 2020, stardiviner wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA256 >>> >>> >>> stardiviner writes: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA256 >>>> >>>> >>>> You might want to try this: >>>> >>>> #+begin_src emacs-lisp >>>> (add-to-list 'org-babel-default-header-args:lilypond >>>> '((:prologue . "\paper{ >>>> indent=0\mm >>>> line-width=120\mm >>>> oddFooterMarkup=##f >>>> oddHeaderMarkup=##f >>>> bookTitleMarkup = ##f >>>> scoreTitleMarkup = ##f >>>> }"))) >>>> #+end_src >>>> >>> >>> I found this custom setting lilypond header arguments will not work. Because this code function: >>> >>> #+begin_src emacs-lisp >>> (defun org-babel-lilypond-get-header-args (mode) >>> "Default arguments to use when evaluating a lilypond source block. >>> These depend upon whether we are in Arrange mode i.e. MODE is t." >>> (cond (mode >>> '((:tangle . "yes") >>> (:noweb . "yes") >>> (:results . "silent") >>> (:cache . "yes") >>> (:comments . "yes"))) >>> (t >>> '((:results . "file") >>> (:exports . "results"))))) >>> >>> (defun org-babel-lilypond-set-header-args (mode) >>> "Set org-babel-default-header-args:lilypond >>> dependent on ORG-BABEL-LILYPOND-ARRANGE-MODE." >>> (setq org-babel-default-header-args:lilypond >>> (org-babel-lilypond-get-header-args mode))) >>> #+end_src >>> >>> It always reset and return one result of two conditions. >>> >>> I think this is a bug. >> >> So are all org-babel-default-header-args:LANG custom variables? In the >> ob-lilypond.el library the headers are hard-coded. >> >> [...] > > Yes, it's hard-coded in that function definition. So setting that header > arguments variable will not work at all. OK, I had a closer look and none of the other libraries set org-babel-default-header-args:LANG in the file itself. IOW ob-lilypond is the only one that does this, and it does this to allow toggling between two modes (basic and arrange) and setting the header args relative to the mode used. But there's a cost to resetting org-babel-default-header-args:lilypond which is it prevents users from making modifications to it. I'm not sure how to deal with this. Maybe others can chime in. -- Jonathan