zsh-users
 help / color / mirror / code / Atom feed
* Re: Updating the Xterm title with every execution?
@ 1999-03-31 11:35 Sven Wischnowsky
  1999-03-31 23:12 ` Greg Badros
  0 siblings, 1 reply; 14+ messages in thread
From: Sven Wischnowsky @ 1999-03-31 11:35 UTC (permalink / raw)
  To: zsh-users


Greg Badros wrote:

> "Bart Schaefer" <schaefer@brasslantern.com> writes:
> 
> > } Please correct me if I'm wrong, but I don't think 'preexec' exists in
> > } Zsh 3.0.5
> > 
> > It's in 3.0.5-ext-2, available from ftp.brasslantern.com:/pub/zsh/, which
> > will be the basis of 3.0.6 appearing (I hope, if I get the archive scripts
> > learned soon) sometime this month.
> 
> That's great-- any chance of getting my colorized completion patch in
> there?  It's plenty clean, has it's own option, and is pretty small --
> it could be a compile-time switch if you're *really* concerned about
> memory footprint (zsh 3.0.x still does not have any dynamic loading
> capabilities, does it?).  Since 3.0.6 is the end of the road for 3.0,
> the maintenance headache of another compile-time flag is not an issue.

The problem I have with this is that it uses an option. In 3.1. I
would like to make the code in `zle_tricky.c' use a pointer variable to
call `listmatches()' to allow stuff like this to be put in a different 
module that may be loaded on top of `compctl'. We can then also add a
different colourisation module which is a bit more zsh-ish. Probably
using a assoc array to map patterns/descriptions to strings like
`%B%n%b' where the `%n' gets replaced by the string (of course, the
best way would be to allow different maps for different completions,
but we could already use group names for that). Or something like
that. This should be easy to use because I think that sometime we will 
be able to make modules autoloaded on parameter names (haven't really
looked for that in the code yet, but every parameter name lookup goes
through the paramtab-hashtable functions, right?).

Of course, if we add a way to allow modules to define options and make 
modules autoloaded on them, nothing could be said against using a option
for it (well, something could be said against it: it's superfluous --
even in your patch making it use only `ZLS_COLOR' (or turning it into
an array and giving it a better name) and testing if that is set would
be enough).

Anyway, I don't think that I'll ever use a feature like this and so
would be against putting it into the zsh core itself. But it's not my
duty to decide this...

Bye
 Sven

P.S.: Module-defined options may also be an argument for moving to a
      assoc array based option system.

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Updating the Xterm title with every execution?
@ 1999-04-12  8:08 Sven Wischnowsky
  0 siblings, 0 replies; 14+ messages in thread
From: Sven Wischnowsky @ 1999-04-12  8:08 UTC (permalink / raw)
  To: zsh-users


Greg Badros wrote:

> Though why can't
> executing a setopt load a module (as invoking a function loads that
> function)?

The problem is that the option code currently uses an array with one
entry per option, making testing for set/unset options nicely small
and fast. Enhancing that is not trivial.

Side note: once we have modules autoloadable on parameters, this might 
be another argument for mocing towards a associative-array based
option system.

> Similarly, I've wanted this for completion controls, too --
> scanning all my completion stuff takes forever at startup-- it'd be nice 
> to have them autoloaded when I first try to complete (ignorance warning: 
> I've not been following the 3.1.x discussion on completion stuff so
> maybe people are working on this or something similar).

Well, the new completion system (more precisely: the example
implementation of the new completion system) uses autoloaded functions.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Updating the Xterm title with every execution?
@ 1999-04-01  7:19 Sven Wischnowsky
  1999-04-02  1:57 ` Greg Badros
  0 siblings, 1 reply; 14+ messages in thread
From: Sven Wischnowsky @ 1999-04-01  7:19 UTC (permalink / raw)
  To: zsh-users


Greg Badros wrote:

> Why is an option a problem?  It's cleaner to use an option then to have
> it be only a compile-time flag.  There are plenty of other options
> affecting completion (listambiguous, listtypes, menucomplete, etc.).

Obviously I wasn't clear enough... I have no objections to put that
into 3.0.6. But I wouldn't like to see an option to be used for it
because people would then expect this option to be in 3.1x, too. And
since I wouldn't like to see a feature as specific as this to be in
the standard completion module and because modules currently can't
define their own options, we would have to put it into the core.
With the modules in 3.1. it would be easy to put enhancements like
this one into separate modules, which, as I hope you agree, is much
cleaner.
As for the different implementation: I didn't suggest *replacing* your 
stuff with something different. At least I *wanted* to suggest that by 
moving it into a separate module in 3.1. we could give the user a way
to decide if he wants to use your implementation (which would be one
module), or another implementation (which would give a bit more
control to colourise non-filenames and more and would be in another
separate module). The user would chose what he wants just by including 
one (or none at all) of these modules.

> > for it (well, something could be said against it: it's superfluous --
> > even in your patch making it use only `ZLS_COLOR' (or turning it into
> > an array and giving it a better name) and testing if that is set would
> > be enough).
> 
> I do not know what you mean use only "ZLS_COLOR".  Why is that better
> than setopt listcolors?

I hope this is clear now -- backward-compatibility. And you don't need 
the option if you make your patch alwasy use the parameter
`ZLS_COLOUR' (or whatever) and turn on colours only if that parameter
is set. The name should be seldom enough to not interfere with any
existing parameter name.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Updating the Xterm title with every execution?
@ 1999-03-25 20:15 Ryan Tennant
  1999-03-25 21:29 ` Larry P . Schrof
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Ryan Tennant @ 1999-03-25 20:15 UTC (permalink / raw)
  To: 'zsh-users@sunsite.auc.dk'

Hello.  I am trying to update the Xterm title every time I execute an
application, script, etc.  To do this, it would seem logical that I have to
process the commands I enter at the command line before executing them.  Zsh
seems to offer some preprocessing functionality, but not so much that I can
ask it to preprocess command line information and then execute an arbitrary
command.

A script to display what I'm interested in doing is below.  

script name: hi
#!/bin/zsh
echo '\033]; '$*'\007'				# Displays command in xterm
title after script name (i.e hi ls -la, would display ls -la)
trap "trap '' 2"  2					
$*						# Executes commands I enter
after the script name
trap ""  2
echo '\033]; '${HOSTNAME}: IDLE'\007'		# Displays idle xterm title


i want to do line 1 after i hit enter before execution of $*.  I want to
reset the title bar in the event that I hit ctrl-c (traps).  I want to do
line 6 after execution of the commands.

obviously the functionality of this script is limited in the fact that it
doesnt parse beyond "|"s or other delimeters.

essentially, i'm looking for someone more gifted than myself to aid in my
quest.

thanks.

ryan tennant


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1999-04-12  8:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-31 11:35 Updating the Xterm title with every execution? Sven Wischnowsky
1999-03-31 23:12 ` Greg Badros
  -- strict thread matches above, loose matches on Subject: below --
1999-04-12  8:08 Sven Wischnowsky
1999-04-01  7:19 Sven Wischnowsky
1999-04-02  1:57 ` Greg Badros
1999-03-25 20:15 Ryan Tennant
1999-03-25 21:29 ` Larry P . Schrof
1999-03-25 21:40 ` Matthew Lovell
1999-03-25 21:55 ` Greg Badros
1999-03-25 22:09   ` Larry P . Schrof
1999-03-25 22:47     ` Greg Badros
1999-03-30  4:25       ` Bart Schaefer
1999-03-30  7:56         ` Andrej Borsenkow
1999-03-30 10:27         ` Greg Badros

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).