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

[mhc:02090] mhc.el patch (Re: Re: X-SC-Next フィールドの方針について)



野口です。

# X-SC-Next: が今後もありつづけるのかどうかわからないので、提案する意
# 義があるのかどうか不明ですが...
# 私には*今*欲しい機能だったので

> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 会議名:グループ報告会@123会議室
> 4/14 13:00-14:00  田中さん報告
> 5/20 10:00-12:00  鈴木さん報告
> 6/18 10:00-12:00  井上さん報告
> 7/19 10:00-12:00  竹下さん報告
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

私の周囲では、上記書式のスケジュールが回ることが度々あり、現状 C-c . |
で登録する際には、 「X-SC-Next を使っての同一登録で複数[location,
date, time] の登録」ができなさそう(draftバッファ内で後から追記するしか
ない?)だったので、mhc-edit() に添付のような手を加えました。


(setq mhc-do-register-xsc-next t) としておくと
"C-c . |" や "C-c . e" の際に、必要分の(location, date, time)を登録で
きます。

mhc-do-register-xsc-next のデフォルト値は nil で、t に設定しない限り
今まで通りの挙動をするようにしているつもりです。


不要なものかもしれませんが、せっかく作ったので提案いたします。
御検討いただければ幸いです。
-- 
NOGUCHI Yusuke <nogunogu@xxxxxxxxxxxxxxxxx>
*** mhc.el.org1	Mon Feb 14 14:23:10 2005
--- mhc.el	Thu Apr  7 14:51:33 2005
***************
*** 561,566 ****
--- 561,571 ----
  			 (const :tag "Category" category)
  			 (const :tag "Alarm" alarm))))
  
+ (defcustom mhc-do-register-xsc-next nil
+   ""
+   :group 'mhc
+   :type 'boolean)
+ 
  (defun mhc-edit (&optional import-buffer)
    "Edit a new schedule.
  If optional argument IMPORT-BUFFER is specified, import its content.
***************
*** 572,578 ****
    (let ((draft-buffer (generate-new-buffer mhc-draft-buffer-name))
  	(current-date (or (mhc-current-date) (mhc-calendar-get-date)))
  	(succeed t)
! 	msgp date time subject location category priority alarm)
      (and (interactive-p)
  	 (mhc-window-push))
      (set-buffer draft-buffer)
--- 577,584 ----
    (let ((draft-buffer (generate-new-buffer mhc-draft-buffer-name))
  	(current-date (or (mhc-current-date) (mhc-calendar-get-date)))
  	(succeed t)
! 	msgp date time subject location category priority alarm
! 	(next-entry-list ()))
      (and (interactive-p)
  	 (mhc-window-push))
      (set-buffer draft-buffer)
***************
*** 652,657 ****
--- 658,682 ----
  				  (mhc-input-alarm
  				   "Alarm: "
  				   mhc-default-alarm))))))
+ 		    (if mhc-do-register-xsc-next
+ 			(while (y-or-n-p 
+ 				"More Schedule (date,time,location)? ")
+ 			  (let (date-tmp time-tmp loc-tmp)
+ 			    (setq date-tmp
+ 				  (mhc-input-day "Date: "
+ 						 current-date
+ 						 (mhc-guess-date)))
+ 			    (setq time-tmp
+ 				  (mhc-input-time "Time: "
+ 						  (mhc-schedule-time-as-string
+ 						   schedule)
+ 						  (mhc-guess-time
+ 						   (mhc-minibuf-candidate-nth-begin))))
+ 			    (setq loc-tmp
+ 				 (mhc-input-location "Location: "
+ 				  (mhc-schedule-location schedule)))
+ 			    (setq next-entry-list 
+ 				  (cons (list date-tmp time-tmp loc-tmp) next-entry-list)))))
  		    ;;
  		    (setq priority (mhc-schedule-priority schedule)))
  		;; Answer was no.
***************
*** 678,684 ****
  		(setq category (mhc-input-category "Category: ")))
  	       ((eq input 'alarm)
  		(if mhc-ask-alarm
! 		    (setq alarm (mhc-input-alarm "Alarm: " mhc-default-alarm))))))))
        ;; Quit.
        (quit
         (and (interactive-p)
--- 703,718 ----
  		(setq category (mhc-input-category "Category: ")))
  	       ((eq input 'alarm)
  		(if mhc-ask-alarm
! 		    (setq alarm (mhc-input-alarm "Alarm: " mhc-default-alarm))))))
! 	    (if mhc-do-register-xsc-next
! 		(while (y-or-n-p "More Schedule (date,time,location)? ")
! 		  (let (date-tmp time-tmp loc-tmp)
! 		    (progn 
! 		      (setq date-tmp (mhc-input-day "Date: " current-date))
! 		      (setq time-tmp (mhc-input-time "Time: "))
! 		      (setq loc-tmp (mhc-input-location "Location: "))
! 		      (setq next-entry-list (cons (list date-tmp time-tmp loc-tmp) next-entry-list))))))
! 	    ))
        ;; Quit.
        (quit
         (and (interactive-p)
***************
*** 723,728 ****
--- 757,789 ----
  			 (if begin (mhc-time-to-string begin) "")
  			 (if end (concat "-" (mhc-time-to-string end)) "")))
  		    "")
+ 		  )
+ 	  (if next-entry-list
+ 	      (let (date time location)
+ 		(while next-entry-list
+ 		  (setq date (car (car next-entry-list)))
+ 		  (setq time (car (cdr (car next-entry-list))))
+ 		  (setq location (car (cdr (cdr (car next-entry-list)))))
+ 		  (insert 
+ 		   "\nX-SC-Next: "
+ 		   "\nX-SC-Location: " location
+ 		   "\nX-SC-Day: "
+ 		   (mapconcat
+ 		    (lambda (day)
+ 		      (mhc-date-format day "%04d%02d%02d" yy mm dd))
+ 		    date " ")
+ 		   "\nX-SC-Time: "
+ 		   (if time
+ 		       (let ((begin (car time))
+ 			     (end (nth 1 time)))
+ 			 (concat
+ 			  (if begin (mhc-time-to-string begin) "")
+ 			  (if end (concat "-" (mhc-time-to-string end)) "")))
+ 		     "")
+ 		   )
+ 		  (setq next-entry-list (cdr next-entry-list)))
+ 	      ))
+ 	  (insert
  		  "\nX-SC-Category: "
  		  (mapconcat (function capitalize) category " ")
  		  "\nX-SC-Priority: " (if priority