mhc 1.1.1 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +1 -1
- data/bin/mhc +82 -3
- data/emacs/Cask +1 -1
- data/emacs/mhc-calendar.el +7 -5
- data/emacs/mhc-date.el +5 -12
- data/emacs/mhc-day.el +1 -1
- data/emacs/mhc-db.el +57 -38
- data/emacs/mhc-draft.el +36 -22
- data/emacs/mhc-face.el +1 -1
- data/emacs/mhc-header.el +20 -1
- data/emacs/mhc-minibuf.el +12 -7
- data/emacs/mhc-parse.el +1 -1
- data/emacs/mhc-process.el +26 -9
- data/emacs/mhc-ps.el +1 -1
- data/emacs/mhc-record.el +1 -1
- data/emacs/mhc-schedule.el +5 -2
- data/emacs/mhc-summary.el +36 -16
- data/emacs/mhc-vars.el +15 -2
- data/emacs/mhc.el +51 -25
- data/lib/mhc.rb +3 -1
- data/lib/mhc/builder.rb +5 -1
- data/lib/mhc/caldav.rb +1 -1
- data/lib/mhc/calendar.rb +5 -1
- data/lib/mhc/command/cache.rb +5 -4
- data/lib/mhc/command/completions.rb +1 -1
- data/lib/mhc/command/init.rb +2 -0
- data/lib/mhc/converter.rb +3 -2
- data/lib/mhc/datastore.rb +52 -13
- data/lib/mhc/date_enumerator.rb +2 -2
- data/lib/mhc/event.rb +42 -21
- data/lib/mhc/formatter.rb +17 -312
- data/lib/mhc/formatter/base.rb +125 -0
- data/lib/mhc/formatter/emacs.rb +47 -0
- data/lib/mhc/formatter/howm.rb +35 -0
- data/lib/mhc/formatter/icalendar.rb +17 -0
- data/lib/mhc/formatter/json.rb +27 -0
- data/lib/mhc/formatter/mail.rb +20 -0
- data/lib/mhc/formatter/org_table.rb +24 -0
- data/lib/mhc/formatter/symbolic_expression.rb +42 -0
- data/lib/mhc/formatter/text.rb +29 -0
- data/lib/mhc/modifier.rb +1 -0
- data/lib/mhc/occurrence.rb +27 -5
- data/lib/mhc/occurrence_enumerator.rb +1 -1
- data/lib/mhc/property_value.rb +6 -0
- data/lib/mhc/property_value/date.rb +23 -14
- data/lib/mhc/property_value/date_time.rb +19 -0
- data/lib/mhc/property_value/integer.rb +5 -1
- data/lib/mhc/property_value/list.rb +7 -6
- data/lib/mhc/property_value/period.rb +3 -1
- data/lib/mhc/property_value/range.rb +1 -1
- data/lib/mhc/property_value/time.rb +8 -1
- data/lib/mhc/version.rb +1 -1
- data/mhc.gemspec +0 -1
- data/samples/japanese-holidays.mhcc +36 -9
- data/spec/mhc_spec.rb +83 -0
- metadata +13 -18
data/emacs/mhc-minibuf.el
CHANGED
@@ -189,7 +189,7 @@
|
|
189
189
|
(if (not (pos-visible-in-window-p b))
|
190
190
|
(recenter))
|
191
191
|
(if (not non-minibuf)
|
192
|
-
(
|
192
|
+
(select-window (minibuffer-window)))
|
193
193
|
;; in minibuffer
|
194
194
|
(if non-minibuf
|
195
195
|
()
|
@@ -254,12 +254,17 @@
|
|
254
254
|
(mhc-date-format default
|
255
255
|
"%04d/%02d/%02d" yy mm dd))
|
256
256
|
((listp default)
|
257
|
-
(
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
257
|
+
(let ((sep " ") (datelist default))
|
258
|
+
(if (null (cdr (last default)))
|
259
|
+
()
|
260
|
+
(setq sep "-")
|
261
|
+
(setq datelist (list (car default) (cdr default))))
|
262
|
+
(mapconcat
|
263
|
+
(lambda (date)
|
264
|
+
(mhc-date-format date
|
265
|
+
"%04d/%02d/%02d" yy mm dd))
|
266
|
+
datelist
|
267
|
+
sep)))
|
263
268
|
(t
|
264
269
|
nil)))
|
265
270
|
(current-buffer)
|
data/emacs/mhc-parse.el
CHANGED
data/emacs/mhc-process.el
CHANGED
@@ -1,34 +1,51 @@
|
|
1
|
-
(
|
1
|
+
(require 'mhc-vars)
|
2
2
|
|
3
|
-
(
|
3
|
+
(defvar mhc-process nil)
|
4
4
|
|
5
5
|
(defun mhc-process-send-command (command)
|
6
6
|
(unless (and (processp mhc-process)
|
7
7
|
(eq (process-status mhc-process) 'run))
|
8
8
|
(mhc-start-process))
|
9
|
-
(message "COMMAND: %s" command)
|
10
9
|
(with-current-buffer (process-buffer mhc-process)
|
11
10
|
(delete-region (point-min) (point-max))
|
12
11
|
(process-send-string mhc-process (concat command "\n"))
|
13
12
|
(let ((i 1))
|
14
13
|
(while (not (and (> (point-max) 1)
|
15
14
|
(eq (char-after (1- (point-max))) ?\n)))
|
16
|
-
(message (format "Waiting mhc process...%d" i))
|
15
|
+
(if (< 2 i) (message (format "Waiting mhc process...%d" i)))
|
17
16
|
(setq i (1+ i))
|
18
17
|
(accept-process-output mhc-process 0.5)))
|
19
18
|
(read (buffer-substring (point-min) (1- (point-max))))))
|
20
19
|
|
20
|
+
(defun mhc-process-send-command-with-buffer (command buffer)
|
21
|
+
"Send COMMAND to mhc process with BUFFER via temporal file."
|
22
|
+
(let ((temp-file (make-temp-file "mhc")))
|
23
|
+
(unwind-protect
|
24
|
+
(with-current-buffer buffer
|
25
|
+
(mhc-write-region-as-coding-system
|
26
|
+
mhc-default-coding-system
|
27
|
+
(point-min)
|
28
|
+
(point-max)
|
29
|
+
temp-file
|
30
|
+
nil 'nomsg)
|
31
|
+
(mhc-process-send-command
|
32
|
+
(format "%s %s" command temp-file)))
|
33
|
+
(delete-file temp-file))))
|
34
|
+
|
21
35
|
(defun mhc-start-process ()
|
22
36
|
(interactive)
|
23
37
|
(let ((process-connection-type nil)) ;; use PIPE not tty
|
24
38
|
(if (and (processp mhc-process)
|
25
39
|
(eq (process-status mhc-process) 'run))
|
26
40
|
(kill-process mhc-process))
|
27
|
-
(setq mhc-process
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
41
|
+
(setq mhc-process
|
42
|
+
(apply 'start-process
|
43
|
+
(delq nil `("mhc"
|
44
|
+
,(get-buffer-create " *mhc-scan-process*")
|
45
|
+
,mhc-ruby-program-name
|
46
|
+
,mhc-program-name
|
47
|
+
"server"))))
|
48
|
+
(set-process-coding-system mhc-process 'utf-8 'utf-8)
|
32
49
|
(set-process-query-on-exit-flag mhc-process nil)
|
33
50
|
mhc-process))
|
34
51
|
|
data/emacs/mhc-ps.el
CHANGED
data/emacs/mhc-record.el
CHANGED
data/emacs/mhc-schedule.el
CHANGED
@@ -142,7 +142,10 @@
|
|
142
142
|
|
143
143
|
|
144
144
|
(defun mhc-schedule-subject-as-string (schedule)
|
145
|
-
(
|
145
|
+
(let ((subject (mhc-schedule-subject schedule)))
|
146
|
+
(if (eq (length subject) 0)
|
147
|
+
"(no subject)"
|
148
|
+
subject)))
|
146
149
|
|
147
150
|
|
148
151
|
(defun mhc-schedule-categories-as-string (schedule)
|
@@ -199,4 +202,4 @@
|
|
199
202
|
;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
200
203
|
;; OF THE POSSIBILITY OF SUCH DAMAGE.
|
201
204
|
|
202
|
-
;;; mhc-schedule.el ends here
|
205
|
+
;;; mhc-schedule.el ends here
|
data/emacs/mhc-summary.el
CHANGED
@@ -171,6 +171,8 @@ which are replaced by the given information:
|
|
171
171
|
'face mhc-tmp-day-face)
|
172
172
|
(?/ (if mhc-tmp-first "/" " ")
|
173
173
|
'face mhc-tmp-day-face)
|
174
|
+
(?- (if mhc-tmp-first "-" " ")
|
175
|
+
'face mhc-tmp-day-face)
|
174
176
|
(?S " " 'face mhc-tmp-day-face)
|
175
177
|
(?M (mhc-summary/line-month-string)
|
176
178
|
'face mhc-tmp-day-face)
|
@@ -182,7 +184,8 @@ which are replaced by the given information:
|
|
182
184
|
(make-string 5 ? )
|
183
185
|
(format "%02d:%02d" (/ mhc-tmp-begin 60) (% mhc-tmp-begin 60)))
|
184
186
|
'face 'mhc-summary-face-time)
|
185
|
-
(?e (if (null mhc-tmp-end)
|
187
|
+
(?e (if (or (null mhc-tmp-end)
|
188
|
+
(and mhc-tmp-begin (= mhc-tmp-end mhc-tmp-begin)))
|
186
189
|
(make-string 6 ? )
|
187
190
|
(format "-%02d:%02d" (/ mhc-tmp-end 60) (% mhc-tmp-end 60)))
|
188
191
|
'face 'mhc-summary-face-time)
|
@@ -286,15 +289,15 @@ If optional argument FOR-DRAFT is non-nil, Hilight message as draft message."
|
|
286
289
|
(mhc-header-delete-header
|
287
290
|
"^\\(Content-.*\\|Mime-Version\\|User-Agent\\):" 'regexp))
|
288
291
|
(mhc-header-delete-empty-header
|
289
|
-
"^X-SC-.*:" 'regexp)
|
290
|
-
(mhc-message-mode)
|
291
|
-
(mhc-message-set-file-name file))
|
292
|
+
"^X-SC-.*:" 'regexp))
|
292
293
|
;; (setq view-exit-action 'mhc-calendar-view-exit-action)
|
293
294
|
(set-visited-file-name nil)
|
294
295
|
;; (rename-buffer (file-name-nondirectory file) 'unique)
|
295
296
|
;; (run-hooks 'mhc-calendar-view-file-hook)
|
296
297
|
(set-buffer-modified-p nil)
|
297
298
|
(setq buffer-read-only t)
|
299
|
+
(mhc-message-mode)
|
300
|
+
(mhc-message-set-file-name file)
|
298
301
|
)))
|
299
302
|
|
300
303
|
|
@@ -353,7 +356,8 @@ message and cdr keeps a visible message."
|
|
353
356
|
(or (null (setq dayinfo
|
354
357
|
(get-text-property (point) 'mhc-dayinfo)))
|
355
358
|
(not (eq (mhc-day-date dayinfo) date))))
|
356
|
-
(goto-char (next-single-property-change (point) 'mhc-dayinfo)
|
359
|
+
(goto-char (or (next-single-property-change (point) 'mhc-dayinfo)
|
360
|
+
(point-min))))))
|
357
361
|
|
358
362
|
(defun mhc-summary-record (&optional mailer)
|
359
363
|
"Return record on current line."
|
@@ -498,10 +502,10 @@ If BANNER is set, it is printed on the horizontal line."
|
|
498
502
|
|
499
503
|
|
500
504
|
(defun mhc-summary/line-subject-string ()
|
501
|
-
(if mhc-tmp-
|
502
|
-
(
|
503
|
-
|
504
|
-
|
505
|
+
(if mhc-tmp-schedule
|
506
|
+
(if mhc-tmp-private
|
507
|
+
mhc-summary-string-secret
|
508
|
+
(mhc-schedule-subject-as-string mhc-tmp-schedule))))
|
505
509
|
|
506
510
|
(defun mhc-summary/line-location-string ()
|
507
511
|
(let ((location (mhc-schedule-location mhc-tmp-schedule)))
|
@@ -661,20 +665,36 @@ If BANNER is set, it is printed on the horizontal line."
|
|
661
665
|
(defun mhc-summary-buffer-p (&optional buffer)
|
662
666
|
(if buffer
|
663
667
|
(set-buffer buffer))
|
664
|
-
mhc-summary-
|
668
|
+
(eq major-mode 'mhc-summary-mode))
|
665
669
|
|
666
|
-
(defun mhc-summary-current-date ()
|
670
|
+
(defun mhc-summary-current-date (&optional p)
|
667
671
|
(when (mhc-summary-buffer-p)
|
668
|
-
(let ((
|
672
|
+
(let* ((pos (or p (point)))
|
673
|
+
(dayinfo (get-text-property pos 'mhc-dayinfo)))
|
669
674
|
(or (and dayinfo (mhc-day-date dayinfo))
|
670
675
|
(save-excursion
|
671
676
|
(end-of-line)
|
672
|
-
(while (and (
|
677
|
+
(while (and (>= pos (point-min))
|
673
678
|
(null dayinfo))
|
674
|
-
(or (setq dayinfo (get-text-property
|
675
|
-
(
|
679
|
+
(or (setq dayinfo (get-text-property pos 'mhc-dayinfo))
|
680
|
+
(setq pos (- pos 1))))
|
676
681
|
(and dayinfo (mhc-day-date dayinfo)))))))
|
677
682
|
|
683
|
+
(defun mhc-summary-region-date ()
|
684
|
+
(when (region-active-p)
|
685
|
+
(let* ((p (region-beginning))
|
686
|
+
dayinfo
|
687
|
+
(datelist ()))
|
688
|
+
(progn
|
689
|
+
(while (<= p (region-end))
|
690
|
+
(and (setq dayinfo (mhc-summary-current-date p))
|
691
|
+
(setq datelist (cons dayinfo datelist)))
|
692
|
+
(setq p (next-single-property-change p 'mhc-dayinfo)))
|
693
|
+
(setq datelist (reverse (delete-dups datelist)))
|
694
|
+
(if (< 1 (length datelist))
|
695
|
+
(cons (car datelist) (car (last datelist)))
|
696
|
+
(car datelist))))))
|
697
|
+
|
678
698
|
(defvar mhc-summary-buffer-current-date-month nil
|
679
699
|
"Indicate summary buffer's month. It is also used by mhc-summary-buffer-p")
|
680
700
|
(make-variable-buffer-local 'mhc-summary-buffer-current-date-month)
|
@@ -782,4 +802,4 @@ If BANNER is set, it is printed on the horizontal line."
|
|
782
802
|
;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
783
803
|
;; OF THE POSSIBILITY OF SUCH DAMAGE.
|
784
804
|
|
785
|
-
;;; mhc-summary.el ends here
|
805
|
+
;;; mhc-summary.el ends here
|
data/emacs/mhc-vars.el
CHANGED
@@ -13,11 +13,12 @@
|
|
13
13
|
|
14
14
|
;;; Code:
|
15
15
|
(require 'mhc-compat)
|
16
|
-
|
16
|
+
|
17
|
+
(autoload 'mhc-process-send-command "mhc-process")
|
17
18
|
|
18
19
|
|
19
20
|
;;; Constants:
|
20
|
-
(defconst mhc-version "mhc 1.
|
21
|
+
(defconst mhc-version "mhc 1.2.4") ;; MHC_VERSION
|
21
22
|
|
22
23
|
|
23
24
|
;;; Configration Variables:
|
@@ -25,6 +26,18 @@
|
|
25
26
|
"Various sorts of MH Calender."
|
26
27
|
:group 'mail)
|
27
28
|
|
29
|
+
(defcustom mhc-program-name "mhc"
|
30
|
+
"Program name of MHC."
|
31
|
+
:group 'mhc
|
32
|
+
:type 'string)
|
33
|
+
|
34
|
+
(defcustom mhc-ruby-program-name (when (eq system-type 'windows-nt) "ruby")
|
35
|
+
"When non-nil, specify ruby program name.
|
36
|
+
Nil means MHC script is called directly."
|
37
|
+
:group 'mhc
|
38
|
+
:type '(choice (const :tag "Call script directly" nil)
|
39
|
+
string))
|
40
|
+
|
28
41
|
(defcustom mhc-start-day-of-week 0
|
29
42
|
"*Day of the week as the start of the week."
|
30
43
|
:group 'mhc
|
data/emacs/mhc.el
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
;; Description: Message Harmonized Calendaring system.
|
4
4
|
;; Author: Yoshinari Nomura <nom@quickhack.net>
|
5
5
|
;; Created: 1994-07-04
|
6
|
-
;; Version: 1.
|
6
|
+
;; Version: 1.2.4
|
7
7
|
;; Keywords: calendar
|
8
8
|
;; URL: http://www.quickhack.net/mhc
|
9
9
|
;; Package-Requires: ((calfw "20150703"))
|
@@ -25,7 +25,7 @@
|
|
25
25
|
|
26
26
|
;;; Code:
|
27
27
|
|
28
|
-
(eval-when-compile (require 'cl))
|
28
|
+
(eval-when-compile (require 'cl-lib))
|
29
29
|
|
30
30
|
;; For Mule 2.3
|
31
31
|
(eval-and-compile
|
@@ -190,8 +190,8 @@
|
|
190
190
|
Field names using by MHC.
|
191
191
|
|
192
192
|
X-SC-Category:
|
193
|
-
Space-seperated Keywords.
|
194
|
-
You can also indicate keywords by typing '\\[mhc-rescan-month]', '\\[mhc-goto-this-month]', '\\[mhc-goto-month]', '\\[mhc-goto-date]' with
|
193
|
+
Space-seperated Keywords. You can set default category to scan.
|
194
|
+
You can also indicate keywords by typing '\\[mhc-rescan-month]', '\\[mhc-goto-this-month]', '\\[mhc-goto-month]', '\\[mhc-goto-date]' with \\[universal-argument].
|
195
195
|
"
|
196
196
|
(interactive "P")
|
197
197
|
(make-local-variable 'mhc-mode)
|
@@ -371,10 +371,15 @@ If HIDE-PRIVATE, priavate schedules are suppressed."
|
|
371
371
|
(if mhc-default-hide-private-schedules
|
372
372
|
(not current-prefix-arg)
|
373
373
|
current-prefix-arg)))
|
374
|
-
(mhc-
|
375
|
-
|
376
|
-
|
377
|
-
|
374
|
+
(let ((name (if (and (mhc-summary-buffer-p)
|
375
|
+
(not (string-match
|
376
|
+
"^[0-9][0-9][0-9][0-9]-[0-9][0-9]$" (buffer-name))))
|
377
|
+
(buffer-name))))
|
378
|
+
(mhc-scan-month date
|
379
|
+
'mhc-mua
|
380
|
+
mhc-default-category-predicate-sexp
|
381
|
+
hide-private
|
382
|
+
name)))
|
378
383
|
|
379
384
|
(defvar mhc-goto-date-func 'mhc-goto-date-calendar)
|
380
385
|
; or mhc-goto-date-summary
|
@@ -524,21 +529,22 @@ SCOPE is one of:
|
|
524
529
|
((eq scope 'wide)
|
525
530
|
(mhc-date-ww-last (mhc-date++ edge-date) mhc-start-day-of-week)))))
|
526
531
|
|
527
|
-
(defun mhc-scan-month (date mailer category-predicate secret)
|
532
|
+
(defun mhc-scan-month (date mailer category-predicate secret &optional name)
|
528
533
|
"Make summary buffer for a month indicated by DATE.
|
529
534
|
DATE can be any date of the target month.
|
530
535
|
If MAILER is 'direct, insert scanned result into current buffer.
|
531
536
|
CATEGORY-PREDICATE must be a function that can take one mhc-schedule
|
532
537
|
argument and return a boolean value indicates opacity of the article.
|
533
538
|
If SECRET is non-nil, hide articles those categories are
|
534
|
-
listed in ``mhc-category-as-private''.
|
539
|
+
listed in ``mhc-category-as-private''.
|
540
|
+
If optional NAME is non-nil, created smmary buffer has the name."
|
535
541
|
(let* ((from (mhc-date-mm-first date))
|
536
542
|
(to (mhc-date-mm-last date))
|
537
543
|
(today (mhc-date-now))
|
538
544
|
;; need three months for mini-calendar
|
539
545
|
(dayinfo-list (mhc-db-scan (mhc-date-mm-- from) (mhc-date-mm++ to))))
|
540
546
|
(unless (eq 'direct mailer)
|
541
|
-
(mhc-summary-generate-buffer date)
|
547
|
+
(mhc-summary-generate-buffer (or name date))
|
542
548
|
(setq mhc-summary-buffer-current-date-month
|
543
549
|
(mhc-date-mm-first date)))
|
544
550
|
(when mhc-use-wide-scope
|
@@ -614,7 +620,7 @@ Returns t if the importation was succeeded."
|
|
614
620
|
(list (get-buffer (read-buffer "Import buffer: "
|
615
621
|
(current-buffer))))))
|
616
622
|
(let ((draft-buffer (generate-new-buffer mhc-draft-buffer-name))
|
617
|
-
(current-date (or (mhc-summary-current-date) (mhc-calendar-get-date) (mhc-date-now)))
|
623
|
+
(current-date (or (mhc-summary-region-date) (mhc-summary-current-date) (mhc-calendar-get-date) (mhc-date-now)))
|
618
624
|
(succeed t)
|
619
625
|
msgp date time subject location category recurrence-tag priority alarm)
|
620
626
|
(and (called-interactively-p 'interactive)
|
@@ -629,9 +635,9 @@ Returns t if the importation was succeeded."
|
|
629
635
|
(mhc-header-narrowing
|
630
636
|
(setq msgp (or (mhc-header-get-value "from")
|
631
637
|
(mhc-header-get-value "x-sc-subject")))
|
632
|
-
(mhc-header-
|
638
|
+
(mhc-header-distill-header
|
633
639
|
(concat "^\\("
|
634
|
-
(mhc-regexp-opt mhc-draft-
|
640
|
+
(mhc-regexp-opt mhc-draft-import-header-list)
|
635
641
|
"\\)")
|
636
642
|
'regexp))
|
637
643
|
(mhc-highlight-message)
|
@@ -808,15 +814,35 @@ the default action of this command is changed to the latter."
|
|
808
814
|
(mhc-window-pop)))
|
809
815
|
|
810
816
|
(defun mhc-import-from-region (beg end)
|
811
|
-
"
|
817
|
+
"Create new schedule draft from region BEG END."
|
812
818
|
(interactive "r")
|
813
|
-
(
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
819
|
+
(mhc-import-from-string (buffer-substring beg end)))
|
820
|
+
|
821
|
+
(defun mhc-import-from-clipboard ()
|
822
|
+
"Create new schedule draft from clipboard text."
|
823
|
+
(interactive)
|
824
|
+
(mhc-import-from-string (current-kill 0)))
|
825
|
+
|
826
|
+
(defun mhc-import-from-string (string)
|
827
|
+
"Create new schedule draft from STRING."
|
828
|
+
(with-temp-buffer
|
829
|
+
(yank 1)
|
830
|
+
(goto-char (point-min))
|
831
|
+
(insert "X-SC-Subject: \n"
|
832
|
+
"X-SC-Location: \n"
|
833
|
+
"X-SC-Day: \n"
|
834
|
+
"X-SC-Time: \n"
|
835
|
+
"X-SC-Category: \n"
|
836
|
+
"X-SC-Priority: \n"
|
837
|
+
"X-SC-Recurrence-Tag: \n"
|
838
|
+
"X-SC-Cond: \n"
|
839
|
+
"X-SC-Duration: \n"
|
840
|
+
"X-SC-Alarm: \n"
|
841
|
+
"X-SC-Record-Id: \n"
|
842
|
+
"X-SC-Sequence: 0\n"
|
843
|
+
"\n"
|
844
|
+
string)
|
845
|
+
(mhc-import)))
|
820
846
|
|
821
847
|
(defun mhc-delete ()
|
822
848
|
"Delete the current schedule."
|
@@ -871,11 +897,11 @@ the default action of this command is changed to the latter."
|
|
871
897
|
("x-sc-time" . ,time-list)
|
872
898
|
("x-sc-day" . ,date-list)))))
|
873
899
|
|
874
|
-
(defun mhc-reuse-copy ()
|
900
|
+
(defun mhc-reuse-copy (&optional filename)
|
875
901
|
"Copy current schedule to template."
|
876
902
|
(interactive)
|
877
|
-
(let ((file (mhc-summary-filename))
|
878
|
-
|
903
|
+
(let* ((file (or filename (mhc-summary-filename)))
|
904
|
+
(record (mhc-parse-file file)))
|
879
905
|
(if (and (stringp file) (file-exists-p file))
|
880
906
|
(with-temp-buffer
|
881
907
|
(mhc-insert-file-contents-as-coding-system
|
data/lib/mhc.rb
CHANGED
@@ -5,7 +5,7 @@ require "kconv"
|
|
5
5
|
## Monkey patch to the original RiCal https://github.com/rubyredrick/ri_cal
|
6
6
|
## delived from:
|
7
7
|
## git clone https://github.com/yoshinari-nomura/ri_cal.git
|
8
|
-
## git diff 369a4ee..
|
8
|
+
## git diff 369a4ee..cdb1f75
|
9
9
|
##
|
10
10
|
module RiCal
|
11
11
|
class Component #:nodoc:
|
@@ -47,6 +47,8 @@ module RiCal
|
|
47
47
|
result = {"VALUE" => "DATE"}.merge(params)
|
48
48
|
when DateTime
|
49
49
|
result = {"VALUE" => "DATE-TIME"}.merge(params)
|
50
|
+
when Period
|
51
|
+
result = {"VALUE" => "PERIOD"}.merge(params)
|
50
52
|
end
|
51
53
|
|
52
54
|
if has_local_timezone?
|