From: Po Lu Date: Fri, 5 Aug 2022 08:12:07 +0000 (+0800) Subject: Improve C-x C-q in emacs-news-mode X-Git-Tag: emacs-29.0.90~1447^2~423 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=faf1f037987ccef81b3f1a18bfc5ea4de867983e;p=emacs.git Improve C-x C-q in emacs-news-mode * lisp/textmodes/emacs-news-mode.el (emacs-news-mode-map) (emacs-news-view-mode-map): Make C-x C-q switch to the appropriate mode for editing, and vice versa. (emacs-news-mode): Disable button-mode and make buffer read-write. --- diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index af0aa2ddeab..c7fa9fa2b2c 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -56,10 +56,12 @@ "C-c C-g" #'emacs-news-goto-section "C-c C-j" #'emacs-news-find-heading "C-c C-e" #'emacs-news-count-untagged-entries + "C-x C-q" #'emacs-news-view-mode " " #'emacs-news-open-line) (defvar-keymap emacs-news-view-mode-map - :parent emacs-news-common-map) + :parent emacs-news-common-map + "C-x C-q" #'emacs-news-mode) (defvar emacs-news-mode-font-lock-keywords `(("^---$" 0 'emacs-news-does-not-need-documentation) @@ -78,6 +80,11 @@ ;;;###autoload (define-derived-mode emacs-news-mode text-mode "NEWS" "Major mode for editing the Emacs NEWS file." + ;; Disable buttons. + (button-mode nil) + ;; And make the buffer writable. This is used when toggling + ;; emacs-news-mode. + (setq buffer-read-only nil) (setq-local fill-paragraph-function #'emacs-news--fill-paragraph) (emacs-news--mode-common))