[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[mhc:00353] mhc-db-base-folder customize
元木です。
mhc のデータ置場が +schedule の下でなくても大丈夫にして
みました(そのつもりです)。
mhc-db-base-mail-dir と mhc-db-base-folder から mhc-db-base-dir を生成し、
他は "+schedule" とhard coding されているところを変更しただけなので、
抜けがあるかもしれません。
それに伴い、defconst -> defvar に変更になっている場所があります。
あと、予定を変更して refile するときの確認メッセージが
absolute path で表示されるために、右端が切れてしまうので、
+schedule/2000/01 のような表示に変更してみました。
━━━━━━━━━━━━………‥・・ ・ ・ .
元木 顕弘 / Akihiro Motoki ・ ☆
E-mail: mokkun@xxxxxxxxx, mokkun@xxxxxxxxxxx ・ .
motoki@xxxxxxxxxxxxxxxxx ・・
diff -urN mhc-20000112.orig/mhc-schedule.el mhc/mhc-schedule.el
--- mhc-20000112.orig/mhc-schedule.el Fri Jan 7 13:38:38 2000
+++ mhc/mhc-schedule.el Tue Jan 25 21:45:54 2000
@@ -616,10 +616,12 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; schedule DB
-(defconst mhc-db-base-mail-dir (expand-file-name "~/Mail"))
-(defconst mhc-db-base-dir (expand-file-name "~/Mail/schedule"))
-(defconst mhc-db-base-folder "+schedule")
-(defconst mhc-db-rc-file (expand-file-name "~/.schedule"))
+(defvar mhc-db-base-mail-dir (expand-file-name "~/Mail"))
+(defvar mhc-db-base-folder "+schedule")
+(defvar mhc-db-base-dir (if (eq (string-to-char mhc-db-base-folder) ?+)
+ (expand-file-name (substring mhc-db-base-folder 1)
+ mhc-db-base-mail-dir)))
+(defvar mhc-db-rc-file (expand-file-name "~/.schedule"))
(defvar mhc-db-alist ())
(defun mhc-db-date-to-slot (date)
@@ -768,12 +770,16 @@
(let ((old-slot (mhc-sch-old-slot sch))
(old-path (mhc-sch-path sch))
(new-slot (mhc-sch-new-slot sch))
+ (maildir (concat mhc-db-base-mail-dir "/"))
new-path)
(if (and old-slot (equal old-slot new-slot))
(setq new-path old-path)
(setq new-path (mhc-misc-get-new-path new-slot)))
;; save buffer contents to the new-path
- (if (not (y-or-n-p (format "Refile %s to %s " (or old-slot "") new-slot)))
+ (if (not (y-or-n-p
+ (format "Refile %s to %s "
+ (mhc-misc-sub (or old-slot "") maildir "+")
+ (mhc-misc-sub new-slot maildir "+"))))
nil ;; return value
(if buffer (mhc-misc-copy-buffer-to-file buffer new-path))
(mhc-db-scan-slot new-slot)
diff -urN mhc-20000112.orig/mhc.el mhc/mhc.el
--- mhc-20000112.orig/mhc.el Wed Jan 12 17:50:22 2000
+++ mhc/mhc.el Tue Jan 25 21:45:12 2000
@@ -384,7 +384,7 @@
()
;;; xxx experimental
(if mhc-insert-calendar
- (mhc-cal-insert-rectangle-at ddate (- (window-width) 26)))
+ (mhc-cal-insert-rectangle-at ddate (- (window-width) 24)))
(mhc-goto-today)
(cond
((equal type 'mew)
@@ -444,7 +444,7 @@
(regexp-quote
(file-name-as-directory mhc-db-base-mail-dir))) path))
(concat "+" (substring path (match-end 0)))
- "+schedule/1970/01/0"))
+ (format "%s/%s" mhc-db-base-folder "1970/01/0")))
(concat
(directory-file-name (file-name-directory fld-msg)) " "
(file-name-nondirectory fld-msg))))
@@ -460,10 +460,9 @@
(format "2%05d" (string-to-int (file-name-nondirectory path)))))))
(defun mhc-wl-ddate-to-folder (ddate)
- (concat "*"
- "+schedule/intersect"
- ","
- "+schedule/" (ddate-yymm-s1 ddate "/")))
+ (format "*%s/intersect,%s/%s"
+ mhc-db-base-folder mhc-db-base-folder
+ (ddate-yymm-s1 ddate "/")))
;; (setq debug-on-error t)
;; (mhc-sch-scan-month (ddate-now) 'wl nil nil nil)
@@ -694,7 +693,7 @@
(interactive)
(read-from-minibuffer (or prompt "Location: ")
(or default "")
- nil nil 'mhc-location))
+ nil nil 'mhc-location-hist))
(defvar mhc-category-hist nil)
@@ -807,7 +806,8 @@
;; manupulate data from mhc-summary-buffer.
(defconst mhc-summary-day-regex "^[^|]+| +[0-9]+/\\([0-9]+\\)")
-(defconst mhc-summary-buf-regex "+schedule/\\([0-9]+\\)/\\([0-9]+\\)") ;; xxx
+(defvar mhc-summary-buf-regex
+ (concat mhc-db-base-folder "/\\([0-9]+\\)/\\([0-9]+\\)")) ;; xxx
(defconst mhc-summary-filename-regex
".*\r *\\+\\([^ \t]+\\)[ \t]+\\([^ \t\n]+\\)")
@@ -876,7 +876,7 @@
1))))
(defun mhc-ddate-to-buffer (ddate)
- (concat "+schedule/" (ddate-yymm-s1 ddate "/")))
+ (format "%s/%s" mhc-db-base-folder (ddate-yymm-s1 ddate "/")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; make rectangle like calendar.el