quoting underscores and dollar signs

This file is copyright © 2004,2005,2006,2011 by Panu Kalliokoski and released under the stx2any license.

Quoting underscores and dollar signs…

Pass preformatted blocks through.

/^{{{$/,/^}}}$/ b

First, quote-quote underscores that should not be quoted.

s#__line#UNDERSCORETHINGYUNDERSCORETHINGYline#g
s#__file#UNDERSCORETHINGYUNDERSCORETHINGYfile#g
s#w_#wUNDERSCORETHINGY#g
t moreus
: moreus
s#\(UNDERSCORETHINGY[a-z]*\)_#\1UNDERSCORETHINGY#g
t moreus

Then, do the actual quoting and quote-quote unquoting.

s#_#`'w_us`'#g
s#UNDERSCORETHINGY#_#g

Dollar signs are also problematic.

/define/!{
/`/!{
s#\$#`'w_dol`'#g
}
}