Hi On 02 Apr 2020, stardiviner <numbch...@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > Jonathan Gregory <j...@autistici.org> writes: > >> Hi >> >> On 30 Mar 2020, stardiviner <numbch...@gmail.com> wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA256 >>> >>> >>> stardiviner <numbch...@gmail.com> 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