Rename 'emacs-news-toggle-tag' to 'emacs-news-cycle-tag'

* lisp/textmodes/emacs-news-mode.el (emacs-news-cycle-tag): Renamed
from 'emacs-news-toggle-tag'.
(emacs-news-mode-map, emacs-news-mode-menu): Use new name.
* test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts:
Renamed from "toggle-tag.erts".
* test/lisp/textmodes/emacs-news-mode-tests.el (emacs-news-cycle-tag):
Rename test from 'emacs-news-toggle-tag', and call
'emacs-news-cycle-tag' with new resource file name.
This commit is contained in:
Robert Pluim 2023-02-16 13:04:53 +01:00
parent 5bc88b3b17
commit 83af806ab7
3 changed files with 8 additions and 8 deletions

View file

@ -53,7 +53,7 @@
:parent emacs-news-common-map :parent emacs-news-common-map
"C-c C-s" #'emacs-news-next-untagged-entry "C-c C-s" #'emacs-news-next-untagged-entry
"C-c C-r" #'emacs-news-previous-untagged-entry "C-c C-r" #'emacs-news-previous-untagged-entry
"C-c C-t" #'emacs-news-toggle-tag "C-c C-t" #'emacs-news-cycle-tag
"C-c C-d" #'emacs-news-delete-temporary-markers "C-c C-d" #'emacs-news-delete-temporary-markers
"C-c C-g" #'emacs-news-goto-section "C-c C-g" #'emacs-news-goto-section
"C-c C-j" #'emacs-news-find-heading "C-c C-j" #'emacs-news-find-heading
@ -67,7 +67,7 @@
["Next Untagged" emacs-news-next-untagged-entry :help "Go to next untagged entry"] ["Next Untagged" emacs-news-next-untagged-entry :help "Go to next untagged entry"]
["Previous Untagged" emacs-news-previous-untagged-entry :help "Go to previous untagged entry"] ["Previous Untagged" emacs-news-previous-untagged-entry :help "Go to previous untagged entry"]
["Count Untagged" emacs-news-count-untagged-entries :help "Count the number of untagged entries"] ["Count Untagged" emacs-news-count-untagged-entries :help "Count the number of untagged entries"]
["Toggle Tag" emacs-news-toggle-tag :help "Toggle documentation tag of current entry"] ["Cycle Tag" emacs-news-cycle-tag :help "Cycle documentation tag of current entry"]
["Delete Tags" emacs-news-delete-temporary-markers :help "Delete all documentation tags in buffer"] ["Delete Tags" emacs-news-delete-temporary-markers :help "Delete all documentation tags in buffer"]
"--" "--"
["Goto Section" emacs-news-goto-section :help "Prompt for section and go to it"] ["Goto Section" emacs-news-goto-section :help "Prompt for section and go to it"]
@ -188,8 +188,8 @@ untagged NEWS entry."
(interactive nil emacs-news-mode) (interactive nil emacs-news-mode)
(emacs-news-next-untagged-entry t)) (emacs-news-next-untagged-entry t))
(defun emacs-news-toggle-tag () (defun emacs-news-cycle-tag ()
"Toggle documentation tag of current headline in the Emacs NEWS file." "Cycle documentation tag of current headline in the Emacs NEWS file."
(interactive nil emacs-news-mode) (interactive nil emacs-news-mode)
(save-excursion (save-excursion
(goto-char (line-beginning-position)) (goto-char (line-beginning-position))
@ -206,7 +206,7 @@ untagged NEWS entry."
(insert "+++")) (insert "+++"))
((looking-at (rx bol "+++" eol)) ((looking-at (rx bol "+++" eol))
(delete-char 4)) (delete-char 4))
(t (user-error "Invalid headline tag; can't toggle"))))) (t (user-error "Invalid headline tag; can't cycle")))))
(defun emacs-news-count-untagged-entries () (defun emacs-news-count-untagged-entries ()
"Say how many untagged entries there are in the current NEWS buffer." "Say how many untagged entries there are in the current NEWS buffer."

View file

@ -23,10 +23,10 @@
(require 'ert-x) (require 'ert-x)
(require 'emacs-news-mode) (require 'emacs-news-mode)
(ert-deftest emacs-news-toggle-tag () (ert-deftest emacs-news-cycle-tag ()
(ert-test-erts-file (ert-resource-file "toggle-tag.erts") (ert-test-erts-file (ert-resource-file "cycle-tag.erts")
(lambda () (lambda ()
(emacs-news-mode) (emacs-news-mode)
(emacs-news-toggle-tag)))) (emacs-news-cycle-tag))))
;;; emacs-news-mode-tests.el ends here ;;; emacs-news-mode-tests.el ends here