1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-22 12:33:53 -08:00
emacs/etc
Richard Lawrence c685cf336a Add full support for iCalendar (RFC5545) data
This is a fix for Bug#74994 that replaces the existing support
in icalendar.el.  It implements a full parser, recurrence rule
and time zone calculations, diary import and export, and a
major mode with syntax highlighting for iCalendar data.  It
obsoletes most of the code in icalendar.el.

In addition to Bug#74994, the proposal to update Emacs' iCalendar
support was discussed on emacs-devel in this thread:
https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00425.html

icalendar.el pre-dates the current standard (RFC5545), contains numerous
bugs, is not well documented, and could not easily be updated or
extended; starting fresh was the simplest path to creating an iCalendar
library that other Emacs applications and packages can rely on.  It was
decided to leave icalendar.el's code in place for posterity, but declare
it obsolete.  Most of the changes in icalendar.el simply consist of such
declarations.  The old To Do list has also been deleted.

A few changes in icalendar.el, however, consist of new code for
library-wide functions and options, especially error handling.  In
particular:

* lisp/calendar/icalendar.el: Log iCalendar library errors in a single
buffer.
(icalendar-errors-mode): New mode for it.
(icalendar-uid-format): Change the default value to "%h", a hash
value (for privacy).
(icalendar-make-uid): New function, to replace 'icalendar--create-uid'.
(icalendar-debug-level, icalendar-vcalendar-prodid): New option.
(icalendar-vcalendar-version): New constant.
* lisp/calendar/icalendar.el (icalendar-import-format)
(icalendar-import-format-summary, icalendar-import-format-description)
(icalendar-import-format-location, icalendar-import-format-organizer)
(icalendar-import-format-url, icalendar-import-format-uid)
(icalendar-import-format-status, icalendar-import-format-class)
(icalendar-recurring-start-year, icalendar-export-hidden-diary-entries)
(icalendar-export-sexp-enumerate-all, icalendar-export-alarms,
icalendar-debug, icalendar--weekday-array, icalendar--dmsg)
(icalendar--get-unfolded-buffer icalendar--clean-up-line-endings)
(icalendar--rris, icalendar--read-element)
(icalendar--get-event-property, icalendar--get-event-properties)
(icalendar--get-event-property-attributes)
(icalendar--get-children, icalendar--all-events, icalendar--split-value)
(icalendar--convert-tz-offset, icalendar--parse-vtimezone)
(icalendar--get-most-recent-observance)
(icalendar--convert-all-timezones, icalendar--find-time-zone)
(icalendar--decode-isodatetime)
(icalendar--decode-isoduration, icalendar--add-decoded-times)
(icalendar--datetime-to-american-date)
(icalendar--datetime-to-european-date, icalendar--datetime-to-iso-date)
(icalendar--datetime-to-diary-date, icalendar--datetime-to-colontime)
(icalendar--get-month-number, icalendar--get-weekday-number)
(icalendar--get-weekday-numbers, icalendar--get-weekday-abbrev)
(icalendar--date-to-isodate, icalendar--datestring-to-isodate)
(icalendar--diarytime-to-isotime, icalendar--convert-string-for-export)
(icalendar--convert-string-for-import, icalendar-export-file)
(icalendar-export-region, icalendar--create-uid)
(icalendar--parse-summary-and-rest, icalendar--create-ical-alarm)
(icalendar--do-create-ical-alarm, icalendar--convert-ordinary-to-ical)
(icalendar-first-weekday-of-year, icalendar--convert-weekly-to-ical)
(icalendar--convert-yearly-to-ical, icalendar--convert-sexp-to-ical)
(icalendar--convert-block-to-ical, icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical, icalendar--convert-cyclic-to-ical)
(icalendar--convert-anniversary-to-ical, icalendar-import-file)
(icalendar-import-buffer, icalendar--format-ical-event)
(icalendar--convert-to-ical, icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--convert-non-recurring-all-day-to-diary)
(icalendar--convert-non-recurring-not-all-day-to-diary)
(icalendar--add-diary-entry, icalendar-import-format-sample): Mark them
as obsolete.

In addition to the changes above, the new iCalendar library consists of
the following:

* lisp/calendar/diary-icalendar.el:
* lisp/calendar/icalendar-ast.el:
* lisp/calendar/icalendar-macs.el:
* lisp/calendar/icalendar-mode.el:
* lisp/calendar/icalendar-parser.el:
* lisp/calendar/icalendar-recur.el:
* lisp/calendar/icalendar-utils.el: New files

A few changes were made to existing files dealing with the calendar and
diary:

* lisp/calendar/calendar.el (calendar-date-from-day-of-year): New
function, extracted from calendar-goto-day-of-year.
* lisp/calendar/cal-move.el (calendar-goto-day-of-year): Use it.
* lisp/calendar/cal-dst.el (calendar-dst-find-data): Improve docstring.
* lisp/calendar/calendar.el (diary-date-insertion-form): New option.
(diary-american-date-insertion-form, diary-european-date-insertion-form)
(diary-iso-date-insertion-form): New constants.
* lisp/calendar/diary-lib.el (diary-insert-entry): Use the new
'diary-date-insertion-form' option.
(diary-time-regexp): Add FIXME to an existing comment.

