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

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

Re: ergonomic keybindings in text mode


From: Xah
Subject: Re: ergonomic keybindings in text mode
Date: Mon, 30 Jun 2008 08:38:09 -0700 (PDT)
User-agent: G2/1.0

hi Markus,

are you using qwerty or dvorak?

i use dvorak so i'm not sure what some of the special modes effects
the qwerty ergo keymap.

But for dvorak for example, shell mode and shell-command rebind M-r,
which under the dvorak ergo map should be forward-word.

For modes that rebind your shortcuts, you can force them back like
this:

(add-hook 'comint-mode-hook
(lambda ()
 (define-key comint-mode-map (kbd "M-r") 'forward-word)
 (define-key comint-mode-map (kbd "M-s")" 'isearch-forward)
)
)

The comint-mode is used by shell and shell-command and other shell
related modes for keybinding. So, the above rebind them.

In general, you need to find out the mode name. Suppose the mode name
is xyz, then typically xyz-hook is its hook function name and xyz-map
is its keymap.

Basically, each emacs mode may define its own keymap, and if they do,
they over-ride any global maps by design. So a hook is needed to
reclaim your keybindings. You'll have to do this for every mode that
took your keybindings.

Almost all major or minor modes will have its own keymaps (most of
them will have lots of bindings in the C-c C-‹key› space). However,
fortunately they seldomly use the M-‹key› space, which the ergo map is
based on.

Thanks for trying out the ergonomic keybindings. :)

  Xah
∑ http://xahlee.org/

☄



On Jun 30, 2:02 am, Markus Grunwald <markus.grunw...@gmx.de> wrote:
> Hello,
>
> Recently, I read in this group about a more ergonomic keylayout for 
> emacs:http://xahlee.org/emacs/ergonomic_emacs_keybinding.html
> Since I had Problems with my joints for a long time, I decided to try it.
> But I have one slight problem: text-mode changes a lot of bindings that I
> would like to have. text-mode-hook does not look suspicious:
>
> text-mode-hook is a variable defined in `text-mode.el'.
> Its value is
> ((lambda nil
>    (auto-fill-mode 1)
>    (abbrev-mode 1)
>    (message "==================== text-mode-hook ===================="))
>  text-mode-hook-identify)
>
> What can I do about it ? The only thing that came to my mind is to re-bind
> all keys in text-mode-hook but this does not seem elegant to me...
>
> TIA,
> Markus



reply via email to

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