Subject: bug#56360: closed (Re: bug#56360: [PATCH] Improve navigation keybindings in emacs-news-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 03 Jul 2022 12:43:02 +0000

Your bug report

#56360: [PATCH] Improve navigation keybindings in emacs-news-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
56360: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56360
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#56360: [PATCH] Improve navigation keybindings in emacs-news-mode
From: Stefan Kangas <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked]
Date: Sun, 3 Jul 2022 14:42:10 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Lars Ingebrigtsen <[email-masked]> writes:

> Makes sense to me; go ahead and push.

Thanks, pushed as commit d68ecda05c.

Subject: [PATCH] Improve navigation keybindings in emacs-news-mode
From: Stefan Kangas <[email-masked]>
To: [email-masked]
Date: Sat, 2 Jul 2022 21:07:31 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Severity: wishlist

I think the navigation commands in `emacs-news-mode' and
'emacs-news-view-mode-map' should be similar to `org-mode' and
`outline-mode'.  IMO, the parts where they agree is the closest we have
anything resembling a "standard" for navigating an outline in Emacs.
See the attached patch.

It is worth comparing to:

    (describe-keymap 'outline-mode-prefix-map)
    (describe-keymap 'outline-navigation-repeat-map)
    (describe-keymap 'org-mode-map)
From 501a2e307d941783b414eb26ad977d4bfde6fd78 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Sat, 2 Jul 2022 20:08:15 +0200
Subject: [PATCH] Improve navigation keybindings in emacs-news-mode

* lisp/textmodes/emacs-news-mode.el (emacs-news-common-map): New
defvar-keymap.  Bind navigation commands as in 'org-mode' and
'outline-minor-mode'.
(emacs-news-mode-map): Inherit from 'emacs-news-common-map'.
(emacs-news-view-mode-map): New defvar-keymap; inherit from
'emacs-news-common-map'.
---
 lisp/textmodes/emacs-news-mode.el | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el
index fdb3cb8628..c6b352448c 100644
--- a/lisp/textmodes/emacs-news-mode.el
+++ b/lisp/textmodes/emacs-news-mode.el
@@ -39,12 +39,24 @@ emacs-news-does-not-need-documentation
   "Face used for displaying the \"does not need documentation\" tag."
   :version "29.1")
 
+(defvar-keymap emacs-news-common-map
+  ;; Navigation like `org-mode'/`outline-minor-mode'.
+  "C-c C-f" #'outline-forward-same-level
+  "C-c C-b" #'outline-backward-same-level
+  "C-c C-n" #'outline-next-visible-heading
+  "C-c C-p" #'outline-previous-visible-heading
+  "C-c C-u" #'outline-up-heading)
+
 (defvar-keymap emacs-news-mode-map
+  :parent emacs-news-common-map
   "C-c C-s" #'emacs-news-next-untagged-entry
   "C-c C-r" #'emacs-news-previous-untagged-entry
   "C-c C-g" #'emacs-news-goto-section
-  "C-c C-f" #'emacs-news-find-heading
-  "C-c C-n" #'emacs-news-count-untagged-entries)
+  "C-c C-j" #'emacs-news-find-heading
+  "C-c C-e" #'emacs-news-count-untagged-entries)
+
+(defvar-keymap emacs-news-view-mode-map
+  :parent emacs-news-common-map)
 
 (defvar emacs-news-mode-font-lock-keywords
   `(("^---$" 0 'emacs-news-does-not-need-documentation)
-- 
2.30.2