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

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

Re: Customize the key bindings in the org mode


From: Michael Heerdegen
Subject: Re: Customize the key bindings in the org mode
Date: Fri, 08 Mar 2024 01:37:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Volker Wysk <post@volker-wysk.de> writes:

> I found something on the web and adapted it:
>
> (with-eval-after-load "org"  (define-key org-mode-map [M-down] #'absatz-vor)
>
> But this doesn't work, because the org-mode-map is nil. Seems like that's
> because org-mode hasn't been read yet, in the ~/.emacs file.

Org consists of multiple source files, and at the moment where org.el
has been loaded the rest of org has not yet - including the file that
actually defines and fills the org-mode's keymap (note that C-h v
org-mode-map tells you org.el would define the variable, this is true
but only for internal technical reasons: the keymap is not yet created
by loading that file).

In such cases, either find a hook you can use, or find the file where
your stuff is defined - in this case, "org-keys".  It's not always
trivial to find that file, one must look at the source code.  In the
case of a major-mode using the mode hook is a good choice (or even the
best choice) to define key bindings for that mode.

Michael.




reply via email to

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