lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "mailto:" + EXTERN wishlist [lynx-dev]


From: David Combs
Subject: Re: "mailto:" + EXTERN wishlist [lynx-dev]
Date: Sun, 13 Jun 1999 23:33:16 -0700

This is probably not directly related to what you've been
specifically talking about, but it IS related to some
neat trickery re options via prefix and suffix strings
that you can prepend and append to.

A friend once gave me this idea, re filename-strings,
via adding extra syntax WITHIN the string.

You of assume some char or esc-seq that isn't ever going
to be used in a file name.    :-)

Say you have the string "foo.dat", the name of a file.

Now invent some options you might like to be attached
to that name, perhape a directory-name (not originally
specified), a debug-option that says "shout-out whenever
you do x, y, or z with this file", etc, any of a hundred
things you can think of you might like to attach as "things to do"
when your (huge) program deals with that file (or file-name).

Lets choose back-slash for escape-char -- no, thata's no good,
the pc-M$ people use that.  How about back-quote, "`", for now,
anyway.

So if the user wants debug shoutouts for THIS file,
he enters it's name as "foo.bar `debug=(x,y) `bletchPoint=3",
and then when your code scans that, it sets up the debug-stuff
and the bletchpoint stuff, in the struct or wherever, where
you can see it easily.

(The idea here is to make the user-interaction simpler, with
fewer questions asked, eg "do you want bletchpoint; if so, enter
the value for it:", etc.  This way he enters ONE string, also
easier to set up for a batch-job/script.)

----- what about setting DEFAULTS?

Suppose your DEFAULT for bletchpoint is 7.  How to handle that?

Simple: you keep around a string constant "`bletchpoint=3 ",
along with your OTHER defaults, eg "debug=0 " (note the trailing space).

NOW, when he types in his "annotated" string, you APPEND
that to (a copy of) all your DEFAULT strings, catted together.

(Another use for those default-strings catted together: to tell
the user what the defaults ARE, with NO work from you.)

Then, you process this WIDE string from LEFT TO RIGHT, the
final "redefinition" of something being the "winner".

(Since defaults are prepended, and his options to their right).

Cool, no?

I think so, anyway.

Any use for this trick in Lynx's user-interaction, options,
etc?

David


reply via email to

[Prev in Thread] Current Thread [Next in Thread]