[Top][All Lists]

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

Re: m4 -e

From: Gary V . Vaughan
Subject: Re: m4 -e
Date: Sat, 11 Aug 2001 02:17:08 +0100

On Friday 10 August 2001 11:46 am, Akim Demaille wrote:
> >>>>> "Gary" == Gary V Vaughan <address@hidden> writes:
> >> 2. keep it as is but add a negative -e option
> Gary> I think this is better...

I'll fix this presently.

> >> Also, how about making it possible to use readline?  This could
> >> make 3. easier (when not linked with m4, simply exit?).
> Gary> I would like to do this... but only as a module.  M4 is rarely
> Gary> used interactively (compared to the number of people who
> Gary> generate configure scripts), so I don;t think readline belongs
> Gary> in the core.  There is probably a small amount of work needed in
> Gary> the main loop to provide the hooks for a readline interface
> Gary> module to connect to.
> Hm...  For my personal education, I'd be happy to give this a try, but
> you certainly have more experience :)

At a glance, I think m4_next_token needs to access a hook function to collect 
and cache input, and then consume chars from the cache rather direct from the 
input stream.  There will probably be some jiggery pokery to manage the cache 
correctly in respect of files pushed on the input stack, and when rescanning.

To expose the input caching mechanism nicely, I think that we should add some 
API calls to libm4 that a module can either call them from a builtin or in 
their init function.  There must be all sorts of other cool things that this 
could be used for that we haven't thought of yet.  In fact, it would be neat 
to bear in mind that a nice future extension would be to have a facility to 
stack functions on the input and output streams -- in the first instance to 
connect unusual sinks and sources to m4, and additionally to be able to 
encode and decode in different ways (reading gzipped sources directly?) 
between the sink and/or source and the m4 interpreter proper... perhaps I 
should stub out an API so that we don't need to change things unnecessarily 
when there is time to do the implementation?

> >> Also, I like when options are changeable by the script itself, so
> >> maybe we could have a builtin to adjust this?  Something a la
> >> debugmode/debugfile.
> Gary> To toggle interactive mode programmatically?  Sure, why not.
> Well, I'm not ferociously for this.  I'm ferociously in favor of a
> means for me to stop M4 when it goes wild, but if any of the other
> possibility is provided, I'm fine.

Perhaps I misunderstood your original intention?  What was it that you wanted 
the debugmode builtin to toggle?

> [036] - m4sh 0.1
>   by Anonymous
>   Thursday, December 9th 2001 10:42
> [snip]
> URL: http://freshmeat.net/projects/m4sh/

Okay.  You got me.  I clicked the link... :-D :-D

  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org)
  ( '/  Research Scientist  http://www.oranda.demon.co.uk       ,_())____
  / )=  GNU Hacker          http://www.gnu.org/software/libtool  \'      `&
`(_~)_  Tech' Author        http://sources.redhat.com/autobook   =`---d__/

reply via email to

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