From: Stefan Kangas Date: Sun, 3 Jul 2022 12:40:21 +0000 (+0200) Subject: Improve navigation keybindings in emacs-news-mode X-Git-Tag: emacs-29.0.90~1447^2~1236 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d68ecda05c4a634a1f0a606c73137d85bf261775;p=emacs.git 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'. --- diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index fdb3cb86284..c6b352448cc 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -39,12 +39,24 @@ "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)