From 65f48241063f9e171d518fc6f72bed05e3e57f4d Mon Sep 17 00:00:00 2001 From: John Sullivan Date: Sun, 29 Jun 2008 23:59:12 -0400 Subject: [PATCH] (planner-create-note): Fix for #10196, make sure that newly created notes get the right number. --- ChangeLog | 3 +++ planner.el | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f29aa25..85de29e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-06-29 John Sullivan + * 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. diff --git a/planner.el b/planner.el index 3a7776d..d4eb872 100644 --- a/planner.el +++ b/planner.el @@ -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) -- 2.11.4.GIT