denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Bookpart scripts


From: Andreas Schneider
Subject: Re: [Denemo-devel] Bookpart scripts
Date: Sat, 14 May 2016 18:37:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

Here is my current version:

;;;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 (eval-string (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-movementcontrol 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 = \\markup { "
thetitle " }\n  }\n"))
      (d-SetSaved #f)
    )
  ))
    (d-InfoDialog "Cancelled")
  )
)

I have inserted (eval-string ...) at the readout of the data field, but
it throws an error. Thank you for your offer to investigate.

Andreas


Am 14.05.2016 um 15:49 schrieb Richard Shann:
> On Fri, 2016-05-13 at 22:16 +0200, Andreas Schneider wrote:
>> I have discovered a little issue in my script: backslashes have to be
>> un-escaped when loading a title from the data field (otherwise the
>> number of backslashes is doubled every time you edit the title). How do
>> I do that?
> 
> it sounds like you didn't need to use scheme-escape. (You would
> (eval-string thedatafield) to un-escape it, but there would be no
> point). The problem I was thinking of arises with accented characters on
> windows (I think).
> If you send your code I'll experiment.
> Sorry if I set you on a wild goose chase mentioning scheme-escape.
> 
> Richard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]