aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorUlf Jasper2014-11-16 17:23:45 +0100
committerUlf Jasper2014-11-16 17:23:45 +0100
commit7261b4d9b2f35c3e520b488a8ba3cfde30f84a24 (patch)
treeb50d3087acf6dca06ce807bcfa79d9ab7d5961bc /lisp
parenta97fd0eb8d043170601808e6e5a349e6981c30c4 (diff)
downloademacs-7261b4d9b2f35c3e520b488a8ba3cfde30f84a24.tar.gz
emacs-7261b4d9b2f35c3e520b488a8ba3cfde30f84a24.zip
icalendar: fix issues regarding timezones without dst
* lisp/calendar/icalendar.el (icalendar--convert-tz-offset): Return complete cons when offsets of standard time and daylight saving time are equal. (icalendar-export-region): Fix unbound variable warning. * test/automated/icalendar-tests.el (icalendar--parse-vtimezone): Add testcase where offsets of standard time and daylight saving time are equal. (icalendar-real-world): Fix error in test case. Expected result was wrong when offsets of standard time and daylight saving time were equal.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/calendar/icalendar.el17
2 files changed, 18 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bdf73e827d1..9d22d7609e2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12014-11-16 Ulf Jasper <ulf.jasper@web.de>
2
3 * calendar/icalendar.el (icalendar--convert-tz-offset): Return
4 complete cons when offsets of standard time and daylight saving
5 time are equal.
6 (icalendar-export-region): Fix unbound variable warning.
7
12014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org> 82014-11-16 Fabián Ezequiel Gallina <fgallina@gnu.org>
2 9
3 * progmodes/python.el (run-python): Allow CMD to be optional and 10 * progmodes/python.el (run-python): Allow CMD to be optional and
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index b024a38f809..9dba6ff2dcf 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -509,15 +509,19 @@ The strings are suitable for assembling into a TZ variable."
509 ":" 509 ":"
510 (substring offsetto 3 5)) 510 (substring offsetto 3 5))
511 ;; The start time. 511 ;; The start time.
512 (unless no-dst 512 (let* ((day (if no-dst
513 (let* ((day (icalendar--get-weekday-number (substring byday -2))) 513 1
514 (week (if (eq day -1) 514 (icalendar--get-weekday-number (substring byday -2))))
515 (week (if no-dst
516 "1"
517 (if (eq day -1)
515 byday 518 byday
516 (substring byday 0 -2)))) 519 (substring byday 0 -2)))))
517 ;; "Translate" the iCalendar way to specify the last 520 ;; "Translate" the iCalendar way to specify the last
518 ;; (sun|mon|...)day in month to the tzset way. 521 ;; (sun|mon|...)day in month to the tzset way.
519 (if (string= week "-1") ; last day as iCalendar calls it 522 (if (string= week "-1") ; last day as iCalendar calls it
520 (setq week "5")) ; last day as tzset calls it 523 (setq week "5")) ; last day as tzset calls it
524 (when no-dst (setq bymonth "1"))
521 (concat "M" bymonth "." week "." (if (eq day -1) "0" 525 (concat "M" bymonth "." week "." (if (eq day -1) "0"
522 (int-to-string day)) 526 (int-to-string day))
523 ;; Start time. 527 ;; Start time.
@@ -526,7 +530,7 @@ The strings are suitable for assembling into a TZ variable."
526 ":" 530 ":"
527 (substring dtstart -4 -2) 531 (substring dtstart -4 -2)
528 ":" 532 ":"
529 (substring dtstart -2)))))))))) 533 (substring dtstart -2)))))))))
530 534
531(defun icalendar--parse-vtimezone (alist) 535(defun icalendar--parse-vtimezone (alist)
532 "Turn a VTIMEZONE ALIST into a cons (ID . TZ-STRING). 536 "Turn a VTIMEZONE ALIST into a cons (ID . TZ-STRING).
@@ -1025,7 +1029,8 @@ FExport diary data into iCalendar file: ")
1025 (found-error nil) 1029 (found-error nil)
1026 (nonmarker (concat "^" (regexp-quote diary-nonmarking-symbol) 1030 (nonmarker (concat "^" (regexp-quote diary-nonmarking-symbol)
1027 "?")) 1031 "?"))
1028 (other-elements nil)) 1032 (other-elements nil)
1033 (cns-cons-or-list nil))
1029 ;; prepare buffer with error messages 1034 ;; prepare buffer with error messages
1030 (save-current-buffer 1035 (save-current-buffer
1031 (set-buffer (get-buffer-create "*icalendar-errors*")) 1036 (set-buffer (get-buffer-create "*icalendar-errors*"))