diff options
author | Po Lu <luangruo@yahoo.com> | 2022-08-05 16:12:07 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-08-05 16:12:07 +0800 |
commit | faf1f037987ccef81b3f1a18bfc5ea4de867983e (patch) | |
tree | 14ade4fbd0a9fdfe440f81b40e16ef229fe2d3ac /lisp/textmodes/emacs-news-mode.el | |
parent | 4b1ec3956117a0ed30f5df3bd19d71fb9ba51a48 (diff) | |
download | emacs-faf1f037987ccef81b3f1a18bfc5ea4de867983e.tar.gz emacs-faf1f037987ccef81b3f1a18bfc5ea4de867983e.tar.bz2 emacs-faf1f037987ccef81b3f1a18bfc5ea4de867983e.zip |
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.
Diffstat (limited to 'lisp/textmodes/emacs-news-mode.el')
-rw-r--r-- | lisp/textmodes/emacs-news-mode.el | 9 |
1 files changed, 8 insertions, 1 deletions
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 "<remap> <open-line>" #'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)) |