The user-facing aspects of the above changes are documented in the Emacs
manual and the NEWS file:

* doc/emacs/calendar.texi (Diary Conversion): Update manual section to
describe the new importer and exporter.
* doc/emacs/emacs.texi (Detailed node listing): Update to include the
new nodes in docs/emacs/calendar.texi.
* etc/NEWS: Briefly describe the new library, major mode, and options.

The remainder of the changes apply to test files.

The following changes introduce new test files related to the new diary
importer and exporter:

* test/lisp/calendar/diary-icalendar-tests.el (Diary import and export):
Tests for diary-icalendar.  In addition to new tests for the exporter,
the existing import tests for icalendar.el have been ported here; these
use the existing iCalendar files in
test/lisp/calendar/icalendar-resources.  (A few new input .ics files
have also been added to this directory; see below.)
* test/lisp/calendar/diary-icalendar-resources: New directory containing
expected outputs for the import tests in diary-icalendar-tests.el.
(These have the same or similar names to the output files for the old
importer, in test/lisp/calendar/icalendar-resources, but different
contents.  Thus they live in a new directory.)
* test/lisp/calendar/icalendar-resources/import-legacy-function.ics: New
input file to test backward compatibility of the new importer with a
function as the value of 'icalendar-import-format', now obsolete.
* test/lisp/calendar/icalendar-resources/import-legacy-vars.ics: New
input file to test backward compatibility of the new importer with
values for options provided by icalendar.el which are now obsolete.
* test/lisp/calendar/icalendar-resources/import-with-attachment.ics: New
input file to test import of base64-encoded attachments.
* icalendar-resources/import-time-format-12hr-blank.ics: New input file
to test import with a custom value of 'diary-icalendar-time-format'.

Two other new test files provide unit tests for the main functions of
the library:

* test/lisp/calendar/icalendar-parser-tests.el (Parser): Tests for
icalendar-parser.  Most of these are derived from examples in RFC5545,
to ensure the parser implements the standard.
* test/lisp/calendar/icalendar-recur-tests.el (Recurrence rules): Tests
for icalendar-recur.  Most of these are derived from examples in RFC5545,
to ensure the recurrence rule interpreter implements the standard.

A few of the existing test files for icalendar.el have also been
modified.  Besides the specific changes mentioned below, the modified
.ics files also now use CR-LF line endings, as required by RFC5545:

