On Thu, 24 Apr 2008 11:49:40 -0500
"Edward K. Ream" <[EMAIL PROTECTED]> wrote:

> I wonder if there is a way to generalize this script.  The new
> @ifhostname setting would allow you to specify the munges for any
> machine.  Oh. I have it: put a representation of the patterns in an
> @data node, say @data path-demangle and drive the script from that
> node if it exists.

This is the second time in a week I've run into the big difference in
complexity between a simple "works for me" solution, and a tidy,
generalized, shareable solution.

For example, how to represent (replace,with) pairs in a @data node?
Some people, I've heard, will put spaces in file names, hard to believe
though that sounds.

I propose this heavy handed but simple format for the @data node:

# pairs of lines in this text indicate search and replace targets for
# cleaning the recent files list.  Each pair of lines should start with
# either "REPLACE:" (first line) and "WITH:" (second line), or "REGEX:"
# (first line) and "TO:" (second line).  For example:
#
#  REPLACE: .gnome-desktop
#     WITH: My Desktop
#  REPLACE: /mnt/usr1/
#     WITH: /
#    REGEX: C:\\temp\\(*.\.leo)
#       TO: D:\\Users\\Me\\leoFiles\\\1
#
# specifies three replacements, one of which will be done using regular
# expressions - the only significant space in the above is in 
# "My Desktop"

The regex example is hideous, but that's normal for regex, I'm not sure
if it's correct, I'd test it.

I'm not sure if this kind of markup in body text in @settings is
leoine, but can't think of a better way off hand - I'll move in this
direction and change it if someone suggests something better.

Cheers -Terry

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to