mhc 1.2.5 → 1.2.7
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 +4 -4
- data/Rakefile +1 -1
- data/bin/mhc +1 -1
- data/emacs/Cask +1 -1
- data/emacs/mhc-face.el +2 -0
- data/emacs/mhc-summary.el +20 -0
- data/emacs/mhc-vars.el +1 -1
- data/emacs/mhc.el +1 -1
- data/lib/mhc/command/init.rb +4 -4
- data/lib/mhc/config.rb +1 -1
- data/lib/mhc/etag.rb +1 -1
- data/lib/mhc/formatter/text.rb +7 -0
- data/lib/mhc/version.rb +1 -1
- data/mhc.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 004715c2632703f8a918c99c43e56584131ca7f4a70fd9630a6a6b61d4808750
|
4
|
+
data.tar.gz: 64e5111a5ff3e0b6bb2e2aa5205484325bb93ca03b5ac0933900f8ba437b725c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d17c58fc4583093cc8fda63a622e3122ec236674fbdf5bfc61e69783a29e4d434fec4f277dd3e17470eed44a7a8ed706cdcba6e15ec6f91b869c19c592a6f10d
|
7
|
+
data.tar.gz: 7897b2a90736ece98f09d83aa26d800350390f00ea45f92fa8d10e31cade9f6e71d4e319e509cb9a1a103cd645708ffbd6e5c212e4f7ea2e11995354ae55b00f
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ task :build => :check_version
|
|
20
20
|
task :check_version do
|
21
21
|
for file in %w(mhc.el mhc-vars.el Cask)
|
22
22
|
path = File.expand_path("../emacs/#{file}", __FILE__)
|
23
|
-
raise "File not found #{path}" unless File.
|
23
|
+
raise "File not found #{path}" unless File.exist?(path)
|
24
24
|
|
25
25
|
content = File.open(path).read
|
26
26
|
unless (/^;; Version: (\d+\.\d+\.\d+)$/ =~ content ||
|
data/bin/mhc
CHANGED
data/emacs/Cask
CHANGED
data/emacs/mhc-face.el
CHANGED
@@ -101,6 +101,8 @@ refer to mhc-calendar-hnf-face-alist-internal.")
|
|
101
101
|
(mhc-summary-face-conflict . (nil "white" "purple"))
|
102
102
|
(mhc-summary-face-recurrence . (nil "black" "green"))
|
103
103
|
(mhc-summary-face-secret . (nil "gray" nil))
|
104
|
+
(mhc-summary-face-todo . (nil "red " nil))
|
105
|
+
(mhc-summary-face-done . (nil nil nil))
|
104
106
|
;;
|
105
107
|
(mhc-minibuf-face-candidate . (nil nil "yellow"))
|
106
108
|
;;
|
data/emacs/mhc-summary.el
CHANGED
@@ -104,6 +104,18 @@
|
|
104
104
|
:group 'mhc
|
105
105
|
:type 'hook)
|
106
106
|
|
107
|
+
(defcustom mhc-todo-string-done
|
108
|
+
(if (eq mhc-summary-language 'japanese) "■" "[X]")
|
109
|
+
"*String which indicates done TODO."
|
110
|
+
:group 'mhc
|
111
|
+
:type 'string)
|
112
|
+
|
113
|
+
(defcustom mhc-todo-string-not-done
|
114
|
+
(if (eq mhc-summary-language 'japanese) "□" "[ ]")
|
115
|
+
"*String which indicates not-done TODO."
|
116
|
+
:group 'mhc
|
117
|
+
:type 'string)
|
118
|
+
|
107
119
|
(defcustom mhc-summary-line-format
|
108
120
|
(if (eq mhc-summary-language 'japanese)
|
109
121
|
"%Y%年%M%月%D%日%(%曜%) %b%e %c%i%s %p%l"
|
@@ -124,6 +136,7 @@ which are replaced by the given information:
|
|
124
136
|
%p The priority of the schedule.
|
125
137
|
%l The location of the schedule.
|
126
138
|
%r Indicator for recurrence-tag (See also `mhc-summary-string-recurrence').
|
139
|
+
%t The indicator for TODO.
|
127
140
|
|
128
141
|
%/ A slash character if first line of the day.
|
129
142
|
%( A left parenthesis character if first line of the day.
|
@@ -221,6 +234,13 @@ which are replaced by the given information:
|
|
221
234
|
(if mhc-tmp-private (mhc-face-category-to-face "Private")
|
222
235
|
(mhc-face-category-to-face
|
223
236
|
(car (mhc-schedule-categories mhc-tmp-schedule)))))
|
237
|
+
(?t (cond
|
238
|
+
((mhc-schedule-in-category-p mhc-tmp-schedule "done") mhc-todo-string-done)
|
239
|
+
((mhc-schedule-in-category-p mhc-tmp-schedule "todo") mhc-todo-string-not-done))
|
240
|
+
'face
|
241
|
+
(cond
|
242
|
+
((mhc-schedule-in-category-p mhc-tmp-schedule "done") 'mhc-summary-face-done)
|
243
|
+
((mhc-schedule-in-category-p mhc-tmp-schedule "todo") 'mhc-summary-face-todo)))
|
224
244
|
(?l (mhc-summary/line-location-string)
|
225
245
|
'face 'mhc-summary-face-location)
|
226
246
|
(?\( (if mhc-tmp-first "(" " ")
|
data/emacs/mhc-vars.el
CHANGED
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.2.
|
6
|
+
;; Version: 1.2.7
|
7
7
|
;; Keywords: calendar
|
8
8
|
;; URL: http://www.quickhack.net/mhc
|
9
9
|
;; Package-Requires: ((calfw "20150703"))
|
data/lib/mhc/command/init.rb
CHANGED
@@ -62,7 +62,7 @@ module Mhc
|
|
62
62
|
require "erb"
|
63
63
|
template = ERB.new(File.open(template_path).read, nil, "-")
|
64
64
|
|
65
|
-
if File.
|
65
|
+
if File.exist?(dest_path)
|
66
66
|
say_status "exist", "Ignore #{dest_path}", :yellow
|
67
67
|
return
|
68
68
|
end
|
@@ -98,7 +98,7 @@ module Mhc
|
|
98
98
|
require "digest/md5"
|
99
99
|
|
100
100
|
# Debian
|
101
|
-
if File.
|
101
|
+
if File.exist?("/etc/timezone")
|
102
102
|
return File.open("/etc/timezone").read.chomp
|
103
103
|
end
|
104
104
|
|
@@ -109,13 +109,13 @@ module Mhc
|
|
109
109
|
end
|
110
110
|
|
111
111
|
# Red Had / CentOS
|
112
|
-
if File.
|
112
|
+
if File.exist?("/etc/sysconfig/clock") &&
|
113
113
|
/ZONE=["']?([^"']+)/ =~ File.open("/etc/sysconfig/clock").read.chomp
|
114
114
|
return $1
|
115
115
|
end
|
116
116
|
|
117
117
|
# generic including FreeBSD
|
118
|
-
if File.
|
118
|
+
if File.exist?("/etc/localtime")
|
119
119
|
localtime = Digest::MD5.file("/etc/localtime")
|
120
120
|
candidates = Dir.chdir("/usr/share/zoneinfo") do
|
121
121
|
Dir.glob("**/*").select do |fn|
|
data/lib/mhc/config.rb
CHANGED
@@ -211,7 +211,7 @@ module Mhc
|
|
211
211
|
end # class Top
|
212
212
|
|
213
213
|
def self.create_from_file(file_name)
|
214
|
-
unless File.
|
214
|
+
unless File.exist?(File.expand_path(file_name))
|
215
215
|
raise Mhc::ConfigurationError, "config file '#{file_name}' not found"
|
216
216
|
end
|
217
217
|
begin
|
data/lib/mhc/etag.rb
CHANGED
data/lib/mhc/formatter/text.rb
CHANGED
@@ -8,6 +8,13 @@ module Mhc
|
|
8
8
|
def format_item(context, date, item)
|
9
9
|
subject = item.subject.to_s
|
10
10
|
subject = "(no subject)" if subject == ""
|
11
|
+
icon = { "Todo" => "[ ]", "Done" => "[X]" }
|
12
|
+
cat = item.categories.map{|s| s.to_s}.select{|s| s == "Todo" or s == "Done"}.map{|s| icon[s]}.join(",")
|
13
|
+
if cat != ""
|
14
|
+
subject = cat + " " + subject
|
15
|
+
else
|
16
|
+
subject = " " + subject
|
17
|
+
end
|
11
18
|
format("%s%-11s %s%s\n",
|
12
19
|
format_item_header(context, date, item),
|
13
20
|
item.time_range.to_mhc_string.toutf8,
|
data/lib/mhc/version.rb
CHANGED
data/mhc.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_runtime_dependency "ri_cal", ">= 0.8.8"
|
29
29
|
spec.add_runtime_dependency "tzinfo", ">= 1.2.2"
|
30
30
|
spec.add_runtime_dependency "tzinfo-data", ">= 1.2015.4"
|
31
|
+
spec.add_runtime_dependency "nkf"
|
31
32
|
|
32
33
|
spec.add_development_dependency "rake"
|
33
34
|
spec.add_development_dependency "rspec"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mhc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshinari Nomura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.2015.4
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: nkf
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rake
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|