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

[mhc:01672] Re: カレンダのフォーマット



CWとは直接関係ないですが
mhc-calendar-count-days-region()を
週も表示するようにしてみました。

Index: mhc-calendar.el
===================================================================
RCS file: /cvsroot/mhc/emacs/mhc-calendar.el,v
retrieving revision 1.33
diff -u -F^( -r1.33 mhc-calendar.el
--- mhc-calendar.el	2002/09/25 03:41:01	1.33
+++ mhc-calendar.el	2002/10/02 04:22:05
@@ -899,7 +899,12 @@ (defun mhc-calendar-count-days-region ()
 	(error "No mark set in this buffer")
       (setq date (mhc-date++ (mhc-date- (max mark date) (min mark date))))
       (kill-new (int-to-string date))
-      (message "%d days in region." date))))
+      (if (< date 7)
+          (message "%d days in region." date)
+        (if (= (% date 7) 0)
+            (message "%d days (%d weeks) in region." date (/ date 7))
+          (message "%d days (%d weeks + %d days) in region."
+                   date (/ date 7) (% date 7)))))))
 
 ;; selector
 (defvar mhc-calendar/select-alist nil)


#欲をいえば、休日とを除いて日数をカウントする機能がほしい。

--
KOIE Hidetaka 鯉江英隆 <hide@xxxxxxxx>