diff options
| author | Nicolas Richard | 2015-06-19 16:57:26 +0200 |
|---|---|---|
| committer | Stephen Berman | 2015-06-19 16:57:26 +0200 |
| commit | b9f02cf65a1b41e486f412e6f98644f298129d55 (patch) | |
| tree | 31170d8808a088bf2a1b77b1a4c54bc265e78e76 | |
| parent | 8b5f2f439b835ad115ce084ba68e0ae38ea40dd8 (diff) | |
| download | emacs-b9f02cf65a1b41e486f412e6f98644f298129d55.tar.gz emacs-b9f02cf65a1b41e486f412e6f98644f298129d55.zip | |
Fixes: debbugs:20832
* lisp/calendar/todo-mode.el (todo-show): Signal an error
if buffer for adding new todo file is empty but modified.
| -rw-r--r-- | lisp/calendar/todo-mode.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index dcc960fb9bf..6e975249a3f 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -743,6 +743,11 @@ corresponding todo file, displaying the corresponding category." | |||
| 743 | (setq todo-category-number (todo-category-number cat))) | 743 | (setq todo-category-number (todo-category-number cat))) |
| 744 | ;; If this is a new todo file, add its first category. | 744 | ;; If this is a new todo file, add its first category. |
| 745 | (when (zerop (buffer-size)) | 745 | (when (zerop (buffer-size)) |
| 746 | ;; Don't confuse an erased buffer with a fresh buffer for | ||
| 747 | ;; adding a new todo file -- it might have been erased by | ||
| 748 | ;; mistake or due to a bug (e.g. Bug#20832). | ||
| 749 | (when (buffer-modified-p) | ||
| 750 | (error "Buffer is empty but modified, please report a bug")) | ||
| 746 | (let (cat-added) | 751 | (let (cat-added) |
| 747 | (unwind-protect | 752 | (unwind-protect |
| 748 | (setq todo-category-number | 753 | (setq todo-category-number |