mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Fix bug in 'todo-jump-to-category' (bug#78608)
* lisp/calendar/todo-mode.el (todo-jump-to-category): Eliminate comparison of the number of Todo categories before and after specifying the category to jump to and replace it by a check of whether there are any items in the category, since an existing category should always have at least one item (perhaps done or archived).
This commit is contained in:
parent
3e57c35323
commit
4507b6a9c7
1 changed files with 4 additions and 4 deletions
|
|
@ -952,12 +952,9 @@ Categories mode."
|
|||
todo-current-todo-file) ".toda")
|
||||
;; Otherwise, jump to the category in the todo file.
|
||||
todo-current-todo-file)))
|
||||
(len (length todo-categories))
|
||||
(cat+file (unless cat
|
||||
(todo-read-category "Jump to category: "
|
||||
(if archive 'archive) file)))
|
||||
(add-item (and todo-add-item-if-new-category
|
||||
(> (length todo-categories) len)))
|
||||
(category (or cat (car cat+file))))
|
||||
(unless cat (setq file0 (cdr cat+file)))
|
||||
(with-current-buffer (find-file-noselect file0 'nowarn)
|
||||
|
|
@ -971,7 +968,10 @@ Categories mode."
|
|||
(todo-category-select)
|
||||
(goto-char (point-min))
|
||||
(if (bound-and-true-p hl-line-mode) (hl-line-highlight))
|
||||
(when add-item (todo-insert-item--basic))))))
|
||||
(when (and todo-add-item-if-new-category
|
||||
;; A new category is empty on creation.
|
||||
(seq-every-p #'zerop (cdr (assoc category todo-categories))))
|
||||
(todo-insert-item--basic))))))
|
||||
|
||||
(defun todo-next-item (&optional count)
|
||||
"Move point down to the beginning of the next item.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue