Update cl/khal-notify.lisp
This commit is contained in:
parent
ed0b55c3b4
commit
37a87cc34e
@ -36,6 +36,16 @@
|
|||||||
(subseq str 0 (1- len))
|
(subseq str 0 (1- len))
|
||||||
str)))
|
str)))
|
||||||
|
|
||||||
|
(defun process-escape-sequences (str)
|
||||||
|
(coerce (loop with escape = nil
|
||||||
|
for chr across str
|
||||||
|
when (and (not escape) (eql chr #\\))
|
||||||
|
do (setq escape t)
|
||||||
|
else
|
||||||
|
do (setq escape nil) and
|
||||||
|
collect chr)
|
||||||
|
'string))
|
||||||
|
|
||||||
(defun get-ics-file-alarms (path)
|
(defun get-ics-file-alarms (path)
|
||||||
(with-open-file (stream path :direction :input :if-does-not-exist nil)
|
(with-open-file (stream path :direction :input :if-does-not-exist nil)
|
||||||
(when stream
|
(when stream
|
||||||
@ -49,7 +59,10 @@
|
|||||||
while line
|
while line
|
||||||
do (cond
|
do (cond
|
||||||
((and (not in-valarm) (uiop:string-prefix-p "SUMMARY:" line))
|
((and (not in-valarm) (uiop:string-prefix-p "SUMMARY:" line))
|
||||||
(setq summary (subseq (remove-trailing-return line) 8)))
|
(setq summary (subseq
|
||||||
|
(process-escape-sequences
|
||||||
|
(remove-trailing-return line))
|
||||||
|
8)))
|
||||||
((uiop:string-prefix-p "BEGIN:VALARM" line)
|
((uiop:string-prefix-p "BEGIN:VALARM" line)
|
||||||
(setq in-valarm t))
|
(setq in-valarm t))
|
||||||
((uiop:string-prefix-p "END:VALARM" line)
|
((uiop:string-prefix-p "END:VALARM" line)
|
||||||
@ -70,7 +83,8 @@
|
|||||||
((equal unit "D") (* num 60 60 24))
|
((equal unit "D") (* num 60 60 24))
|
||||||
(t 0))))))
|
(t 0))))))
|
||||||
((and in-valarm (uiop:string-prefix-p "DESCRIPTION:" line))
|
((and in-valarm (uiop:string-prefix-p "DESCRIPTION:" line))
|
||||||
(setq current-notice (subseq (remove-trailing-return line)
|
(setq current-notice (subseq (process-escape-sequences
|
||||||
|
(remove-trailing-return line))
|
||||||
12))))
|
12))))
|
||||||
finally (return (mapcar (lambda (alarm)
|
finally (return (mapcar (lambda (alarm)
|
||||||
(list (if (uiop:emptyp (car alarm))
|
(list (if (uiop:emptyp (car alarm))
|
||||||
@ -115,7 +129,8 @@
|
|||||||
:time alarm-time
|
:time alarm-time
|
||||||
:event-title event-title
|
:event-title event-title
|
||||||
:event-end end
|
:event-end end
|
||||||
:uid uid)))) alarms)))))))
|
:uid uid))))
|
||||||
|
alarms)))))))
|
||||||
|
|
||||||
(defun build-alarm-list (calendar-dirs &optional exclude-before)
|
(defun build-alarm-list (calendar-dirs &optional exclude-before)
|
||||||
(let* ((output (run-khal "list"
|
(let* ((output (run-khal "list"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user