Fix #11948. Narrow to tasks section when carrying tasks forward.
authorJohn Sullivan <johns@fsf.org>
Wed, 18 Feb 2009 15:57:21 +0000 (18 10:57 -0500)
committerJohn Sullivan <johns@fsf.org>
Wed, 18 Feb 2009 15:57:21 +0000 (18 10:57 -0500)
ChangeLog
planner.el

index 1b41813..5183ad1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-18  John Sullivan  <john@wjsullivan.net>
+
+       * planner.el (plan): When carrying tasks forward, narrow to the
+       tasks section first instead of looking at the whole page. Closes
+       #11948. This should also improve performance a good deal for
+       everyone using `planner-carry-tasks-forward'.
+
 2009-02-17  John Sullivan  <john@wjsullivan.net>
 
        * planner-multi.el (planner-multi-read-name): I don't think the
index 259f70f..94a73ce 100644 (file)
@@ -3274,8 +3274,10 @@ instead, except t means scan only yesterday."
               ;; Attempt to copy all the tasks
               (when (not (equal today (planner-page-name)))
                 (let ((planner-tasks-file-behavior nil))
-                  (planner-copy-or-move-region (point-min) (point-max)
-                                               (planner-today) t))
+                  (save-restriction
+                    (planner-narrow-to-section 'tasks)
+                    (planner-copy-or-move-region (point-min) (point-max)
+                                                 (planner-today) t)))
                 (unless (buffer-modified-p)
                   (kill-buffer (current-buffer))))
               (setq names (cdr names))))