[lug] XEmacs quoting madness!

Chris Riddoch socket at peakpeak.com
Mon Aug 20 00:19:43 MDT 2001


This should be a simple problem for someone. I hope.

In XEmacs, I'm trying to make a string with a backslash before single
quote.  I want the output string to be this: "Can\'t" because the
output will be passed as a string value to another program (thus
needing quoting).

"Can\'t" gives me "Can't", as I'd expect.

"Can\\'t" gives me "Can\\'t", as I really *didn't* expect.

"Can\\\'t" gives me "Can\\'t".

"Can\\\\'t" gives me "Can\\\\'t", which leads me to think it's impossible
to get a resulting string with any odd number of backslashes in it.

It seems a horrible overkill to throw it into a regular expression,
and please don't tell me to do something as ridiculous as:

(concatenate 'string "Can" (char-to-string ?') "t")

Someone, save me from this unnecessarily complicated quoting problem.
Sheesh.

-- 
Chris Riddoch       | epistemological
socket at peakpeak.com | humility



More information about the LUG mailing list