emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 b9f02cf 1/2: Fixes: debbugs:20832


From: Stephen Berman
Subject: [Emacs-diffs] emacs-24 b9f02cf 1/2: Fixes: debbugs:20832
Date: Fri, 19 Jun 2015 15:11:24 +0000

branch: emacs-24
commit b9f02cf65a1b41e486f412e6f98644f298129d55
Author: Nicolas Richard <address@hidden>
Commit: Stephen Berman <address@hidden>

    Fixes: debbugs:20832
    
    * lisp/calendar/todo-mode.el (todo-show): Signal an error
    if buffer for adding new todo file is empty but modified.
---
 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 dcc960f..6e97524 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]