From: John Sullivan Date: Mon, 30 Jun 2008 03:59:12 +0000 (-0400) Subject: (planner-create-note): Fix for #10196, make sure that newly created notes get the... X-Git-Url: https://repo.or.cz/w/planner-el.git/commitdiff_plain/65f48241063f9e171d518fc6f72bed05e3e57f4d (planner-create-note): Fix for #10196, make sure that newly created notes get the right number. --- 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)