(planner-create-note): Fix for #10196, make sure that newly created notes get the...
authorJohn Sullivan <johnsu01@wjsullivan.net>
Mon, 30 Jun 2008 03:59:12 +0000 (29 23:59 -0400)
committerJohn Sullivan <johnsu01@wjsullivan.net>
Mon, 30 Jun 2008 03:59:12 +0000 (29 23:59 -0400)
ChangeLog
planner.el

index f29aa25..85de29e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-06-29  John Sullivan  <john@wjsullivan.net>
 
+       * planner.el (planner-create-note): Fix for #10196, make sure that
+       newly created notes get the right number.
+
        * planner-el.texi (Keeping Track of Time): Recover paragraph that
        had been lost sometime in 2005.
 
index 3a7776d..d4eb872 100644 (file)
@@ -2505,8 +2505,8 @@ the end.  Position point after the anchor."
     (when (planner-narrow-to-section 'notes)
       (let ((total 0))
         (goto-char (point-min))
-        (while (re-search-forward "^\\.#[0-9]+\\s-+" nil t)
-          (setq total (1+ total)))
+        (while (re-search-forward "^\.#\\([0-9]+\\)\\s-+" nil t)
+          (setq total (max total (string-to-number (match-string 1)))))
         (if planner-reverse-chronological-notes
             (progn (goto-char (point-min))
                    (forward-line 1)