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

[mhc:02199] Re: mhcのTodoカテゴリについて



# リハビリ、リハビリ。

From: Takuo Tanaka <t-tanaka@xxxxxxxx> さん曰く
Subject: [mhc:02198] mhcのTodoカテゴリについて
Message-ID: <532A34B6-51A4-43D8-B745-2ADBADA955B1@xxxxxxxx>
Date: Mon, 24 Apr 2006 23:46:32 +0900

> カテゴリに,"Todo"と書くと,スケジュール表の下に項目一覧が 
> 作成されて,やるべき項目が列挙されます.
> 今日現在より過去の"Todo"項目には,"XX days  
> overdue"と表示されますが,これと同時に,過去の"Todo"項目全 
> てを自動的に本日の予定に日付をシフトさせて表示させることはできな 
> いでしょうか?

なるほど。こんな感じになればよいのでしょうか?

表示フォーマットは調整が必要(というか新たに作らないとみっともな
い)、とか、まだまだ未完成ですが、感想をお聞かせ下さい。

## MHC はリハビリには難しい :-p

-- 
白井秀行 (mailto:shirai@xxxxxxxxxxxxx)



--- mhc-summary.el	07 Oct 2004 18:56:11 +0900	1.53
+++ mhc-summary.el	25 Apr 2006 12:29:41 +0900	
@@ -249,6 +249,11 @@
   :group 'mhc
   :type 'boolean)
 
+(defcustom mhc-insert-overdue-todo t
+  "*Display overdue TODO on TODAY."
+  :group 'mhc
+  :type 'boolean)
+
 (defcustom mhc-memo-line-format "   %p %i%s %l"
   "*A format string for summary memo line of MHC.
 It may include any of the following format specifications
@@ -636,13 +641,35 @@
 
 (defun mhc-summary-make-contents
   (from to mailer &optional category-predicate secret)
-  (let ((dayinfo-list (mhc-db-scan from to)))
+  (let ((dayinfo-list (mhc-db-scan from to))
+	todo-list overdue deadline mhc-tmp-day)
     (setq mhc-summary/today (mhc-date-now))
     (while dayinfo-list
       (mhc-summary/insert-dayinfo
        (car dayinfo-list) mailer
        (or category-predicate mhc-default-category-predicate-sexp)
        secret)
+      (when (and mhc-insert-overdue-todo
+		 (mhc-date= (mhc-day-date (car dayinfo-list)) mhc-summary/today))
+	(setq todo-list (mhc-db-scan-todo mhc-summary/today))
+	(while todo-list
+	  (setq deadline (mhc-schedule-todo-deadline (car todo-list)))
+	  (when (and deadline
+		     (> (mhc-date- mhc-summary/today deadline) 0)
+		     (not (mhc-schedule-in-category-p (car todo-list) "done")))
+	    (setq overdue (cons (car todo-list) overdue)))
+	  (setq todo-list (cdr todo-list)))
+	(setq mhc-tmp-day mhc-summary/today)
+	(setq overdue (nreverse overdue))
+	(while overdue
+	  (mhc-summary-insert-contents
+	   (car overdue)
+	   (and secret
+		(mhc-schedule-in-category-p (car overdue)
+					    mhc-category-as-private))
+	   'mhc-todo-line-insert
+	   mailer)
+	  (setq overdue (cdr overdue))))
       (and mhc-use-week-separator
 	   (eq (mhc-day-day-of-week (car dayinfo-list))
 	       (mhc-end-day-of-week))