zsh-users
 help / color / mirror / code / Atom feed
* How to execute a command upon loading a module
@ 2003-10-09 15:09 DervishD
  2003-10-09 15:44 ` Peter Stephenson
  2003-10-09 16:41 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: DervishD @ 2003-10-09 15:09 UTC (permalink / raw)
  To: Zsh Users

    Hi all :)

    I want to modify the listscroll and menuselect keymaps when
zsh/complist (this is the module which defines it, isn't it?, or
maybe zsh/compctl?) is loaded. By now the only way of doing it is to
load the module by hand and afterwards modify the keybindings, in my
/etc/zshrc. I load the zsh/compctl module, because I've defined a few
dependencies for the completion modules, so loading zsh/compctl, by
hand or by pressing 'TAB', for example, automatically loads the rest
of modules. Is because of this that I'm not sure about which module
defines which keymap O:))

    Since the keymaps doesn't exist until the module is loaded, I
cannot modify them to my likings :(( Can I execute shell code just
after a module is loaded? Can I *create* those keymaps, modify them
and expect the corresponding modules doesn't modify them again?

    Thanks in advance

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


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

* Re: How to execute a command upon loading a module
  2003-10-09 15:09 How to execute a command upon loading a module DervishD
@ 2003-10-09 15:44 ` Peter Stephenson
  2003-10-09 18:25   ` DervishD
  2003-10-09 16:41 ` Bart Schaefer
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2003-10-09 15:44 UTC (permalink / raw)
  To: Zsh Users

DervishD wrote:
>     Since the keymaps doesn't exist until the module is loaded, I
> cannot modify them to my likings :(( Can I execute shell code just
> after a module is loaded? Can I *create* those keymaps, modify them
> and expect the corresponding modules doesn't modify them again?

Simply load the modules with zmodload first.  The completion code only
ensures that they are loaded, it doesn't insist on them being initially
unloaded.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: How to execute a command upon loading a module
  2003-10-09 15:09 How to execute a command upon loading a module DervishD
  2003-10-09 15:44 ` Peter Stephenson
@ 2003-10-09 16:41 ` Bart Schaefer
  2003-10-09 18:26   ` DervishD
  1 sibling, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2003-10-09 16:41 UTC (permalink / raw)
  To: Zsh Users

On Oct 9,  5:09pm, DervishD wrote:
} 
}     I want to modify the listscroll and menuselect keymaps when
} zsh/complist (this is the module which defines it, isn't it?

Yes.

}     Since the keymaps doesn't exist until the module is loaded, I
} cannot modify them to my likings :(( Can I execute shell code just
} after a module is loaded?

No, there is no emacs-like eval-after-load hook.

} Can I *create* those keymaps, modify them and expect the corresponding
} modules doesn't modify them again?

No, the module forcibly re-creates and initializes the keymap, discarding
any existing keymap by that name -- and unloading the module deletes the
keymap.  It'd be nice if complist were a little more careful about this,
i.e., check whether the keymap exists and selectively update it, but no.

The only thing you can do is explicitly load the module and then change
the bindings.


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

* Re: How to execute a command upon loading a module
  2003-10-09 15:44 ` Peter Stephenson
@ 2003-10-09 18:25   ` DervishD
  0 siblings, 0 replies; 5+ messages in thread
From: DervishD @ 2003-10-09 18:25 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh Users

    Hi Peter :)

 * Peter Stephenson <pws@csr.com> dixit:
> > after a module is loaded? Can I *create* those keymaps, modify them
> > and expect the corresponding modules doesn't modify them again?
> Simply load the modules with zmodload first.

    That's exactly what I'm doing now, I just wondered if a better
way was possible ;)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


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

* Re: How to execute a command upon loading a module
  2003-10-09 16:41 ` Bart Schaefer
@ 2003-10-09 18:26   ` DervishD
  0 siblings, 0 replies; 5+ messages in thread
From: DervishD @ 2003-10-09 18:26 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh Users

    Hi Bart :)

 * Bart Schaefer <schaefer@brasslantern.com> dixit:
> }     Since the keymaps doesn't exist until the module is loaded, I
> } cannot modify them to my likings :(( Can I execute shell code just
> } after a module is loaded?
> No, there is no emacs-like eval-after-load hook.

    Well, I don't use emacs, but I can see what you mean. I thought
that modules may have an undocumented hook feature.
 
> } Can I *create* those keymaps, modify them and expect the corresponding
> } modules doesn't modify them again?
> No, the module forcibly re-creates and initializes the keymap, discarding
> any existing keymap by that name -- and unloading the module deletes the
> keymap.  It'd be nice if complist were a little more careful about this,
> i.e., check whether the keymap exists and selectively update it, but no.

    Well, then I'll stick to loading the module explicitly. It
doesn't do no harm, really, I was just wondering if a better or
neater solution existed.

    Thanks :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


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

end of thread, other threads:[~2003-10-09 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-09 15:09 How to execute a command upon loading a module DervishD
2003-10-09 15:44 ` Peter Stephenson
2003-10-09 18:25   ` DervishD
2003-10-09 16:41 ` Bart Schaefer
2003-10-09 18:26   ` DervishD

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