zsh-workers
 help / color / mirror / code / Atom feed
* zle-line-pre-redraw_hooks
@ 2016-01-15  6:26 Daniel Shahaf
  2016-01-15 19:14 ` zle-line-pre-redraw_hooks Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Shahaf @ 2016-01-15  6:26 UTC (permalink / raw)
  To: zsh-workers

If a user has two different plugins that each want to be invoked from
a pre-redraw hook, right now there is no easy way to achieve that.

Would it make sense to provide a way to register multiple
zle-line-pre-redraw hooks?  Similar to $chpwd_functions?

Concrete suggestion: ship a default implementation of zle-line-pre-redraw
that invokes all functions in $zle_line_pre_redraw_hooks, for example,
by using callhookfunc().¹

Makes sense?

Cheers,

Daniel

¹ It should probably skip the block starting in utils.c:1473 to avoid
having both z-l-p-redraw and z_l_p_redraw, former a widget and latter
a function that widget calls: the names would be too similar.


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

* Re: zle-line-pre-redraw_hooks
  2016-01-15  6:26 zle-line-pre-redraw_hooks Daniel Shahaf
@ 2016-01-15 19:14 ` Bart Schaefer
  2016-01-18  2:25   ` zle-line-pre-redraw_hooks Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2016-01-15 19:14 UTC (permalink / raw)
  To: zsh-workers

On Jan 15,  6:26am, Daniel Shahaf wrote:
}
} Would it make sense to provide a way to register multiple
} zle-line-pre-redraw hooks?  Similar to $chpwd_functions?

We discussed this a while back in the context of other hook widgets
such as zle-line-init and ended up rejecting the idea ... or, IIRC
more specifically we rejected the idea of having add-zsh-hook know
about both functions and widgets.

Whatever we might do has to work generically for hook widgets, not
just for some specific one.


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

* Re: zle-line-pre-redraw_hooks
  2016-01-15 19:14 ` zle-line-pre-redraw_hooks Bart Schaefer
@ 2016-01-18  2:25   ` Daniel Shahaf
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Shahaf @ 2016-01-18  2:25 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer wrote on Fri, Jan 15, 2016 at 11:14:06 -0800:
> On Jan 15,  6:26am, Daniel Shahaf wrote:
> }
> } Would it make sense to provide a way to register multiple
> } zle-line-pre-redraw hooks?  Similar to $chpwd_functions?
> 
> We discussed this a while back in the context of other hook widgets
> such as zle-line-init and ended up rejecting the idea ... or, IIRC
> more specifically we rejected the idea of having add-zsh-hook know
> about both functions and widgets.
> 

Agreed about not doing that in add-zsh-hook.

> Whatever we might do has to work generically for hook widgets, not
> just for some specific one.
> 

Okay.  I'll revisit this when there's a specific need to it (not merely
a speculative need).

Cheers,

Daniel


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

end of thread, other threads:[~2016-01-18  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15  6:26 zle-line-pre-redraw_hooks Daniel Shahaf
2016-01-15 19:14 ` zle-line-pre-redraw_hooks Bart Schaefer
2016-01-18  2:25   ` zle-line-pre-redraw_hooks Daniel Shahaf

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