From: hokomo Date: Thu, 24 Nov 2022 17:39:51 +0000 (+0100) Subject: icalendar.el: Fix parsing of sexp entries (bug#56241) X-Git-Tag: emacs-29.0.90~1535 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c6c31b2903b82273da2671986a08edb1bda08214;p=emacs.git icalendar.el: Fix parsing of sexp entries (bug#56241) * lisp/calendar/icalendar.el (icalendar--convert-sexp-to-ical): Use read-from-string for parsing sexp entries (bug#56241). Copyright-paperwork-exempt: yes --- diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index cf542939897..55757400406 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -1641,9 +1641,11 @@ enumeration, given as a Lisp time value -- used for test purposes." entry-main) ;; regular sexp entry (icalendar--dmsg "diary-sexp %s" entry-main) - (let ((p1 (substring entry-main (match-beginning 1) (match-end 1))) - (p2 (substring entry-main (match-beginning 2) (match-end 2))) - (now (or start (current-time)))) + (let* ((entry-main (substring entry-main 2)) + (res (read-from-string entry-main)) + (p1 (prin1-to-string (car res))) + (p2 (substring entry-main (cdr res))) + (now (or start (current-time)))) (delete nil (mapcar (lambda (offset)