[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[mhc:02092] patch for X-SC-Priority
野口です。
度々申し訳ありません。先ほどお送りした patch に一部不備がありましたの
で再送致します。(mhc-input-sequences に対する変更が抜けていました)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
mhc-edit() (C-c . |, C-c . e)の際、minibuf で X-SC-Priority も登録で
きるようにする patch を作ってみました。
(setq mhc-ask-priority t)
とした時のみ機能するようにしたつもりです。
以上、御検討いただければ幸いです。
--
NOGUCHI Yusuke <nogunogu@xxxxxxxxxxxxxxxxx>
*** mhc.el.org3 Fri Apr 8 20:00:26 2005
--- mhc.el Fri Apr 8 19:31:38 2005
***************
*** 559,565 ****
(const :tag "Subject" subject)
(const :tag "Location" location)
(const :tag "Category" category)
! (const :tag "Alarm" alarm))))
(defcustom mhc-do-register-xsc-next nil
""
--- 559,566 ----
(const :tag "Subject" subject)
(const :tag "Location" location)
(const :tag "Category" category)
! (const :tag "Alarm" alarm)
! (const :tag "Priority" priority))))
(defcustom mhc-do-register-xsc-next nil
""
***************
*** 657,663 ****
(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)? ")
--- 658,671 ----
(setq alarm
(mhc-input-alarm
"Alarm: "
! mhc-default-alarm))))
! ;; input priority
! ((eq input 'priority)
! (if mhc-ask-priority
! (setq priority
! (mhc-input-priority
! "Priority: "
! nil))))))
(if mhc-do-register-xsc-next
(while (y-or-n-p
"More Schedule (date,time,location)? ")
***************
*** 678,684 ****
(setq next-entry-list
(cons (list date-tmp time-tmp loc-tmp) next-entry-list)))))
;;
! (setq priority (mhc-schedule-priority schedule)))
;; Answer was no.
(message "") ; flush minibuffer.
(and (interactive-p)
--- 686,693 ----
(setq next-entry-list
(cons (list date-tmp time-tmp loc-tmp) next-entry-list)))))
;;
! ; (setq priority (mhc-schedule-priority schedule))
! )
;; Answer was no.
(message "") ; flush minibuffer.
(and (interactive-p)
***************
*** 703,709 ****
(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)
--- 712,721 ----
(setq category (mhc-input-category "Category: ")))
((eq input 'alarm)
(if mhc-ask-alarm
! (setq alarm (mhc-input-alarm "Alarm: " mhc-default-alarm))))
! ((eq input 'priority)
! (if mhc-ask-priority
! (setq priority (mhc-input-priority "Priority: "))))))
(if mhc-do-register-xsc-next
(while (y-or-n-p "More Schedule (date,time,location)? ")
(let (date-tmp time-tmp loc-tmp)
***************
*** 787,793 ****
"\nX-SC-Category: "
(mapconcat (function capitalize) category " ")
"\nX-SC-Priority: " (if priority
! (number-to-string priority)
"")
"\nX-SC-Cond: "
"\nX-SC-Duration: "
--- 799,807 ----
"\nX-SC-Category: "
(mapconcat (function capitalize) category " ")
"\nX-SC-Priority: " (if priority
! (if (stringp priority)
! priority
! (number-to-string priority))
"")
"\nX-SC-Cond: "
"\nX-SC-Duration: "
*** mhc-minibuf.el.org1 Thu Mar 17 15:59:34 2005
--- mhc-minibuf.el Fri Apr 8 19:26:39 2005
***************
*** 351,356 ****
--- 351,374 ----
(beep)))))
+ (defvar mhc-priority-hist nil)
+ (defun mhc-input-priority (&optional prompt default)
+ (interactive)
+ (let (pri)
+ (catch 'ok
+ (while t
+ (setq pri (read-from-minibuffer
+ (concat (or prompt "Priority: ") "(from 0 to 100, or none) ")
+ (or default "")
+ nil nil mhc-priority-hist))
+ (cond
+ ((string-match "[0-9]+" pri)
+ (throw 'ok (string-to-number pri)))
+ ((string= "" pri)
+ (throw 'ok nil))
+ (t
+ (beep)))))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; input x-sc- schedule data from minibuffer.
*** mhc-vars.el.org0 Thu Jan 20 02:10:04 2005
--- mhc-vars.el Fri Apr 8 19:26:06 2005
***************
*** 132,137 ****
--- 132,142 ----
:group 'mhc
:type 'boolean)
+ (defcustom mhc-ask-priority nil
+ "*If non-nil value, ask the priority value in making draft."
+ :group 'mhc
+ :type 'boolean)
+
(provide 'mhc-vars)
;;; Copyright Notice: