[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: escaping characters
From: |
Ludovic Courtès |
Subject: |
Re: escaping characters |
Date: |
Fri, 02 Nov 2012 23:06:17 +0100 |
User-agent: |
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) |
Ian Price <address@hidden> skribis:
> ;; make-char-quotator takes an alist of character + string pairs
> ;; the character is the one to escape, and the string its replacement
> ;; it returns a function of two arguments, a string to escape, and a
> ;; port to write to.
>
> (define my-weird-escaper
> (make-char-quotator
> '((#\' . "''")
> (#\~ . "\\~")
> (#\& . "{ampersand}"))))
Oh, there’s actually something similar in Skribilo (inherited from
Skribe) called ‘make-string-replace’:
http://git.savannah.gnu.org/cgit/skribilo.git/tree/src/guile/skribilo/utils/strings.scm#n129
http://git.savannah.gnu.org/cgit/skribilo.git/tree/src/guile/skribilo/engine/latex.scm#n52
Thanks,
Ludo’.