zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: zle_line_init_functions (Re: accept-line-and-down-history and push-input)
Date: Tue, 26 Oct 2010 22:01:02 -0700	[thread overview]
Message-ID: <101026220102.ZM29774@torch.brasslantern.com> (raw)
In-Reply-To: <20101026161947.19279c58@pwslap01u.europe.root.pri>

[>workers]

On Oct 26,  4:19pm, Peter Stephenson wrote:
} Subject: Re: accept-line-and-down-history and push-input
}
} On Tue, 26 Oct 2010 07:55:44 -0700
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > (I'm beginning to think that zle-line-init should be a builtin widget
} > that calls an array of hook functions, ala precmd.)
} 
} I've been thinking along those lines, except that the array of hook
} functions would be the alternative to the widget, as with chpwd and
} friends

I don't much like the idea of having an array of *widget names*.
What's the benefit of invoking a series of widgets, rather than
having one widget that calls a series of functions?  The context is
the same either way (i.e., "zle" with no args returns zero status
and you can access all the line editor variables) and all the work
of creating and destroying thingys can be avoided.

} i.e. you could still define zle-line-init if you wanted a
} simple life but zle_line_init_functions could contain an additional set
} of widgets.

Wouldn't you still get that effect if zle-line-init was a builtin
widget that you could override with your own via zle -N ?

} Not sure how to keep the name of the array entirely within zle

I don't know what you're reaching for, there.  The array has to be
outside of zle at some point or you can't assign anything to it ...?

zle-line-init() {
  local f
  for f in $zle_line_init_functions
  do
    if [[ $PWS_users_15493 ]]
    then zle "$f"
    elif [[ $my_suggestion ]]
    then "$f" || break
    fi
  done
}


       reply	other threads:[~2010-10-27  5:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTin4qeNKcBt_TDzY2xt-XJ6aHVH257FOa6iriPSm@mail.gmail.com>
     [not found] ` <101026075546.ZM28500@torch.brasslantern.com>
     [not found]   ` <20101026161947.19279c58@pwslap01u.europe.root.pri>
2010-10-27  5:01     ` Bart Schaefer [this message]
2010-10-27  9:22       ` Peter Stephenson
2010-10-27 15:40         ` Bart Schaefer
2010-10-31 21:54           ` Peter Stephenson
2010-11-01  7:01             ` Bart Schaefer

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=101026220102.ZM29774@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).