]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve navigation keybindings in emacs-news-mode
authorStefan Kangas <stefan@marxist.se>
Sun, 3 Jul 2022 12:40:21 +0000 (14:40 +0200)
committerStefan Kangas <stefan@marxist.se>
Sun, 3 Jul 2022 12:40:21 +0000 (14:40 +0200)
* 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

index fdb3cb862842fdc663ae6845a48d4bbe406b241b..c6b352448cca866ede723fee7481315a289dc5d7 100644 (file)
   "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)