Skip to content

Commit

Permalink
fix: correctly log events whose titles contain backslash
Browse files Browse the repository at this point in the history
Work around aki2o/log4e#9.
  • Loading branch information
telotortium committed Aug 23, 2022
1 parent 6fc8d32 commit eb8bd17
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions org-gcal.el
Original file line number Diff line number Diff line change
Expand Up @@ -3312,11 +3312,14 @@ beginning position."
When SILENT is non-nil, silence messages even when ‘org-gcal-notify-p’ is
non-nil."
(when (and org-gcal-notify-p (not silent))
(if org-gcal-logo-file
(alert message :title title :icon org-gcal-logo-file)
(alert message :title title))
(message "%s\n%s" title message)))
;; Double backslashes to work around https://github.com/aki2o/log4e/issues/9.
(let* ((title (replace-regexp-in-string "\\\\" "\\\\" title t t))
(message (replace-regexp-in-string "\\\\" "\\\\" message t t)))
(when (and org-gcal-notify-p (not silent))
(if org-gcal-logo-file
(alert message :title title :icon org-gcal-logo-file)
(alert message :title title))
(message "%s\n%s" title message))))

(defun org-gcal--time-to-seconds (plst)
"Convert PLST, a value from ‘org-gcal--parse-date’, to Unix timestamp.
Expand Down

0 comments on commit eb8bd17

Please sign in to comment.