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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4522630272ecdc9d44c9b994b2b31f8e36278abb0004708ec0e39d63e5d16792
|
4
|
+
data.tar.gz: cbcd079db569d336eec4eb87f21e5598cd3735b04f0fef6ffbbc8b7fdb583067
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f052c78047e59e8638248ef56928f2ee3e85ae544b959d294c6900afb06868cb305a4a23b1ae85a35d963b870dbb0ec950c4c1d5cd9ea25d9ffe07334be5cd8
|
7
|
+
data.tar.gz: 874b007618cfd8be8a49ba0fab497ba38f6a36edfedbedf0ec72bb983c6c5ceff67a52c2b6138a62ced23fb0586e5f644eca018e2d9b963a8d79666100b94b9a
|
data/.gitignore
CHANGED
data/bin/mhc
CHANGED
@@ -110,9 +110,48 @@ class MhcCLI < Thor
|
|
110
110
|
named_option :repository
|
111
111
|
|
112
112
|
def cache
|
113
|
-
Mhc::Command::Cache.new(
|
113
|
+
Mhc::Command::Cache.new(builder.datastore)
|
114
114
|
end
|
115
115
|
|
116
|
+
# Command: todo
|
117
|
+
desc "todo", "List Todo entries in MHC calendar"
|
118
|
+
|
119
|
+
named_option :repository
|
120
|
+
method_option :show_all, :desc => "Include all finished tasks."
|
121
|
+
|
122
|
+
def todo
|
123
|
+
todos = []
|
124
|
+
calendar.tasks.each do |task|
|
125
|
+
if task.recurring?
|
126
|
+
# Yearly: today - 90days .. today + 365d - 90days ?
|
127
|
+
# Weekly: today - 7days .. today + 7days
|
128
|
+
search_range = Mhc::PropertyValue::Date.parse_range("today+365d")
|
129
|
+
# search_range = nil
|
130
|
+
else
|
131
|
+
search_range = nil
|
132
|
+
end
|
133
|
+
next if task.in_category?("done") && !options[:show_all]
|
134
|
+
todos << task.occurrences(range: search_range).first
|
135
|
+
end
|
136
|
+
todos.each.sort{|a, b| a.dtstart <=> b.dtstart}.each do |t|
|
137
|
+
deadline = t.dtstart
|
138
|
+
deadline_string = ""
|
139
|
+
remaining = (deadline - Mhc::PropertyValue::Date.today).to_i
|
140
|
+
if remaining == 0
|
141
|
+
deadline_string = " (due this date)"
|
142
|
+
elsif remaining > 0
|
143
|
+
deadline_string = format(" (%d days to go)", remaining)
|
144
|
+
else
|
145
|
+
deadline_string = format(" (%d days overdue)", -remaining)
|
146
|
+
end
|
147
|
+
location_string = " [#{t.location}]" if !t.location.empty?
|
148
|
+
puts format("%s %-11s %s%s%s",
|
149
|
+
deadline.strftime("%Y/%m/%d %a"),
|
150
|
+
t.time_range.to_mhc_string,
|
151
|
+
t.subject, location_string, deadline_string)
|
152
|
+
end
|
153
|
+
end # todo
|
154
|
+
|
116
155
|
################################################################
|
117
156
|
# Command: completions
|
118
157
|
################################################################
|
@@ -185,7 +224,7 @@ class MhcCLI < Thor
|
|
185
224
|
def scan(range)
|
186
225
|
begin
|
187
226
|
Mhc::Command::Scan.new(calendar, range, **symbolize_keys(options))
|
188
|
-
rescue Mhc::PropertyValue::ParseError, Mhc::
|
227
|
+
rescue Mhc::PropertyValue::ParseError, Mhc::Formatter::NameError, Mhc::Query::ParseError => e
|
189
228
|
STDERR.print "Error: " + e.message + "\n"
|
190
229
|
end
|
191
230
|
return self
|
@@ -236,6 +275,40 @@ class MhcCLI < Thor
|
|
236
275
|
return self
|
237
276
|
end
|
238
277
|
|
278
|
+
################################################################
|
279
|
+
# Command: validate
|
280
|
+
################################################################
|
281
|
+
desc "validate FILE", "Validate event FILE"
|
282
|
+
|
283
|
+
named_option :format
|
284
|
+
|
285
|
+
def validate(file)
|
286
|
+
full_path = File.expand_path(file)
|
287
|
+
|
288
|
+
unless File.exist?(full_path)
|
289
|
+
puts Mhc::Converter::Emacs.new.to_emacs("No such file #{file}.")
|
290
|
+
return 1
|
291
|
+
end
|
292
|
+
|
293
|
+
errors = Mhc::Event.validate(File.open(full_path) {|f| f.read})
|
294
|
+
|
295
|
+
string = ""
|
296
|
+
exit_on_error do
|
297
|
+
errors.each do |err, key|
|
298
|
+
string += "#{err.to_s.capitalize}"
|
299
|
+
string += " in X-SC-#{key.capitalize}" if key
|
300
|
+
string += ".\n"
|
301
|
+
end
|
302
|
+
end
|
303
|
+
if errors.empty?
|
304
|
+
puts Mhc::Converter::Emacs.new.to_emacs("OK")
|
305
|
+
return 0
|
306
|
+
end
|
307
|
+
|
308
|
+
puts Mhc::Converter::Emacs.new.to_emacs(string)
|
309
|
+
return 1
|
310
|
+
end
|
311
|
+
|
239
312
|
################################################################
|
240
313
|
# add some hooks to Thor
|
241
314
|
|
@@ -312,4 +385,10 @@ class MhcCLI < Thor
|
|
312
385
|
end
|
313
386
|
end
|
314
387
|
|
315
|
-
|
388
|
+
result = MhcCLI.start(ARGV)
|
389
|
+
|
390
|
+
if result.is_a?(Numeric)
|
391
|
+
exit result
|
392
|
+
else
|
393
|
+
exit 0
|
394
|
+
end
|
data/emacs/Cask
CHANGED
data/emacs/mhc-calendar.el
CHANGED
@@ -1071,11 +1071,13 @@ The keys that are defined for mhc-calendar-mode are:
|
|
1071
1071
|
(format "%4d" yy))
|
1072
1072
|
|
1073
1073
|
(defun mhc-calendar/inserter-nengo ()
|
1074
|
-
(if (> yy
|
1075
|
-
(format "
|
1076
|
-
(if (> yy
|
1077
|
-
(format "
|
1078
|
-
|
1074
|
+
(if (or (> yy 2019) (and (= yy 2019) (> mm 4)))
|
1075
|
+
(format "令和%2d年" (- yy 2018))
|
1076
|
+
(if (> yy 1987)
|
1077
|
+
(format "平成%2d年" (- yy 1988))
|
1078
|
+
(if (> yy 1924)
|
1079
|
+
(format "昭和%2d年" (- yy 1925))
|
1080
|
+
"昔々"))))
|
1079
1081
|
|
1080
1082
|
(defun mhc-calendar/inserter-mm ()
|
1081
1083
|
(format "%d" mm))
|
data/emacs/mhc-date.el
CHANGED
@@ -411,17 +411,10 @@
|
|
411
411
|
`(/ (1- (mhc-date-dd ,date)) 7))
|
412
412
|
|
413
413
|
(defsubst mhc-date-cw (date)
|
414
|
-
(
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
(if (< days 0)
|
419
|
-
(setq days (mhc-date/iso-week-days
|
420
|
-
(+ yday 365 (if (mhc-date/leap-year-p (1- yy)) 1 0)) ww))
|
421
|
-
(setq d (mhc-date/iso-week-days
|
422
|
-
(- yday 365 (if (mhc-date/leap-year-p yy) 1 0)) ww))
|
423
|
-
(if (<= 0 d) (setq days d)))
|
424
|
-
(1+ (/ days 7)))))
|
414
|
+
(string-to-number
|
415
|
+
(format-time-string
|
416
|
+
(if (= mhc-start-day-of-week 1) "%V" "%U")
|
417
|
+
(mhc-date-to-second date))))
|
425
418
|
|
426
419
|
;;
|
427
420
|
;; compare.
|
@@ -646,4 +639,4 @@ If WKST is not specified, 0 (Sunday) is used."
|
|
646
639
|
;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
647
640
|
;; OF THE POSSIBILITY OF SUCH DAMAGE.
|
648
641
|
|
649
|
-
;;; mhc-date.el ends here
|
642
|
+
;;; mhc-date.el ends here
|
data/emacs/mhc-day.el
CHANGED
data/emacs/mhc-db.el
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
;;;
|
1
|
+
;;; mhc-db.el --- Database Interface to MHC.
|
2
2
|
|
3
3
|
;; Author: Yoshinari Nomura <nom@quickhack.net>,
|
4
4
|
;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
|
@@ -18,18 +18,38 @@
|
|
18
18
|
(require 'mhc-process)
|
19
19
|
(require 'mhc-schedule)
|
20
20
|
|
21
|
-
(defun mhc-db-scan (
|
21
|
+
(defun mhc-db-scan (begin-date end-date &optional nosort category search)
|
22
|
+
"Scan MHC database from BEGIN-DATE to END-DATE.
|
23
|
+
If optional NOSORT is non-nil, returned value is not sort.
|
24
|
+
If optional CATEGORY is non-nil, returned value is clipped by category.
|
25
|
+
If optional SEARCH is non-nil returned value is clipped by search string."
|
22
26
|
(mhc-process-send-command
|
23
27
|
(format "scan --format=emacs %04d%02d%02d-%04d%02d%02d%s%s"
|
24
|
-
(mhc-date-yy
|
25
|
-
(mhc-date-mm
|
26
|
-
(mhc-date-dd
|
27
|
-
(mhc-date-yy
|
28
|
-
(mhc-date-mm
|
29
|
-
(mhc-date-dd
|
28
|
+
(mhc-date-yy begin-date)
|
29
|
+
(mhc-date-mm begin-date)
|
30
|
+
(mhc-date-dd begin-date)
|
31
|
+
(mhc-date-yy end-date)
|
32
|
+
(mhc-date-mm end-date)
|
33
|
+
(mhc-date-dd end-date)
|
30
34
|
(if category (format " --category=%s" category) "")
|
31
35
|
(if search (format " --search='%s'" search) ""))))
|
32
36
|
|
37
|
+
(defun mhc-db-scan-flat (begin-date end-date &optional nosort category search)
|
38
|
+
"Scan MHC database from BEGIN-DATE to END-DATE.
|
39
|
+
Unlike `mhc-db-scan`, returned value is not grouped by date.
|
40
|
+
For example:
|
41
|
+
((date . mhc-schedule) (date . mhc-schedule) ...)
|
42
|
+
If optional NOSORT is non-nil, returned value is not sort.
|
43
|
+
If optional CATEGORY is non-nil, returned value is clipped by category.
|
44
|
+
If optional SEARCH is non-nil returned value is clipped by search string."
|
45
|
+
(let ((dayinfo-list (mhc-db-scan begin-date end-date nosort category search)))
|
46
|
+
(apply 'append
|
47
|
+
(mapcar (lambda (dayinfo)
|
48
|
+
(let ((date (mhc-day-date dayinfo))
|
49
|
+
(schedules (mhc-day-schedules dayinfo)))
|
50
|
+
(mapcar (lambda (sch) (cons date sch)) schedules)))
|
51
|
+
dayinfo-list))))
|
52
|
+
|
33
53
|
(defun mhc-db-search (&rest query)
|
34
54
|
(let ((b (mhc-date-new 1970 1 1))
|
35
55
|
(e (mhc-date-yy+ (mhc-date-now) 10)))
|
@@ -60,32 +80,33 @@
|
|
60
80
|
nosort
|
61
81
|
category)))
|
62
82
|
|
63
|
-
(defun mhc-db-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
(
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
(defun mhc-db-record-path-from-buffer (buffer)
|
84
|
+
"Return file path in MHC spool bound to BUFFER.
|
85
|
+
File path is taken from X-SC-Record-Id field."
|
86
|
+
(with-current-buffer buffer
|
87
|
+
(let ((spool-directory (file-name-as-directory
|
88
|
+
(expand-file-name
|
89
|
+
"spool" (mhc-config-base-directory))))
|
90
|
+
(record-id (mhc-draft-record-id)))
|
91
|
+
(expand-file-name (concat record-id ".mhc") spool-directory))))
|
92
|
+
|
93
|
+
(defun mhc-db-add-record-from-buffer (buffer &optional allow-overwrite)
|
94
|
+
"Add current mhc-draft BUFFER to MHC db.
|
95
|
+
If optional ALLOW-OVERWRITE is non-nil, do not ask overwrite."
|
96
|
+
(let* ((path (mhc-db-record-path-from-buffer buffer))
|
97
|
+
(directory (file-name-directory path))
|
98
|
+
(overwriting (file-exists-p path)))
|
99
|
+
(if (or (not overwriting)
|
100
|
+
allow-overwrite
|
101
|
+
(y-or-n-p (format "Overwrite existing %s? " path)))
|
102
|
+
(with-current-buffer buffer
|
103
|
+
(mhc-draft-increment-sequence)
|
104
|
+
(mhc-draft-translate)
|
105
|
+
(mhc-file-make-directory directory)
|
106
|
+
(mhc-write-region-as-coding-system
|
107
|
+
mhc-default-coding-system
|
108
|
+
(point-min) (point-max) path nil 'nomsg)
|
109
|
+
(set-buffer-modified-p nil)
|
89
110
|
(mhc-misc-touch-directory directory)
|
90
111
|
t))))
|
91
112
|
|
@@ -118,9 +139,7 @@
|
|
118
139
|
(mhc-schedule-condition schedule))))
|
119
140
|
" "))))
|
120
141
|
(mhc-record-set-name record (mhc-record-name original-record))
|
121
|
-
(mhc-db-add-record-from-buffer
|
122
|
-
|
123
|
-
|
142
|
+
(mhc-db-add-record-from-buffer (current-buffer) t)))))
|
124
143
|
|
125
144
|
(provide 'mhc-db)
|
126
145
|
|
@@ -155,4 +174,4 @@
|
|
155
174
|
;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
156
175
|
;; OF THE POSSIBILITY OF SUCH DAMAGE.
|
157
176
|
|
158
|
-
;;; mhc-db.el ends here
|
177
|
+
;;; mhc-db.el ends here
|
data/emacs/mhc-draft.el
CHANGED
@@ -17,14 +17,10 @@
|
|
17
17
|
|
18
18
|
(defconst mhc-draft-buffer-name "*mhc draft*")
|
19
19
|
|
20
|
-
(defcustom mhc-draft-
|
21
|
-
'("
|
22
|
-
"
|
23
|
-
|
24
|
-
"X-Dispatcher:" "X-Filter:" "X-Gnus-Mail-Source:" "X-Mailer:" "X-Received:"
|
25
|
-
"X-Sender:" "X-Seqno:" "X-Spam-Flag:" "X-Spam-Probability:" "X-UIDL:"
|
26
|
-
"Xref:")
|
27
|
-
"*These headers are removed when article is imported."
|
20
|
+
(defcustom mhc-draft-import-header-list
|
21
|
+
'("Subject:" "From:" "To:" "Cc:" "Date:" "Message-Id:"
|
22
|
+
"X-GM-THRID:" "X-GM-MSGID:" "X-GM-LABELS:")
|
23
|
+
"*These headers are used when article is imported."
|
28
24
|
:group 'mhc
|
29
25
|
:type '(repeat string))
|
30
26
|
|
@@ -199,7 +195,7 @@ If optional argument NO-CONFIRM is non-nil, kill without confirmation."
|
|
199
195
|
(defun mhc-draft-delete-garbage-headers ()
|
200
196
|
(mhc-header-narrowing
|
201
197
|
(mhc-header-delete-header
|
202
|
-
(concat "^\\(" (mhc-regexp-opt mhc-draft-
|
198
|
+
(concat "^\\(" (mhc-regexp-opt mhc-draft-import-header-list) "\\)")
|
203
199
|
'regexp)))
|
204
200
|
|
205
201
|
(defun mhc-draft-setup-headers (&optional headers-values)
|
@@ -217,22 +213,40 @@ HEADERS-VALUES is a list of cons-cell like: ((header-name . value) ...)."
|
|
217
213
|
(mhc-header-put-value xsc ""))))
|
218
214
|
xsc-headers))))
|
219
215
|
|
216
|
+
(defun mhc-draft-record-id ()
|
217
|
+
"Get X-SC-Record-Id header value in draft buffer."
|
218
|
+
(mhc-header-narrowing
|
219
|
+
(mhc-header-get-value "x-sc-record-id")))
|
220
|
+
|
221
|
+
(defun mhc-draft-validate-buffer (&optional buffer)
|
222
|
+
"Validate mhc draft BUFFER.
|
223
|
+
If BUFFER is omitted, current buffer will be validated."
|
224
|
+
(interactive)
|
225
|
+
(let ((validation (mhc-process-send-command-with-buffer
|
226
|
+
"validate --format=emacs"
|
227
|
+
(or buffer (current-buffer)))))
|
228
|
+
(if (and (stringp validation)
|
229
|
+
(string-match "^OK" validation))
|
230
|
+
(message "Validation passed.")
|
231
|
+
;; \\' means end of string (not end of each line)
|
232
|
+
(error "ERROR: %s" (replace-regexp-in-string "[.\r\n]+\\'" "" validation)))))
|
233
|
+
|
220
234
|
(defun mhc-draft-finish ()
|
221
235
|
"Add current draft as a schedule."
|
222
236
|
(interactive)
|
223
|
-
(
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
(
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
237
|
+
(mhc-draft-validate-buffer)
|
238
|
+
(mhc-calendar-input-exit)
|
239
|
+
(if (mhc-db-add-record-from-buffer
|
240
|
+
(current-buffer)
|
241
|
+
(not (called-interactively-p 'interactive)))
|
242
|
+
(progn
|
243
|
+
(kill-buffer (current-buffer))
|
244
|
+
(mhc-window-pop)
|
245
|
+
(or (and (mhc-summary-buffer-p)
|
246
|
+
(mhc-rescan-month mhc-default-hide-private-schedules))
|
247
|
+
(and (mhc-calendar-p) (mhc-calendar-rescan)))
|
248
|
+
(run-hooks 'mhc-draft-finish-hook)
|
249
|
+
(message "Successfully registered."))))
|
236
250
|
|
237
251
|
(provide 'mhc-draft)
|
238
252
|
|
data/emacs/mhc-face.el
CHANGED
@@ -68,7 +68,7 @@ refer to mhc-calendar-hnf-face-alist-internal.")
|
|
68
68
|
(1 font-lock-type-face)
|
69
69
|
(2 font-lock-comment-face)
|
70
70
|
(3 font-lock-builtin-face))
|
71
|
-
("\\(X-SC-\\(Subject\\|Location\\|Day\\|Time\\|Category\\|Priority\\|Recurrence-Tag\\|Mission-Tag
|
71
|
+
("\\(X-SC-\\(Subject\\|Location\\|Day\\|Time\\|Category\\|Priority\\|Recurrence-Tag\\|Mission-Tag\\|Cond\\|Duration\\|Alarm\\|Record-Id\\|Sequence\\):\\)"
|
72
72
|
(1 font-lock-keyword-face))
|
73
73
|
("\\(\\[End of message\\]\\)"
|
74
74
|
(1 mhc-message-face-eof-marker))
|
data/emacs/mhc-header.el
CHANGED
@@ -63,6 +63,25 @@
|
|
63
63
|
(memq (following-char) '(? ?\t)))))
|
64
64
|
|
65
65
|
|
66
|
+
(defun mhc-header-distill-header (header &optional regexp)
|
67
|
+
"Remove all headers except X-SC-* and HEADER.
|
68
|
+
If REGEXP is non-nil, HEADER is a regular expression."
|
69
|
+
(save-excursion
|
70
|
+
(let ((case-fold-search t)
|
71
|
+
(header-top)
|
72
|
+
(header-name)
|
73
|
+
(all-regexp "^[^:]+:")
|
74
|
+
(use-regexp (if regexp header (concat "^" (regexp-quote header) ":")))
|
75
|
+
(xsc-regexp (concat "^\\(" (mhc-regexp-opt (mhc-header-list)) "\\)")))
|
76
|
+
(goto-char (point-min))
|
77
|
+
(while (re-search-forward all-regexp nil t)
|
78
|
+
(setq header-top (match-beginning 0)
|
79
|
+
header-name (match-string 0))
|
80
|
+
(mhc-header-goto-end)
|
81
|
+
(unless (or (string-match use-regexp header-name)
|
82
|
+
(string-match xsc-regexp header-name))
|
83
|
+
(delete-region header-top (point)))))))
|
84
|
+
|
66
85
|
(defun mhc-header-delete-header (header &optional regexp) "\
|
67
86
|
Remove HEADER in the narrowed buffer.
|
68
87
|
If REGEXP, HEADER is a regular expression."
|
@@ -177,4 +196,4 @@ If REGEXP, HEADER is a regular expression."
|
|
177
196
|
;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
178
197
|
;; OF THE POSSIBILITY OF SUCH DAMAGE.
|
179
198
|
|
180
|
-
;;; mhc-header.el ends here
|
199
|
+
;;; mhc-header.el ends here
|