help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to override key binding for groovy-mode?


From: KARR, DAVID
Subject: RE: How to override key binding for groovy-mode?
Date: Tue, 8 Sep 2015 18:32:17 +0000

> -----Original Message-----
> From: Drew Adams [mailto:drew.adams@oracle.com]
> Sent: Tuesday, September 08, 2015 11:17 AM
> To: KARR, DAVID; help-gnu-emacs@gnu.org
> Subject: RE: How to override key binding for groovy-mode?
> 
> > What is the general procedure for overriding a key binding set by
> a package?
> >
> > I have a global key binding for a function I wrote (using
> "global-set-key").
> > I recently started using "groovy-mode", but I noticed that this
> mode is
> > using my key to bind to something else.
> >
> > What should I add in my "groovy-mode-hook" to make it use my
> global binding
> > instead?  Or is there a "more correct" way to do this?
> 
> Look for a `groovy-mode-map', i.e., a keymap that groovy-mode binds
> its
> keys in.  It might have a different name.  Then use `define-key' to
> remove that binding (bind to nil to remove a binding).  You can
> also
> use `define-key' to bind the groovy command to some other key in
> that map.
> 
> (define-key groovy-mode-map THE-KEY nil) ; Remove binding
> (define-key groovy-mode-map OTHER-KEY THE-GROOVY-COMMAND) ; Move to
> a diff key

Thanks, putting the first one into my mode hook disabled the Groovy binding.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]