Gnus development mailing list
 help / color / mirror / Atom feed
From: "Ted Zlatanov" <tzz@lifelogs.com>
Subject: Re: Wizards!  I mean, Assistants!
Date: 17 May 2004 14:52:21 -0400	[thread overview]
Message-ID: <4nzn86honu.fsf@lifelogs.com> (raw)
In-Reply-To: <m34qqfyog1.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Mon, 17 May 2004 19:05:02 +0200")

On Mon, 17 May 2004, larsi@gnus.org wrote:

> "Ted Zlatanov" <tzz@lifelogs.com> writes:
> 
>> There should be distinct sections for expected variables,
>> initialization, validation, resetting, and undo (going back).  They
>> won't always be used, but the ability should be there.  This is how I
>> would do it (to be parsed by ELisp):
> 
> But I don't want to repeat stuff more than I have to, so it should
> use sensible defaults as often as possible.

Sure, so where I had reset and undo calling 'redo-intialize, that can
be the default.  It's a sensible default anyway.

>> (assistant-pages
>>  (assistant 'nntp-server "NNTP server setup" 1 ; assistant name, title, page#
>>  '((produces '(server string) '(port integer))
>>
>>   (initialize
>>    server (gnus-getenv-nntpserver)
>>    port 119)
>>
>>   (reset 'redo-initialize)
>>
>>   (undo 'redo-initialize)
>>
>>   (validate 
>>    (server port) 'user-override [open-network-stream code goes here])
>>
>>  So you want to read news.  The news server to use is `server'; port
>>  number `port'.
>> )))
> 
> I think one of the reasons that HTML is successful is that it's 1)
> text-like, and 2) sloppy.  Matching parentheses around blocks of free
> text (which may contain more parentheses) requires more rigor.  So I
> think I'd go with something <tag>-like, but with Lisp sections.  I
> think.

I'm OK with any text templating format, as long as it can accomodate
the fields we need.  I'm actually partial to the Template Toolkit for
Perl, but that's unlikely to be of interest to ELisp developers :)

For instance, above you have `server' - in the text renderer that
would be a pre-filled text field, not just the *contents* of the
server variable.  In other words, we're writing the content and the
interface at the same time.  I hope that came across.

>> The (produces) section is crucial.  It lets us specify the exact thing
>> this assistant will create, and further assistant pages can use these
>> variables also.
> 
> Yes...  but in this example they mostly just repeat what's in the
> text, so that section could default to those.

I think it's important to specify the type of variables before they
are used.  In other words, I don't want `server' to auto-default to a
string.  The template should either complain on unknown variables, or
just print `TEXT' when it's not a known variable.  There's several
reasons for this:

- we know what variables to expect before any template work is done

- text like `this' can be used inside the template (if we allow)

- validate can have default checks, e.g. that the port is really an
  integer, on top of the programmer-specified checks

- it's easier to interface with this templating system

> Hm.  I think I like your version better.  :-)  But I think the
> `produces' and `initialize' sections can be mushed together.

You're right.  Something like this maybe:

  (initialize
   server :string (gnus-getenv-nntpserver)
   port :integer 119)

Anyhow, if people want to give ideas for assistant sequences, I can
try to code them into this pseudo-language and see if it has
deficiencies based on real usage.  This will also give us an idea of
the things that users want to be assistant-enabled in Gnus.

Ted



  reply	other threads:[~2004-05-17 18:52 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-16 13:48 Lars Magne Ingebrigtsen
2004-05-16 15:20 ` Simon Josefsson
2004-05-16 15:24   ` Lars Magne Ingebrigtsen
2004-05-16 17:59     ` Frank Schmitt
2004-05-17 15:35     ` Per Abrahamsen
2004-05-17 20:36     ` Adam Sjøgren
2004-05-18 12:56       ` Per Abrahamsen
2004-05-18 14:20         ` Lars Magne Ingebrigtsen
2004-05-18 14:55           ` Per Abrahamsen
2004-05-18 15:15             ` Lars Magne Ingebrigtsen
2004-05-18 16:11               ` Per Abrahamsen
2004-05-19  0:14         ` Jesper Harder
2004-05-16 16:19   ` Jonas Steverud
2004-05-17  3:15     ` Paul Jarc
2004-05-17  7:34       ` Jonas Steverud
2004-05-16 22:13   ` Miles Bader
2004-05-16 22:18   ` Miles Bader
2004-05-16 23:17     ` Lars Magne Ingebrigtsen
2004-05-17  2:01       ` Steven E. Harris
2004-05-17  8:39   ` Ian Fitchet
2004-05-17 13:43     ` Lars Magne Ingebrigtsen
2004-05-17 13:55       ` Lloyd Zusman
2004-05-21 20:33       ` luis fernandes
2004-05-22 17:18         ` Lars Magne Ingebrigtsen
2004-05-22 18:46           ` Lars Magne Ingebrigtsen
2004-05-22 21:13             ` Lars Magne Ingebrigtsen
2004-05-22 21:19               ` Miles Bader
2004-05-22 21:33                 ` Lars Magne Ingebrigtsen
2004-05-22 22:01                   ` Miles Bader
2004-05-22 22:07                     ` Lars Magne Ingebrigtsen
2004-05-22 22:15                       ` Miles Bader
2004-05-22 22:29                         ` Lars Magne Ingebrigtsen
2004-05-22 22:32                           ` Lars Magne Ingebrigtsen
2004-05-23 16:38                             ` Per Abrahamsen
2004-05-23 20:12                               ` Lars Magne Ingebrigtsen
2004-05-23 21:43                                 ` Lars Magne Ingebrigtsen
2004-05-23 22:19                                   ` Lars Magne Ingebrigtsen
2004-05-24 10:38                                 ` Per Abrahamsen
2004-05-23 21:14         ` Steinar Bang
     [not found]   ` <87pt94xpbv.fsf@telia.com>
2004-05-19  9:56     ` Simon Josefsson
2004-05-17 14:51 ` Ted Zlatanov
2004-05-17 17:05   ` Lars Magne Ingebrigtsen
2004-05-17 18:52     ` Ted Zlatanov [this message]
2004-05-17 19:36       ` Lars Magne Ingebrigtsen
2004-05-18  8:48         ` Kai Grossjohann
2004-05-18 15:25           ` Ted Zlatanov
2004-05-18 19:36         ` new user assistant (was: Wizards! I mean, Assistants!) Ted Zlatanov
2004-05-18 20:44           ` new user assistant Lars Magne Ingebrigtsen
2004-05-19 14:55             ` Ted Zlatanov
2004-05-19 15:21               ` Lars Magne Ingebrigtsen
2004-05-20 18:04           ` Gnus mail reading assistant (was: new user assistant) Ted Zlatanov
2004-05-22 23:41             ` Gnus mail reading assistant Lars Magne Ingebrigtsen
2004-05-23  0:19           ` new user assistant Dale Hagglund
2004-05-24 13:52             ` Ted Zlatanov
2004-05-25 10:13               ` Per Abrahamsen
2004-05-25 13:15                 ` Derrell.Lipman
2004-05-25 18:45                   ` Ted Zlatanov
2004-05-25 19:09                     ` Paul Jarc
2004-05-26 18:49                       ` Per Abrahamsen
2004-05-26 18:57                         ` Paul Jarc
2004-05-26 18:46                     ` Per Abrahamsen
2004-05-17 15:45 ` Wizards! I mean, Assistants! Per Abrahamsen
2004-05-17 16:58   ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4nzn86honu.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).