From: Stefan Kangas Date: Tue, 5 Jul 2022 02:57:51 +0000 (+0200) Subject: New command emacs-news-mode-open-line X-Git-Tag: emacs-29.0.90~1447^2~1184 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3534426b28b9118e32cabe16810f16ef915f0dbd;p=emacs.git New command emacs-news-mode-open-line * lisp/textmodes/emacs-news-mode.el (emacs-news-mode-open-line): New command. (emacs-news-mode-map): Remap 'open-line' to above new command. --- diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index c5d7b6ea509..4ca6ea86d86 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -54,7 +54,8 @@ "C-c C-r" #'emacs-news-previous-untagged-entry "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-c C-e" #'emacs-news-count-untagged-entries + " " #'emacs-news-mode-open-line) (defvar-keymap emacs-news-view-mode-map :parent emacs-news-common-map) @@ -232,6 +233,16 @@ untagged NEWS entry." (when (re-search-forward (concat "^*+ " (regexp-quote heading)) nil t) (beginning-of-line))) +(defun emacs-news-mode-open-line (n) + "Open a new line in a NEWS file. +This is like `open-line', but skips any temporary NEWS-style +documentation marks on the previous line." + (interactive "*p" emacs-news-mode) + (when (save-excursion (forward-line -1) + (looking-at (rx bol (or "---" "+++") eol))) + (forward-line -1)) + (open-line n)) + (provide 'emacs-news-mode) ;;; emacs-news-mode.el ends here