diff options
Diffstat (limited to 'lisp/textmodes/emacs-news-mode.el')
-rw-r--r-- | lisp/textmodes/emacs-news-mode.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index e6e1f037284..022e17c9343 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -25,6 +25,7 @@ (eval-when-compile (require 'cl-lib)) (require 'outline) +(require 'subr-x) ; `emacs-etc--hide-local-variables' (defgroup emacs-news-mode nil "Major mode for editing and viewing the Emacs NEWS file." @@ -59,9 +60,12 @@ "C-x C-q" #'emacs-news-view-mode "<remap> <open-line>" #'emacs-news-open-line) -(defvar-keymap emacs-news-view-mode-map - :parent emacs-news-common-map - "C-x C-q" #'emacs-news-mode) +(defvar emacs-news-view-mode-map + ;; This is defined this way instead of inheriting because we're + ;; deriving the mode from `special-mode' and want the keys from there. + (let ((map (copy-keymap emacs-news-common-map))) + (keymap-set map "C-x C-q" #'emacs-news-mode) + map)) (defvar emacs-news-mode-font-lock-keywords `(("^---$" 0 'emacs-news-does-not-need-documentation) @@ -73,7 +77,8 @@ outline-minor-mode-cycle t outline-level (lambda () (length (match-string 2))) outline-minor-mode-highlight 'append) - (outline-minor-mode)) + (outline-minor-mode) + (emacs-etc--hide-local-variables)) ;;;###autoload (define-derived-mode emacs-news-mode text-mode "NEWS" |