From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eBUNFQZ4AmfhWwAA62LTzQ:P1 (envelope-from ) for ; Sun, 06 Oct 2024 11:44:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id eBUNFQZ4AmfhWwAA62LTzQ (envelope-from ) for ; Sun, 06 Oct 2024 13:44:06 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=Jyf3wtqq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1728215046; a=rsa-sha256; cv=none; b=b8fzjALLBI+ILcXudqBPmSbYtdOtwnBtr7d+PAGu6eObeQvAQ4gfaCzx/Z4w0rAisYvfMg N3f/dN/EEUKzAfq0uqgodrrPXLshzPJ0RLDv6iH1o+BdLnK29gP/K3rqT1KzAqYPseVT3j TZv6i7FZRpIkh7YwDw8nZZS3ScpoAKSaehHSjoNxJrCX+wz7Yj5JvTf4LG8ymkvUybV76w fekKmMS5qSzg+94dHp/Bak+NLH1aWqeB/M/2eOHLoWWIevHyd45qX8w5VM+JD7BRp8zqs6 ea1GVlzL43oInNnLmL/QJouCsGRSohgQVblBllChbn12O6wmtDp+P6+aEGkEcg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=Jyf3wtqq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1728215046; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=g5zCiWjUEtnvvh2vQeQtQlmYe4UNKWMDiB6+K1xtV0s=; b=BiQ3bGgIwqp9oLRO/qG0pjLh8y42C5Ok2hDlWnTWVbc4WC+SVKl/vpm1MkY4EajIUmNmGX wcy37JAP1NicIYvbH0AgdPoOq3WAORvaUBYLg3XPiPeCh0XJLfj/0slUllIs0edzM201Dw qvTkivkdrmcaplxbjvGDzj1FYQbxX/4foiw4QgxmI6OaQjj/rWMINNWBhtscvrdUPM/3ml oopuJIG1V70sMfEkhmil0PWkcJFkg0iqsD3GPMCG2DqO1ty1F4lBpC7OcsBOPkGV/Rarjv 7o+4p1vuZNZ0yXZjWuMBVWgEciPVXZZMrGbnB25eXYzmz5I1NL0D7aKE+X+eIw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5F8C71C9F2 for ; Sun, 06 Oct 2024 13:44:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxPfG-0000P1-3W; Sun, 06 Oct 2024 07:43:06 -0400 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 1sxPfD-0000Oq-AG for emacs-orgmode@gnu.org; Sun, 06 Oct 2024 07:43:03 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxPfB-0002aY-Aa for emacs-orgmode@gnu.org; Sun, 06 Oct 2024 07:43:03 -0400 Received: by mail-pf1-x444.google.com with SMTP id d2e1a72fcca58-71dfccba177so347397b3a.0 for ; Sun, 06 Oct 2024 04:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728214979; x=1728819779; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=n7RRUJl7Kl5errlEtUWZoaBQgqdM2xYTa2bhMzKui4I=; b=Jyf3wtqq6qfuY0SbtKdYM/c8LS09y+90WNJNe0Mu9LETpe90SQ2ypFNQahdjpWTHjg y9BXw17OwAT3jAHTavw3zn1AjB72XBpTqXGYSNjPQmFzAtK8KY4TPKq0F761kq9TgLYX VL5wIBzqv7Mvp4BRDkDTH7P+GjrgaJR9lke545s6MeBumVWfqM2lO9phTpltlMgk8olG 0qk0TknjoMb3DiovZr1oLNxW4Mp8NWmEgRqSlBV36rDnGb/4rMTKDg99gXI0yJZnZ7Ps jWFTWgtuXLy35pUukdMV5wwR0m6NLMHmM78hxIVMmxkN4Q7T9t88zE1d5Ocxq1CSy3De ehag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728214979; x=1728819779; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=n7RRUJl7Kl5errlEtUWZoaBQgqdM2xYTa2bhMzKui4I=; b=Ubrj10rye9KYwVGjO0oYAzCqRbyU2tpbMekxjx0uenFRqYBk1sdYgNnGgRenY4ma+w 8HjTZ4QlvdP1reiECvUMJw88cK5uswszKMCKh9b+Mt7QsJLLVtdMJbZ5ErAbRWWzU5EN Ikar3zwMWb7fuRLT0WjCzgp2xkFkykdNpq4Srk8979Th4YukV7CWuII/MolV4iv0cJZM 8CLTcZRlgqWZDypwQJcsPanI3loLhHT8TwAHAmDGgIuVU8VVUSAFJtlN4d0iCKl+zJQA 5Wa2j3mSq+xEL7nq4PGcbXIzFnANS9+Xu+/e40K6K2nCe3j0UKY5QIX2NT7/R3nBrww5 kq5g== X-Gm-Message-State: AOJu0YzzHi71nxHq6OFG8Sz+c5lpdF1EDB7fsxP2bReRt4NXG/vXrx+L 2YIHvhnSB7VuS9NhNY52bS0A+ZYXtH81A+lLBr0f/8FeVZCCOWWRCO0Ybx8e X-Google-Smtp-Source: AGHT+IFavGkvZW2e8VRq/bdaynbcbG82e9mpzhdAn8niQMa/iS6ZsHv1CBXIIMBuAQcdFPShxzN8zA== X-Received: by 2002:a05:6a21:3947:b0:1d6:de65:8c4d with SMTP id adf61e73a8af0-1d6e02b14eemr11803793637.4.1728214979370; Sun, 06 Oct 2024 04:42:59 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0d663e3sm2680578b3a.167.2024.10.06.04.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Oct 2024 04:42:58 -0700 (PDT) From: Visuwesh To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Add repeat-map for navigation commands In-Reply-To: <87frprrjso.fsf@localhost> (Ihor Radchenko's message of "Sun, 22 Sep 2024 11:48:23 +0000") References: <877cbkoqkt.fsf@gmail.com> <8734m8rcoh.fsf@localhost> <87wmjk6qk8.fsf@gmail.com> <87cyl53vzx.fsf@localhost> <87r09jwzlm.fsf@gmail.com> <87frprrjso.fsf@localhost> Date: Sun, 06 Oct 2024 17:12:54 +0530 Message-ID: <87bjzxh2yp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::444; envelope-from=visuweshm@gmail.com; helo=mail-pf1-x444.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 1.54 X-Spam-Score: 1.54 X-Migadu-Queue-Id: 5F8C71C9F2 X-Migadu-Scanner: mx12.migadu.com X-TUID: NVM+OKPPxMNv --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=9A=E0=AF=86= =E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 22= , 2024] Ihor Radchenko wrote: > Visuwesh writes: > >> Please find attached. I tried my best to write the manual entry but it >> still reads awkward. > > Thanks! > >> * lisp/org-keys.el (org-up-heading): Add new alias for >> outline-up-heading. > > Please quote Elisp symbols as `outline-up-heading'. > >> +** Repeating commands >> +:PROPERTIES: >> +:DESCRIPTION: Repeating navigation commands >> +:END: >> + >> +#+cindex: repeat-mode, org-mode >> +#+cindex: repeating navigation commands >> +When ~repeat-mode~ is turned on, headline motion commands, link and >> +block navigation commands by only pressing a single key. For example, >> +when navigation to the next headline using {{{kbd(C-c C-n)}}}, a >> +repeat map is activated that lets you quickly execute headline motion >> +commands. When a key not in the map is pressed, it exits ~repeat-mode~ >> +and the command corresponding to the key is executed. > > 1. You can link to "9.11 Repeating a Command" section of Emacs manual > 2. I think that it is a good idea to provide a more clear example. > Something like: "Instead of pressing C-c C-n repeatedly, you can > omit C-c and just use C-c C-n n n p u... to move around." > 3. We need to clarify which bindings are default (n, p, u, f, > b). Probably as a table. > >> +*** Some navigation commands can now be repeated >> + >> +When ~repeat-mode~ is turned on, certain navigation can be repeated. >> +These include the headline navigation commands, ~org-next-link~ and >> +~org-previous-link~, and ~org-next-block~ and ~org-previous-block~. > > Example and a link to Emacs manual would also be good here. > And we probably need to mention `org-navigation-repeat-map' to let users > know what to customize if they prefer alternative bindings. Thank you for the review, and sorry for the delay. Can you review the attached please? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-repeat-mode-keymap-for-navigation-commands.patch >From cffbbe543d466cbdd2b76bfe5be6a7d693bc30f9 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Mon, 9 Sep 2024 19:46:47 +0530 Subject: [PATCH] Add repeat-mode keymap for navigation commands * lisp/org-keys.el (org-up-heading): Add new alias for `outline-up-heading'. (org-mode-map): Remap `outline-up-heading' to the new alias. (org-navigation-repeat-map, org-link-navigation-repeat-map) (org-block-navigation-repeat-map): Add new repeat-maps to make navigation easier. * doc/org-manual.org (Repeating commands): Document the new feature in the manual. * etc/ORG-NEWS (Some navigation commands can now be repeated): Announce it. --- doc/org-manual.org | 43 +++++++++++++++++++++++++++++++++++++++++++ etc/ORG-NEWS | 10 ++++++++++ lisp/org-keys.el | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) diff --git a/doc/org-manual.org b/doc/org-manual.org index 9365c66b1..e533fe890 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -21657,6 +21657,49 @@ of ~org-yank-dnd-method~. Image files pasted this way also respect the value of ~org-yank-image-save-method~ when the action to perform is =attach=. +** Repeating commands +:PROPERTIES: +:DESCRIPTION: Repeating navigation commands +:END: + +#+cindex: repeat-mode, org-mode +#+cindex: repeating navigation commands +When ~repeat-mode~ is turned on, headline motion commands, link and +block navigation commands by only pressing a single key. For example, +instead of typing {{{kbd(C-c C-n)}}} repeatedly, you can omit C-c and +just type {{{kbd(C-c C-n n n n p u ...)}}} to move to different +headlines. When a key not in the map is pressed, it exits +~repeat-mode~ and the command corresponding to the key is executed +(see the [[info:emacs#Repeating][Emacs user manual]]). + +By default, the following commands are made repeatable in separate +repeat-maps. + +~org-navigation-repeat-map~: + +| Command | Key binding | Repeat key | +|-----------------------------------+--------------------+--------------| +| ~org-next-visible-heading~ | {{{kbd(C-c C-n)}}} | {{{kbd(n)}}} | +| ~org-previous-visible-heading~ | {{{kbd(C-c C-p)}}} | {{{kbd(p)}}} | +| ~org-forward-heading-same-level~ | {{{kbd(C-c C-f)}}} | {{{kbd(f)}}} | +| ~org-backward-heading-same-level~ | {{{kbd(C-c C-b)}}} | {{{kbd(b)}}} | +| ~org-up-heading~ | {{{kbd(C-c C-u)}}} | {{{kbd(u)}}} | + + +~org-block-navigation-repeat-map~: + +| Command | Key binding | Repeat key | +|----------------------+--------------------+--------------| +| ~org-next-block~ | {{{kbd(C-c M-f)}}} | {{{kbd(f)}}} | +| ~org-previous-block~ | {{{kbd(C-c M-b)}}} | {{{kbd(b)}}} | + +~org-link-navigation-repeat-map~: + +| Command | Key binding | Repeat key | +|---------------------+------------------------+--------------| +| ~org-next-link~ | {{{kbd(C-c C-x C-n)}}} | {{{kbd(n)}}} | +| ~org-previous-link~ | {{{kbd(C-c C-x C-p)}}} | {{{kbd(p)}}} | + * Hacking :PROPERTIES: :DESCRIPTION: How to hack your way around. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 392788055..e4d31e6a6 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -77,6 +77,16 @@ You can now create links to =shortdoc= documentation groups for Emacs Lisp functions (see =M-x shortdoc-display-group=). Requires Emacs 28 or newer. +*** Some navigation commands can now be repeated + +When ~repeat-mode~ is turned on, certain navigation can be repeated. +These include the headline navigation commands, ~org-next-link~ and +~org-previous-link~, and ~org-next-block~ and ~org-previous-block~. +See the [[info:emacs#Repeating][Emacs user manual]] for more info on ~repeat-mode~. The +keybindings in the repeat-maps can be changed by customizing +~org-navigation-repeat-map~, ~org-link-navigation-repeat-map~, and +~org-block-navigation-repeat-map~. + ** New and changed options # Chanes deadling with changing default values of customizations, diff --git a/lisp/org-keys.el b/lisp/org-keys.el index 1daedaae8..f6de753af 100644 --- a/lisp/org-keys.el +++ b/lisp/org-keys.el @@ -232,6 +232,7 @@ (declare-function org-up-element "org" ()) (declare-function org-update-statistics-cookies "org" (all)) (declare-function org-yank "org" (&optional arg)) (declare-function orgtbl-ascii-plot "org-table" (&optional ask)) +(declare-function outline-up-heading "outline" (arg &optional invisible-ok)) @@ -409,6 +410,8 @@ (define-key org-mode-map [remap outline-next-visible-heading] (define-key org-mode-map [remap outline-previous-visible-heading] #'org-previous-visible-heading) (define-key org-mode-map [remap outline-show-children] #'org-fold-show-children) +(defalias 'org-up-heading #'outline-up-heading) +(define-key org-mode-map [remap outline-up-heading] #'org-up-heading) ;;;; Make `C-c C-x' a prefix key (org-defkey org-mode-map (kbd "C-c C-x") (make-sparse-keymap)) @@ -462,6 +465,37 @@ (org-defkey org-mode-map (kbd "C-S-") #'org-shiftcontrolleft) (org-defkey org-mode-map (kbd "C-S-") #'org-shiftcontrolup) (org-defkey org-mode-map (kbd "C-S-") #'org-shiftcontroldown) +;;; Repeat-mode map. +(defvar org-navigation-repeat-map (make-sparse-keymap) + "Repeat keymap for navigation commands.") +(org-defkey org-navigation-repeat-map (kbd "b") #'org-backward-heading-same-level) +(org-defkey org-navigation-repeat-map (kbd "f") #'org-forward-heading-same-level) +(org-defkey org-navigation-repeat-map (kbd "n") #'org-next-visible-heading) +(org-defkey org-navigation-repeat-map (kbd "p") #'org-previous-visible-heading) +(org-defkey org-navigation-repeat-map (kbd "u") #'org-up-heading) +(map-keymap + (lambda (_key cmd) + (put cmd 'repeat-map 'org-navigation-repeat-map)) + org-navigation-repeat-map) + +(defvar org-link-navigation-repeat-map (make-sparse-keymap) + "Repeat keymap for link navigation commands.") +(org-defkey org-link-navigation-repeat-map (kbd "n") #'org-next-link) +(org-defkey org-link-navigation-repeat-map (kbd "p") #'org-previous-link) +(map-keymap + (lambda (_ cmd) + (put cmd 'repeat-map 'org-link-navigation-repeat-map)) + org-link-navigation-repeat-map) + +(defvar org-block-navigation-repeat-map (make-sparse-keymap) + "Repeat keymap for block navigation commands.") +(org-defkey org-block-navigation-repeat-map (kbd "f") #'org-next-block) +(org-defkey org-block-navigation-repeat-map (kbd "b") #'org-previous-block) +(map-keymap + (lambda (_ cmd) + (put cmd 'repeat-map 'org-block-navigation-repeat-map)) + org-block-navigation-repeat-map) + ;;;; Extra keys for TTY access. ;; We only set them when really needed because otherwise the -- 2.45.2 --=-=-=--