Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A peep into the future.



	Forgive me as I don't subscribe to zsh-workers.  The mail link
	we have is an expensive one and one can't afford to get the
	useful but numerous patches.

>>>>> "Zefram" == Zefram  <hclhprnd!dcs.warwick.ac.uk!A.Main> writes:

    Zefram> Not really likely for 3.0.  Maybe in 4.0 there could be an
    Zefram> execcmd function that gets called before each command is
    Zefram> executed.

	No really, it's not that difficult (please correct me if I am
	wrong).  Suppose 10 regexps are defined which are to be
	replaced in the command line.  Make a linked list.  Try to
	match each one cyclically until none matches.

	This could be slow.  A trivial optimization is as follows:
		(this saves a cycle on each command)

	Make a big regexp with all the small regexps OR'ed.  Compile
	it whenever a new regexp alias is defined.  Whenever there is
	a match, start the cycle.  At the end of the cycle, match the
	big regexp again and so on.
	
	There could be other optimizations possible.

    Zefram> We're pretty close to that, though not using the usual
    Zefram> regexp syntax.  It would be nice to add an option to use
    Zefram> ksh's glob characters instead of zsh's.

	Back referencing?

	Suppose I have 10 .c files and 20 .f files in a directory
	(funny), and I want to do something like: 

	(future regexp syntax)

		cp (.*)\.c {$1}\.o  # {} is the usual zsh expn

	(copy the .c files and the associated .o files)

    >> 3. Programmable key bindings

	What could possibly be done at this stage is just enabling a
	key to be bound to a sequence.  (e.g. for paren matching,
	execute ( (mark)+(vi-match-bracket)+(exchange-point-and-mark) )

	No hairy functions etc.

    Zefram> That's rather pointless.  If an option has no effect due
    Zefram> to the state of another option, I'd rather it stayed the
    Zefram> way it is, rather than get unset.

	Mostly, yes, it is pointless.  But I thought the main reason
	why many newbie's don't like fiddling with zsh is that they
	can't understand the option settings fast enough to make zsh
	convenient for them.

	Here in this institute, the whole of the CS deptt is using
	zsh, without realizing its power.  I gave them some nice
	startup files and they never even looked up the man page.
	
        The feature could be a help in the sense that it breaks down
	the options into precise categories.

    Zefram> linked and stashed away in /sbin.  Virtual filesystems, of
    Zefram> course, should be done in the kernel (for example, userfs
    Zefram> under Linux).

	Most users wouldn't like to fiddle with the kernel (unless it
	is the Hurd, since in that case the fs is user level), and
	many wouldn't like to wait for the OS vendors to do it.


-- 
With Warm Regards,
Harmanjit Singh, Indian Institute of Technology, New Delhi.




Messages sorted by: Reverse Date, Date, Thread, Author