[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can one define global-set-key to override mode-based keymap?
From: |
Kevin Rodgers |
Subject: |
Re: Can one define global-set-key to override mode-based keymap? |
Date: |
Mon, 13 Nov 2006 09:25:55 -0700 |
User-agent: |
Thunderbird 1.5.0.8 (Windows/20061025) |
Liu Fung Sin wrote:
I like using the arrow keys to move around so I can free up Ctrl-F
Ctrl-B Ctrl-N and Ctrl-P and rebind them for some commands that I use
often.
For instance, I have
(global-set-key "\C-n" 'other-window)
in my .emacs
Down that road lies madness.
This works great until I invoke another major mode.
See? :-)
Like in dired, the dired mode map has C-n bound to dired-next-line.
C-n runs the command dired-next-line
which is an interactive compiled Lisp function in `dired'.
(dired-next-line ARG)
Is there a way to define a key as special using global-set-key (or
otherwise) so that no other modes can override my .emacs setting?
Hmmm, maybe you could bind `C-n' etc. to some other character not likely
to be bound to a command (e.g. an ISO-8859/Unicode C1 control character
or a Unicode private use character) via keyboard-translate, then bind
the key sequence (vector) of that unused character to `other-window'.
--
Kevin