* test/lisp/calendar/icalendar-tests.el (icalendar-deftest-obsolete):
New macro.
* test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.ics:
Correct a malformed VALUE parameter.
* test/lisp/calendar/icalendar-resources/import-rrule-anniversary.ics:
Correct representation of a recurring event.
*
test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.ics:
Add a required VALUE parameter.
* test/lisp/calendar/icalendar-resources/import-rrule-daily.ics:
* test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.ics:
* test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.ics:
* test/lisp/calendar/icalendar-resources/import-rrule-weekly.ics:
Correct a malformed RRULE property.
2025-12-20 13:38:02 -05:00
..
charsets Update copyright year to 2025 2025-01-02 18:39:42 +01:00
e Add auto-margin enable/disable to term 2025-03-02 16:01:13 -05:00
forms Update copyright year to 2025 2025-01-02 18:39:42 +01:00
gnus
images tab-line: Add close button for modified tabs (bug#79046) 2025-07-31 21:35:50 +03:00
nxml
org Update copyright year to 2025 2025-01-02 18:39:42 +01:00
refcards ; Fix copyright years of the Spanish translations 2025-03-04 03:08:31 +01:00
schema 'nxml-mode': add schema for .NET SLNX files. 2025-09-06 12:27:29 +03:00
srecode Update copyright year to 2025 2025-01-02 18:39:42 +01:00
themes Update modus-themes to version 5.1.0 2025-11-07 08:00:39 +02:00
tutorials Fix copyright years by hand 2025-01-02 18:44:48 +01:00
AUTHORS Update files for Emacs 30.2 2025-08-14 04:05:28 -04:00
CALC-NEWS Update copyright year to 2025 2025-01-02 18:39:42 +01:00
ChangeLog.1 ; Delete troff markers from ChangeLog files 2025-02-20 02:46:43 +01:00
compilation.txt Support Rust compiler messages in compile mode (bug#70794). 2025-05-22 11:53:34 +02:00
COPYING
copyright-assign.txt Add assignment form as etc/copyright-assign.txt 2024-06-23 00:24:31 +02:00
DEBUG ; Fix last change 2025-08-07 16:38:02 +03:00
DEVEL.HUMOR ; Fix punctuation in etc/* 2024-07-27 01:51:47 +02:00
DISTRIB Update copyright year to 2025 2025-01-02 18:39:42 +01:00
edt-user.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
EGLOT-NEWS ; Eglot: mention relativePatternSupport in /etc/EGLOT-NEWS 2025-12-19 09:43:53 +00:00
emacs-buffer.gdb Update copyright year to 2025 2025-01-02 18:39:42 +01:00
emacs-mail.desktop
emacs.desktop
emacs.icon
emacs.metainfo.xml Provide Open Age Ratings Service metadata 2025-04-19 16:43:23 +03:00
emacs.service
emacs_lldb.py Update copyright year to 2025 2025-01-02 18:39:42 +01:00
emacsclient-mail.desktop Add 'server-eval-args-left' to server.el 2023-10-29 14:10:23 +02:00
emacsclient.desktop Make emacsclient handle org-protocol:// links 2023-09-18 12:54:22 +02:00
enriched.txt Update copyright year to 2025 2025-01-02 18:39:42 +01:00
ERC-NEWS Fix regression involving erc-channel-user accessors 2025-10-27 19:29:44 -07:00
ETAGS.EBNF Update copyright year to 2025 2025-01-02 18:39:42 +01:00
ETAGS.README Update copyright year to 2025 2025-01-02 18:39:42 +01:00
future-bug ; Fix typos 2025-01-23 03:14:37 +01:00
gnus-tut.txt Update copyright year to 2025 2025-01-02 18:39:42 +01:00
grep.txt Update copyright year to 2025 2025-01-02 18:39:42 +01:00
HELLO Update copyright year to 2025 2025-01-02 18:39:42 +01:00
HISTORY Update files for Emacs 30.2 2025-08-14 04:05:28 -04:00
JOKES
MACHINES Delete duplicate note on ancient platforms 2025-01-05 05:32:01 +01:00
MH-E-NEWS Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NEWS Add full support for iCalendar (RFC5545) data 2025-12-20 13:38:02 -05:00
NEWS.1-17 Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NEWS.18 Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NEWS.19 ; Move time-stamp release info from symbol-releases.eld to NEWS 2025-03-23 10:39:52 -07:00
NEWS.20 ; Move time-stamp release info from symbol-releases.eld to NEWS 2025-03-23 10:39:52 -07:00
NEWS.21 ; Fix capitalization of VC-Dir. 2025-08-10 12:20:42 +01:00
NEWS.22 Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NEWS.23 Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NEWS.24 Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NEWS.25 Fix capitalization ELisp -> Elisp 2025-03-12 09:38:33 +08:00
NEWS.26 Fix capitalization ELisp -> Elisp 2025-03-12 09:38:33 +08:00
NEWS.27 Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NEWS.28 etc/NEWS.28: Mention read-symbol-shorthands to improve C-h v info 2025-11-13 09:06:37 -05:00
NEWS.29 ; Grammar fixes for "native-compiled" 2025-02-28 20:20:55 +01:00
NEWS.30 Merge from origin/emacs-30 2025-08-16 13:35:00 +02:00
NEXTSTEP Update copyright year to 2025 2025-01-02 18:39:42 +01:00
NXML-NEWS Update copyright year to 2025 2025-01-02 18:39:42 +01:00
ORG-NEWS ; Fix typos 2025-02-22 14:48:29 +01:00
org.gnu.emacs.defaults.gschema.xml Update copyright year to 2025 2025-01-02 18:39:42 +01:00
package-keyring.gpg * etc/package-keyring.gpg: Update expiration and add new key 2024-10-22 12:35:18 -04:00
PROBLEMS Merge from origin/emacs-30 2025-11-08 07:04:52 -05:00
ps-prin0.ps Update copyright year to 2025 2025-01-02 18:39:42 +01:00
ps-prin1.ps Update copyright year to 2025 2025-01-02 18:39:42 +01:00
publicsuffix.txt ; * etc/publicsuffix.txt: Update from upstream. 2024-12-22 13:50:41 +02:00
README Update copyright year to 2025 2025-01-02 18:39:42 +01:00
rgb.txt Revert "Update etc/rgb.txt from X.Org upstream" 2023-10-16 08:56:53 +08:00
ses-example.ses Update copyright year to 2025 2025-01-02 18:39:42 +01:00
spook.lines
symbol-releases.eld ; * etc/symbol-releases.eld (dired-click-to-select-mode): Add. 2025-08-23 16:34:43 +03:00
TERMS Update copyright year to 2025 2025-01-02 18:39:42 +01:00
TODO ; * etc/TODO: Add an item about @math images in Info buffers. 2025-11-08 09:04:32 +02:00
w32-feature.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
yow.lines

This directory contains the architecture-independent files used by or
with Emacs.  This includes some text files of documentation for GNU
Emacs or of interest to Emacs users, and the file of dumped docstrings
for Emacs functions and variables.

COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES

File: emacs.icon
  Author: Sun Microsystems, Inc
  Copyright (C) 1999, 2001-2025 Free Software Foundation, Inc.
  License: GNU General Public License version 3 or later (see COPYING)