zsh-workers
 help / color / mirror / code / Atom feed
From: "Nikolai Weibull" <now@bitwi.se>
To: "Peter Stephenson" <pws@csr.com>
Cc: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: Re: Hooks
Date: Tue, 7 Nov 2006 16:11:58 +0100	[thread overview]
Message-ID: <dbfc82860611070711u322a6948m675ef9a38d097717@mail.gmail.com> (raw)
In-Reply-To: <20061107104916.d01e2fa5.pws@csr.com>

On 11/7/06, Peter Stephenson <pws@csr.com> wrote:
> Stephane Chazelas <Stephane_Chazelas@yahoo.fr> wrote:
> > functions[preexec]+='
> >   get_saved_dirstack'
> > functions[chpwd]+='
> >   save_dirstack'
>
> This is even further away from the original subject, but I've often felt
> that functions like preexec and chpwd are getting a bit overloaded and
> are unnecessarily hard to maintain automatically.  It would be easy to
> add an array which could contain names of functions to be executed,
> similar to Emacs hooks.  Of course you can implement such an array
> within the existing functions, but the advantage of having a fixed
> mechanism is that it's easy to add to and be sure it's working without
> getting in anyone else's way.  You still have namespace problems, of
> course, but if you have functions called get_saved_dirstack and
> save_dirstack that clash your real problem is almost certainly more
> basic than naming.
>
> However, I'm not sure if it's really needed.

Yes, please do add.  It's a real, em...lady of the night, to try to
chain all these functions properly (i.e., checking if preexec is
defined and then try to get its definition or however I did it when I
did it last time (I did this for a prompt that was depended on the
value of $WIDTH, so I read it on each preexec, but I also had another
function running at preexec, so I had to get that other functions body
and eval it from the prompt preexec instead.).

Thanks!

  nikolai


  reply	other threads:[~2006-11-07 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5db995410611060845y53f673e6je029a9c60659f116@mail.gmail.com>
     [not found] ` <20061106174053.GA4323@sc>
     [not found]   ` <5db995410611061314l26e089b8wb214da46064c8235@mail.gmail.com>
     [not found]     ` <20061106215051.GB4323@sc>
     [not found]       ` <Pine.OSX.4.61.0611061617370.1112@vanunu.ucsc.edu>
     [not found]         ` <20061107081800.GA4420@sc>
2006-11-07 10:49           ` Hooks Peter Stephenson
2006-11-07 15:11             ` Nikolai Weibull [this message]
2006-11-07 17:14               ` Hooks Bart Schaefer
2006-11-07 18:46                 ` Hooks Peter Stephenson
2006-11-07 18:21               ` Hooks Peter Stephenson

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=dbfc82860611070711u322a6948m675ef9a38d097717@mail.gmail.com \
    --to=now@bitwi.se \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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.
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).