[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] Book with Denemo
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] Book with Denemo |
Date: |
Tue, 10 May 2016 08:26:32 +0100 |
On Mon, 2016-05-09 at 23:43 +0200, Andreas Schneider wrote:
> Thank you for your suggestions. I tried the following:
>
> ;;;StartBookpart
> (let ((tag "StartBookpart")(thetitle ""))
> (d-DirectivePut-movementcontrol-override tag (logior
> DENEMO_OVERRIDE_GRAPHIC DENEMO_OVERRIDE_TAGEDIT))
> (disp "checking previous bookpart title ...")
> (if (d-Directive-movementcontrol? tag)
> (set! thetitle (d-DirectiveGet-movementcontrol-data tag)))
> (set! thetitle (d-GetUserInputWithSnippets (_ "Start Bookpart")(_
> "Give chapter title::") thetitle))
> (if thetitle
> (begin
> (set! thetitle (car thetitle))
> (if (zero? (string-length thetitle)) ;; if empty title string =>
> delete the directive
> (begin
> (disp (string-append "Deleting directive " tag "."))
> (d-DirectiveDelete-movemencontrol tag)
> (d-SetSaved #f)
> )
> (begin
> (disp thetitle)
> (d-DirectivePut-movementcontrol-data tag (scheme-escape thetitle))
> (d-DirectivePut-movementcontrol-prefix tag (string-append "
> \\bookpart { %start of bookpart\n \\header {\n title = { " thetitle
> " }\n }\n"))
> (d-SetSaved #f)
> )
> ))
> (d-InfoDialog "Cancelled")
> )
> )
>
> ;;;EndBookpart
> (let ((tag "EndBookpart"))
> (if (d-Directive-movementcontrol? tag)
> (begin
> (disp (string-append "Deleting directive " tag "."))
> (d-DirectiveDelete-movemencontrol tag)
> (d-SetSaved #f)
> )
> (begin
> ;; or create it if it doesn't exist
> (disp (string-append "Creating directive " tag "."))
> (d-DirectivePut-movementcontrol-override tag (logior
> DENEMO_OVERRIDE_GRAPHIC DENEMO_OVERRIDE_TAGEDIT))
> (d-DirectivePut-movementcontrol-postfix tag "\n} %end of bookpart\n")
> (d-SetSaved #f)
> ))
> )
>
> Unfortunately, deleting the directive does not work; I get a script error
> (#f Unbound variable: ~S (d-DirectiveDelete-movemencontrol) #f)
> What do I do wrong?
it's a typo, movement not movemen. You can test for whether a symbol is
defined by pasting it into the CLI: box in the scheme window and
pressing Enter. You get the value of the symbol in the terminal. This is
a good place for checking bits of your scheme script.
Richard
- Re: [Denemo-devel] Book with Denemo, (continued)
- Re: [Denemo-devel] Book with Denemo, Richard Shann, 2016/05/05
- Re: [Denemo-devel] Book with Denemo, Richard Shann, 2016/05/06
- Re: [Denemo-devel] Book with Denemo, Andreas Schneider, 2016/05/08
- Re: [Denemo-devel] Book with Denemo, Richard Shann, 2016/05/08
- Re: [Denemo-devel] Book with Denemo, Richard Shann, 2016/05/08
- Re: [Denemo-devel] Book with Denemo, Andreas Schneider, 2016/05/08
- Re: [Denemo-devel] Book with Denemo, Richard Shann, 2016/05/08
- Re: [Denemo-devel] Book with Denemo, Andreas Schneider, 2016/05/09
- Re: [Denemo-devel] Book with Denemo,
Richard Shann <=