[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[mhc:02181] Re: mhc-goto-date
乃村さんへ
Message-Id: <20051127232633K.nom@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 27 Nov 2005 23:26:33 +0900
From: Yoshinari Nomura <nom@xxxxxxxxxxxxx>
Subject: [mhc:02179] Re: mhc-goto-date
| mhc-goto-date は,キーには割当てないという話だったでしょうか?
C-c.g(mhc-goto-month)の置き換えでもよいのではという話がありました。
置き換えた場合、
mhc-goto-monthだと 年月 だけ入力すればよかったのが
mhc-goto-dateだと 年月日 を入力しなければならなくなります。
まだキーは空いているのでC-c.jあたりに割り当てるのでどうでしょうか。
| current は,半端な状態になってそうなので,cleanup したコードを
mhc-goto-dateの件ではレポジトリをいじっていないとおもいます。
| patch の形でいただけないでしょうか.
mhc.elにmhc-goto-dateを入れるパッチを添付します。
mhc-goto-monthで
月表示になるのがよいか
calendarを表示するのがよいか
わからなかったので
変数mhc-goto-date-funcで変更できるようにしてみました。
つかっていて気になることがあるのですが
過去の日付にジャンプしようとしても
guess機能は未来指向なのでguessの年が期待したとおりにならず
ミニバッファで手直しが必要になります。
--
KOIE Hidetaka <hide@xxxxxxxx>
Index: mhc.el
===================================================================
RCS file: /cvsroot/mhc/emacs/mhc.el,v
retrieving revision 1.89
diff -u -F^(def -F^[A-Z_a-z][0-9A_Z_a-z]*( -r1.89 mhc.el
--- mhc.el 15 May 2005 12:04:55 -0000 1.89
+++ mhc.el 28 Nov 2005 10:54:58 -0000
@@ -80,6 +80,7 @@ (defvar mhc-mode-menu-spec
["Next month" mhc-goto-next-month t]
["Prev month" mhc-goto-prev-month t]
["Goto month" mhc-goto-month t]
+ ["Goto date" mhc-goto-date t]
["Import" mhc-import t]
["Set category" mhc-set-default-category t]
"----"
@@ -122,6 +123,7 @@ (defvar mhc-prefix-map nil "Keymap for '
(setq mhc-mode-map (make-sparse-keymap))
(setq mhc-prefix-map (make-sparse-keymap))
(define-key mhc-prefix-map "g" 'mhc-goto-month)
+ (define-key mhc-prefix-map "j" 'mhc-goto-date)
(define-key mhc-prefix-map "." 'mhc-goto-this-month)
(define-key mhc-prefix-map "n" 'mhc-goto-next-month)
(define-key mhc-prefix-map "p" 'mhc-goto-prev-month)
@@ -164,6 +166,7 @@ (defun mhc-mode (&optional arg) "\
\\[mhc-goto-next-month] Review the schedule of next month
\\[mhc-goto-prev-month] Review the schedule of previous month
\\[mhc-goto-month] Jump to your prefer month
+\\[mhc-goto-date] Jump to your prefer date
\\[mhc-rescan-month] Rescan the buffer of the month
\\[mhc-goto-today] Move cursor to today (Only available reviewing this month)
\\[mhc-import] Register the reviewing mail to schdule
@@ -176,7 +179,7 @@ (defun mhc-mode (&optional arg) "\
\\[mhc-calendar-toggle-insert-rectangle] Toggle 3 months calendar
\\[mhc-reset] Reset MHC
- '\\[universal-argument]' prefix is available on using '\\[mhc-rescan-month]', '\\[mhc-goto-this-month]', '\\[mhc-goto-month]'
+ '\\[universal-argument]' prefix is available on using '\\[mhc-rescan-month]', '\\[mhc-goto-this-month]', '\\[mhc-goto-month]', '\\[mhc-goto-date]'
, it works to assign the category (see below).
The prefix arg '\\[mhc-goto-next-month]', '\\[mhc-goto-prev-month]' is also available and you can indicate
@@ -186,7 +189,7 @@ (defun mhc-mode (&optional arg) "\
X-SC-Category:
Space-seperated Keywords. You can set default category to scan.
- You can also indicate keywords by typing C-cs C-c. C-cg with C-u.
+ You can also indicate keywords by typing '\\[mhc-rescan-month]', '\\[mhc-goto-this-month]', '\\[mhc-goto-month]', '\\[mhc-goto-date]' with C-u.
"
(interactive "P")
(make-local-variable 'mhc-mode)
@@ -371,6 +374,37 @@ (defun mhc-goto-month (&optional date hi
mhc-default-category-predicate-sexp
hide-private))
+(defvar mhc-goto-date-func 'mhc-goto-date-calendar)
+ ; or mhc-goto-date-summary
+(defun mhc-goto-date (&optional hide-private)
+ "*Show schedules of specified date.
+If HIDE-PRIVATE, private schedules are suppressed."
+ (interactive
+ (list
+ (if mhc-default-hide-private-schedules
+ (not current-prefix-arg)
+ current-prefix-arg)))
+ (let* ((owin (get-buffer-window (current-buffer)))
+ (buf (mhc-summary-get-import-buffer))
+ (win (if buf (get-buffer-window buf) nil))
+ date)
+ (save-excursion
+ (when win (select-window win))
+ (setq date (car (mhc-input-day "Date: " (mhc-date-now) (mhc-guess-date))))
+ (select-window owin))
+ (funcall mhc-goto-date-func date hide-private)))
+(defun mhc-goto-date-calendar (date hide-private)
+ (mhc-calendar-goto-month date))
+(defun mhc-goto-date-summary (date hide-private)
+ ;; XXX mhc-calendar-scanのパクリです
+ (mhc-goto-month date hide-private)
+ (goto-char (point-min))
+ (if (mhc-summary-search-date date)
+ (progn
+ (beginning-of-line)
+ (if (not (pos-visible-in-window-p (point)))
+ (recenter)))))
+
(defun mhc-goto-this-month (&optional hide-private)
"*Show schedules of this month.
If HIDE-PRIVATE, private schedules are suppressed."