[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Programming: best ci strategy



Reply to note from Harry Binswanger  Thu, 27 Oct
2011 11:28:46 -0400

Harry:

> But there are so many cases, and I hate to try to cover them
> all in separate ci's, especially when the order of changes
> becomes relevant.
> ...
> So is there some smart way of doing changes for items delimited
> by more than one set of symbols?

Hard to give a definitive answer without knowing the universe of
cases. But two things occur to me off the bat. First, if "." is the
only offending separator, then you could use the [-] exclusion
wildcard (reverse video "-") to construct a CHange command that
excludes ".". Second, sometimes the only way to work around error
567 ("Wildcards must be in the same order on both sides of a
change") is to write your own CHange command (in the form
BX se /blah/Q2 )[make the change]).
Putting those two ideas together, I come up with:

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}LBa{>}[BX_]se /[wS][w-].print /[Q2_]{<}IF@NOT({<}ER{>}){>}
"[BX_]se/f [wC][Q2_]"{<}GLa{>}{<}EI{>};*;[cr|lf]
-nd
XPLeNCODE

This assumes (because your examples also seem to assume) that the
material to be wrapped in double quotes alway ends with a CrLf. It
will not work on a "print" statement that occurs at the very top of
the file (easily remedied), and it may be over- or under-inclusive
in other respects (again, hard to know without a more comprehensive
statement of the problem), but it may provide food for thought.

--
Carl Distefano
cld@xxxxxxxx