Commit b9f02cf6 authored by Nicolas Richard's avatar Nicolas Richard Committed by Stephen Berman
Browse files

Fixes: debbugs:20832

* lisp/calendar/todo-mode.el (todo-show): Signal an error
if buffer for adding new todo file is empty but modified.
parent 8b5f2f43
......@@ -743,6 +743,11 @@ corresponding todo file, displaying the corresponding category."
(setq todo-category-number (todo-category-number cat)))
;; If this is a new todo file, add its first category.
(when (zerop (buffer-size))
;; Don't confuse an erased buffer with a fresh buffer for
;; adding a new todo file -- it might have been erased by
;; mistake or due to a bug (e.g. Bug#20832).
(when (buffer-modified-p)
(error "Buffer is empty but modified, please report a bug"))
(let (cat-added)
(unwind-protect
(setq todo-category-number
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment