unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master d68ecda05c: Improve navigation keybindings in emacs-news-mode
       [not found] ` <20220703124030.C769BC00BAF@vcs2.savannah.gnu.org>
@ 2022-07-04 11:31   ` Robert Pluim
  2022-07-04 12:08     ` Visuwesh
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Pluim @ 2022-07-04 11:31 UTC (permalink / raw)
  To: emacs-devel; +Cc: Stefan Kangas

>>>>> On Sun,  3 Jul 2022 08:40:30 -0400 (EDT), Stefan Kangas <stefankangas@gmail.com> said:

    Stefan> branch: master
    Stefan> commit d68ecda05c4a634a1f0a606c73137d85bf261775
    Stefan> Author: Stefan Kangas <stefan@marxist.se>
    Stefan> Commit: Stefan Kangas <stefan@marxist.se>

    Stefan>     Improve navigation keybindings in emacs-news-mode
    
    Stefan>     * lisp/textmodes/emacs-news-mode.el (emacs-news-common-map): New
    Stefan>     defvar-keymap.  Bind navigation commands as in 'org-mode' and
    Stefan>     'outline-minor-mode'.
    Stefan>     (emacs-news-mode-map): Inherit from 'emacs-news-common-map'.
    Stefan>     (emacs-news-view-mode-map): New defvar-keymap; inherit from
    Stefan>     'emacs-news-common-map'.

Those outline-mode bindings are repeatable in outline-mode
itself. Wouldnʼt it be nice if they were in news-mode as well? (the
emacs-news-mode-map bindings I think donʼt need repeatability)

So how about:

diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el
index c5d7b6ea50..2a7a5f1ca7 100644
--- a/lisp/textmodes/emacs-news-mode.el
+++ b/lisp/textmodes/emacs-news-mode.el
@@ -48,6 +48,26 @@ emacs-news-common-map
   "C-c C-p" #'outline-previous-visible-heading
   "C-c C-u" #'outline-up-heading)
 
+(defvar-keymap emacs-news-common-repeat-map
+  ;; Navigation like `org-mode'/`outline-minor-mode'.
+  "C-f" #'outline-forward-same-level
+  "f" #'outline-forward-same-level
+  "C-b" #'outline-backward-same-level
+  "b" #'outline-backward-same-level
+  "C-n" #'outline-next-visible-heading
+  "n" #'outline-next-visible-heading
+  "C-p" #'outline-previous-visible-heading
+  "p" #'outline-previous-visible-heading
+  "C-u" #'outline-up-heading
+  "u" #'outline-up-heading)
+
+(dolist (command '(outline-forward-same-level
+                   outline-backward-same-level
+                   outline-next-visible-heading
+                   outline-previous-visible-heading
+                   outline-up-heading))
+  (put command 'repeat-map 'emacs-news-common-repeat-map))
+
 (defvar-keymap emacs-news-mode-map
   :parent emacs-news-common-map
   "C-c C-s" #'emacs-news-next-untagged-entry

Robert
-- 



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: master d68ecda05c: Improve navigation keybindings in emacs-news-mode
  2022-07-04 11:31   ` master d68ecda05c: Improve navigation keybindings in emacs-news-mode Robert Pluim
@ 2022-07-04 12:08     ` Visuwesh
  2022-07-04 12:32       ` Robert Pluim
  0 siblings, 1 reply; 3+ messages in thread
From: Visuwesh @ 2022-07-04 12:08 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel, Stefan Kangas

[திங்கள் ஜூலை 04, 2022] Robert Pluim wrote:

>>>>>> On Sun,  3 Jul 2022 08:40:30 -0400 (EDT), Stefan Kangas <stefankangas@gmail.com> said:
>
>     Stefan> branch: master
>     Stefan> commit d68ecda05c4a634a1f0a606c73137d85bf261775
>     Stefan> Author: Stefan Kangas <stefan@marxist.se>
>     Stefan> Commit: Stefan Kangas <stefan@marxist.se>
>
>     Stefan>     Improve navigation keybindings in emacs-news-mode
>     
>     Stefan>     * lisp/textmodes/emacs-news-mode.el (emacs-news-common-map): New
>     Stefan>     defvar-keymap.  Bind navigation commands as in 'org-mode' and
>     Stefan>     'outline-minor-mode'.
>     Stefan>     (emacs-news-mode-map): Inherit from 'emacs-news-common-map'.
>     Stefan>     (emacs-news-view-mode-map): New defvar-keymap; inherit from
>     Stefan>     'emacs-news-common-map'.
>
> Those outline-mode bindings are repeatable in outline-mode
> itself. Wouldnʼt it be nice if they were in news-mode as well? (the
> emacs-news-mode-map bindings I think donʼt need repeatability)
>
> So how about:

Do you need the repeat-map?  If I use an outline navigation command
(like outline-up-heading), it triggers the repeat map for me in org-mode
as well.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master d68ecda05c: Improve navigation keybindings in emacs-news-mode
  2022-07-04 12:08     ` Visuwesh
@ 2022-07-04 12:32       ` Robert Pluim
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Pluim @ 2022-07-04 12:32 UTC (permalink / raw)
  To: Visuwesh; +Cc: emacs-devel, Stefan Kangas

>>>>> On Mon, 04 Jul 2022 17:38:14 +0530, Visuwesh <visuweshm@gmail.com> said:

    Visuwesh> Do you need the repeat-map?  If I use an outline navigation command
    Visuwesh> (like outline-up-heading), it triggers the repeat map for me in org-mode
    Visuwesh> as well.

You know that thing where you test before making any changes? I forgot
to test, youʼre right, theyʼre already repeatable.

Robert
-- 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-04 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <165685202989.19667.1306295129215761316@vcs2.savannah.gnu.org>
     [not found] ` <20220703124030.C769BC00BAF@vcs2.savannah.gnu.org>
2022-07-04 11:31   ` master d68ecda05c: Improve navigation keybindings in emacs-news-mode Robert Pluim
2022-07-04 12:08     ` Visuwesh
2022-07-04 12:32       ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).