how to unbind keyboard shortcut

173 views
Skip to first unread message

boskom

unread,
Oct 15, 2009, 8:50:27 AM10/15/09
to ErgoEmacs
I am constantly annoyed when I unintentionally press C-p (print
buffer) and C-n (new empty buffer) as I have reported

http://code.google.com/p/ergoemacs/issues/detail?id=60

Temporary (quick and dirty) solution to these problems would be
unbinding mentioned keys, which I tried but to no avail. Here is what
I added at the bottom of my .emacs.d/init.el

(global-unset-key (kbd "C-p"))

As I mentioned this has no effect. What am I doing wrong?

Regards,

Xah Lee

unread,
Oct 15, 2009, 10:03:28 AM10/15/09
to ErgoEmacs
Hi Boskom,

i don't think there's a easy way...

basically, it's a minor mode, and minor mode's keybindings have
priority over global keybindings.

you can add a hook... put the following in your .emacs:
;(code untested)

(add-hook 'ergoemacs-mode-hook
(lambda ()
(define-key ergoemacs-keymap (kbd "C-p") nil)
))

-----------------

David, we probably should make C-p ask for confirmation, since most
Ctrl+p invoke the print dialog, but emacs doesn't have such.

i don't remember if we had a issue on this before... let me check and
add it if not. (havn't been too active recently)

Xah
http://xahlee.org/


boskom

unread,
Oct 15, 2009, 10:48:32 AM10/15/09
to ErgoEmacs
Thanks Xah, your code snippet works fine.

Bosko.
Reply all
Reply to author
Forward
0 new messages