From: ludo@gnu.org (Ludovic Courtès)
To: guile-user@gnu.org
Subject: Re: escaping characters
Date: Fri, 02 Nov 2012 23:06:17 +0100 [thread overview]
Message-ID: <87zk2zmzhi.fsf@gnu.org> (raw)
In-Reply-To: 87fw4s2avi.fsf@googlemail.com
Ian Price <ianprice90@googlemail.com> 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’.
prev parent reply other threads:[~2012-11-02 22:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 16:47 escaping characters Kejia柯嘉
2012-10-31 21:34 ` Ludovic Courtès
2012-11-01 14:24 ` Kejia柯嘉
2012-11-01 18:14 ` Thien-Thi Nguyen
2012-11-01 18:41 ` Noah Lavine
2012-11-02 21:57 ` Ludovic Courtès
2012-11-01 2:12 ` nalaginrut
2012-11-02 17:05 ` Ian Price
2012-11-02 22:06 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zk2zmzhi.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).