From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arash Esbati Newsgroups: gmane.emacs.help Subject: Re: Customize the key bindings in the org mode Date: Fri, 08 Mar 2024 12:35:39 +0100 Message-ID: References: <2b5e12e8680530e136294c237a6b2ce9ef1de06b.camel@volker-wysk.de> <87wmqdwobr.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39632"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Heerdegen To: Michael Heerdegen via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 08 12:36:30 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1riYWb-000A6q-EU for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 08 Mar 2024 12:36:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riYW5-0003Om-Uj; Fri, 08 Mar 2024 06:35:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riYW4-0003Mz-B7 for help-gnu-emacs@gnu.org; Fri, 08 Mar 2024 06:35:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riYW3-0000qT-Dp; Fri, 08 Mar 2024 06:35:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=XpPA6SyfIrJy6qg+pipTZzawtariSvPK8Q4GTArmv70=; b=l7d1caX3x+45SNQCErPq kSfLCJRDCQK4SAmnqj8d0CndI2wEGiQppVI1w1B7RO82xy7r5L91oDBaHpprS+BdA1aolORqpL1nT rhF3kVkqyXYd60f1oKdxRYFV1PU0GAXrx92tCmHNQw5tLiM9xQ/bA084lk3VFDhEBp28Vl5T3rtfr 2zJDU9qJOIFbliPmlbg/W1qRRKEUBji7BkcANEab/RKruqPyB0E/BYn+ThGFjw+qIwSANs8KpDJwC zLkqh8B1H8blQm4Ee0T7lJcV0gVDojOwZ8ZlCfycQtYm589Ixe5oEZT/yPsekv3IPHW79grLyh7/J /3D1uCpKMxIzxg==; In-Reply-To: <87wmqdwobr.fsf@web.de> (Michael Heerdegen via Users list for the's message of "Fri, 08 Mar 2024 01:37:44 +0100") X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146060 Archived-At: Michael Heerdegen via Users list for the GNU Emacs text editor writes: > Volker Wysk 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). Caveat emptor: I'm not an Org user. Does the above mean that this example in Org manual[1] doesn't work OOTB? C-c C-x C-n (org-next-link) C-c C-x C-p (org-previous-link) Move forward/backward to the next link in the buffer. At the limit of the buffer, the search fails once, and then wraps around. The key bindings for this are really too long; you might want to bind this also to M-n and M-p. (with-eval-after-load 'org (define-key org-mode-map (kbd "M-n") #'org-next-link) (define-key org-mode-map (kbd "M-p") #'org-previous-link)) Best, Arash Footnotes: [1] https://orgmode.org/manual/Handling-Links.html