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

[mhc:00293] multiple histories (was Re: mhc-insert-schedule, per-week support, and view by category)



History 関係のコードを間違えてしまいました。(^^;

(defvar mhc-month-hist nil)

> (defun mhc-input-month (prompt)
>   (let ((ret nil) (month-str (ddate-yymm-s1 (ddate-now) "/")))
>     (while (null ret)
>       (setq month-str 
> 	    (read-from-minibuffer
> 	     (concat prompt "(yyyy/mm) : ") month-str nil nil mhc-month-hist))
                                                              ^^^^^^^^^^^^^^
                                                              'mhc-month-hist
>       (if (string-match "\\([0-9]+\\)/\\([0-9]+\\)" month-str)
> 	  (setq ret(ddate-new (ddate-substring-to-int month-str 1)
> 			      (ddate-substring-to-int month-str 2) 1 t))))
>     ret))

のはずです。ごめんなさい m(__)m

複数 History のお試し版のパッチを作成してみました。

# mhc-input-time あたりは対応してないです。
--- mhc-snap19991211/emacs/mhc.el	Sat Dec 11 17:58:16 1999
+++ mhc-snap19991211a/emacs/mhc.el	Tue Dec 14 19:08:33 1999
@@ -124,12 +124,14 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; goto-*
 
+(defvar mhc-month-hist nil)
+
 (defun mhc-input-month (prompt)
   (let ((ret nil) (month-str (ddate-yymm-s1 (ddate-now) "/")))
     (while (null ret)
       (setq month-str 
 	    (read-from-minibuffer
-	     (concat prompt "(yyyy/mm) : ") month-str))
+	     (concat prompt "(yyyy/mm) : ") month-str nil nil 'mhc-month-hist))
       (if (string-match "\\([0-9]+\\)/\\([0-9]+\\)" month-str)
 	  (setq ret(ddate-new (ddate-substring-to-int month-str 1)
 			      (ddate-substring-to-int month-str 2) 1 t))))
@@ -579,11 +581,15 @@
     ;;(mhc-sch-set-duration  sch (mhc-input-duration))
   sch))
 
+(defvar mhc-subject-hist nil)
 
 (defun mhc-input-subject (&optional prompt default)
   (interactive)
   (read-from-minibuffer  (or prompt "Subject: ")
-			 (or default "")))
+			 (or default "")
+			 nil nil 'mhc-subject-hist))
+
+(defvar mhc-category-hist nil)
 
 (defun mhc-input-category (&optional prompt default)
   (interactive)
@@ -591,16 +597,19 @@
     (if (and default (listp default))
 	(setq default (mhc-misc-join default " ")))
     (if (string= "" (setq in (read-from-minibuffer  (or prompt "Category: ")
-						    (or default ""))))
+						    (or default "")
+						    nil nil 'mhc-category-hist)))
 	nil
       (mhc-misc-split in))))
 
+(defvar mhc-duration-hist nil)
+
 (defun mhc-input-duration (&optional prompt default)
   (interactive)
   (let ((str (or default "")) date-b date-e)
     (catch 'ok
       (while t
-	(setq str (read-from-minibuffer (concat (or prompt "") "Date: ") str))
+	(setq str (read-from-minibuffer (concat (or prompt "") "Date: ") str nil nil 'mhc-duration-hist))
 	(cond 
 	 ((and (string-match
 		"^\\([0-9]+/[0-9]+/[0-9]+\\)-\\([0-9]+/[0-9]+/[0-9]+\\)$" str)
@@ -779,6 +788,8 @@
      ))
   (exchange-point-and-mark))
 
+(defvar mhc-date-hist nil)
+
 (defun mhc-input-date (&optional prompt default)
   (interactive)
   (let* ((ddate (or default (ddate-now)))
@@ -786,7 +797,8 @@
     ;; input ddate string.
     (setq in (read-from-minibuffer
 	      (concat (or prompt "") " (yyyy/mm/dd) : ")
-	      (ddate-to-s1 ddate "/")))
+	      (ddate-to-s1 ddate "/")
+	      nil nil 'mhc-date-hist))
     ;; check format
     (if (not (string-match
 	      "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)"