all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to override key binding for groovy-mode?
@ 2015-09-08 18:13 KARR, DAVID
  0 siblings, 0 replies; 3+ messages in thread
From: KARR, DAVID @ 2015-09-08 18:13 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

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?

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 3025 bytes --]

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

* RE: How to override key binding for groovy-mode?
       [not found] <<B8D164BED956C5439875951895CB4B223BEA2626@CAFRFD1MSGUSRIA.ITServices.sbc.com>
@ 2015-09-08 18:16 ` Drew Adams
  2015-09-08 18:32   ` KARR, DAVID
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2015-09-08 18:16 UTC (permalink / raw)
  To: KARR, DAVID, help-gnu-emacs

> 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



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

* RE: How to override key binding for groovy-mode?
  2015-09-08 18:16 ` Drew Adams
@ 2015-09-08 18:32   ` KARR, DAVID
  0 siblings, 0 replies; 3+ messages in thread
From: KARR, DAVID @ 2015-09-08 18:32 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

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



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

end of thread, other threads:[~2015-09-08 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-08 18:13 How to override key binding for groovy-mode? KARR, DAVID
     [not found] <<B8D164BED956C5439875951895CB4B223BEA2626@CAFRFD1MSGUSRIA.ITServices.sbc.com>
2015-09-08 18:16 ` Drew Adams
2015-09-08 18:32   ` KARR, DAVID

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.