diff options
| author | Richard Lawrence | 2026-01-07 18:19:13 +0100 |
|---|---|---|
| committer | Stefan Monnier | 2026-02-01 09:46:09 -0500 |
| commit | 4db3be200114caacf068f56dc60796fd7c77b619 (patch) | |
| tree | 56e8d769c063210743179a597dc091c8bbd06854 | |
| parent | 74750e269b978b5a18329642d4370fdea2b536c1 (diff) | |
| download | emacs-scratch/icalendar.tar.gz emacs-scratch/icalendar.zip | |
Fix iCalendar macro (debug ...) forms and indentationscratch/icalendar
As discussed in Bug#74994.
* lisp/calendar/icalendar-ast.el (icalendar-make-param)
(icalendar-make-property, icalendar-make-component)
(icalendar-make-node-from-templates)
* lisp/calendar/icalendar-macs.el (icalendar-with-node-children)
(icalendar-with-node-value, icalendar-with-param)
(icalendar-with-child-of, icalendar-with-property-of): Remove extraneous
arguments in (debug ...) forms.
* lisp/calendar/icalendar-recur.el
* lisp/calendar/diary-icalendar.el: Fix indentation of calls to them.
Plus one other minor fix:
* lisp/calendar/diary-icalendar.el
(diary-icalendar-current-tz-to-vtimezone): Ignore unused error
variable (fixes a byte compiler warning).
| -rw-r--r-- | lisp/calendar/diary-icalendar.el | 24 | ||||
| -rw-r--r-- | lisp/calendar/icalendar-ast.el | 10 | ||||
| -rw-r--r-- | lisp/calendar/icalendar-macs.el | 10 | ||||
| -rw-r--r-- | lisp/calendar/icalendar-recur.el | 32 |
4 files changed, 38 insertions, 38 deletions
diff --git a/lisp/calendar/diary-icalendar.el b/lisp/calendar/diary-icalendar.el index eed53bfd700..c15e2cdbddf 100644 --- a/lisp/calendar/diary-icalendar.el +++ b/lisp/calendar/diary-icalendar.el | |||
| @@ -2111,7 +2111,7 @@ node. Return this node, or nil." | |||
| 2111 | (when (and di:class-regexp | 2111 | (when (and di:class-regexp |
| 2112 | (re-search-forward di:class-regexp nil t)) | 2112 | (re-search-forward di:class-regexp nil t)) |
| 2113 | (ical:make-property ical:class | 2113 | (ical:make-property ical:class |
| 2114 | (upcase (string-trim (match-string 1)))))) | 2114 | (upcase (string-trim (match-string 1)))))) |
| 2115 | 2115 | ||
| 2116 | (defun di:parse-status () | 2116 | (defun di:parse-status () |
| 2117 | "Parse `icalendar-status' node from entry. | 2117 | "Parse `icalendar-status' node from entry. |
| @@ -2123,7 +2123,7 @@ as an `icalendar-status' node. Return this node, or nil." | |||
| 2123 | (when (and di:status-regexp | 2123 | (when (and di:status-regexp |
| 2124 | (re-search-forward di:status-regexp nil t)) | 2124 | (re-search-forward di:status-regexp nil t)) |
| 2125 | (ical:make-property ical:status | 2125 | (ical:make-property ical:status |
| 2126 | (upcase (string-trim (match-string 1)))))) | 2126 | (upcase (string-trim (match-string 1)))))) |
| 2127 | 2127 | ||
| 2128 | (defun di:parse-url () | 2128 | (defun di:parse-url () |
| 2129 | "Parse `icalendar-url' node from entry. | 2129 | "Parse `icalendar-url' node from entry. |
| @@ -2635,7 +2635,7 @@ Returns a pair of nodes (START RRULE)." | |||
| 2635 | "`diary-float' with large N=%d may not be supported on other systems" n))) | 2635 | "`diary-float' with large N=%d may not be supported on other systems" n))) |
| 2636 | 2636 | ||
| 2637 | (list (ical:make-property ical:dtstart dtstart | 2637 | (list (ical:make-property ical:dtstart dtstart |
| 2638 | (ical:valuetypeparam 'ical:date)) | 2638 | (ical:valuetypeparam 'ical:date)) |
| 2639 | (ical:make-property ical:rrule rrule)))) | 2639 | (ical:make-property ical:rrule rrule)))) |
| 2640 | 2640 | ||
| 2641 | (defun di:offset-sexp-to-nodes (sexp) | 2641 | (defun di:offset-sexp-to-nodes (sexp) |
| @@ -2824,7 +2824,7 @@ formatting alarms as mail messages. Returns the modified COMPONENT." | |||
| 2824 | (setq all-attendees (append entry-attendees all-attendees))) | 2824 | (setq all-attendees (append entry-attendees all-attendees))) |
| 2825 | ((stringp address) | 2825 | ((stringp address) |
| 2826 | (push (ical:make-property ical:attendee | 2826 | (push (ical:make-property ical:attendee |
| 2827 | (concat "mailto:" address)) | 2827 | (concat "mailto:" address)) |
| 2828 | all-attendees)))) | 2828 | all-attendees)))) |
| 2829 | (push (ical:make-valarm | 2829 | (push (ical:make-valarm |
| 2830 | (ical:action "EMAIL") | 2830 | (ical:action "EMAIL") |
| @@ -2968,7 +2968,7 @@ nil, if MONTHS, DAYS and YEARS are all integers)." | |||
| 2968 | (rrule-node (when freq (ical:make-property ical:rrule recur-value))) | 2968 | (rrule-node (when freq (ical:make-property ical:rrule recur-value))) |
| 2969 | (rdate-node (when rdates | 2969 | (rdate-node (when rdates |
| 2970 | (ical:make-property ical:rdate rdates | 2970 | (ical:make-property ical:rdate rdates |
| 2971 | (ical:valuetypeparam rdate-type)))) | 2971 | (ical:valuetypeparam rdate-type)))) |
| 2972 | (dtstart-node (ical:make-property ical:dtstart dtstart))) | 2972 | (dtstart-node (ical:make-property ical:dtstart dtstart))) |
| 2973 | (list dtstart-node (or rrule-node rdate-node)))))) | 2973 | (list dtstart-node (or rrule-node rdate-node)))))) |
| 2974 | 2974 | ||
| @@ -3050,16 +3050,16 @@ property and must be present even if the recurrence set is empty.)" | |||
| 3050 | (append | 3050 | (append |
| 3051 | (list | 3051 | (list |
| 3052 | (ical:make-property ical:dtstart dtstart | 3052 | (ical:make-property ical:dtstart dtstart |
| 3053 | (ical:valuetypeparam 'ical:date)) | 3053 | (ical:valuetypeparam 'ical:date)) |
| 3054 | ;; TODO: should we maybe use an X-name property for this? | 3054 | ;; TODO: should we maybe use an X-name property for this? |
| 3055 | (ical:make-property ical:comment (format "%s" sexp))) | 3055 | (ical:make-property ical:comment (format "%s" sexp))) |
| 3056 | (if rdates | 3056 | (if rdates |
| 3057 | (list | 3057 | (list |
| 3058 | (ical:make-property ical:rdate rdates | 3058 | (ical:make-property ical:rdate rdates |
| 3059 | (ical:valuetypeparam 'ical:date))) | 3059 | (ical:valuetypeparam 'ical:date))) |
| 3060 | (list | 3060 | (list |
| 3061 | (ical:make-property ical:exdate exdates | 3061 | (ical:make-property ical:exdate exdates |
| 3062 | (ical:valuetypeparam 'ical:date))))))) | 3062 | (ical:valuetypeparam 'ical:date))))))) |
| 3063 | 3063 | ||
| 3064 | (defun di:sexp-to-nodes (sexp &optional vtimezone) | 3064 | (defun di:sexp-to-nodes (sexp &optional vtimezone) |
| 3065 | "Convert a diary S-expression SEXP to a list of iCalendar property nodes. | 3065 | "Convert a diary S-expression SEXP to a list of iCalendar property nodes. |
| @@ -3110,7 +3110,7 @@ times according to `diary-icalendar-time-zone-export-strategy'." | |||
| 3110 | See `icalendar-recur-current-tz-to-vtimezone' for arguments' meanings. | 3110 | See `icalendar-recur-current-tz-to-vtimezone' for arguments' meanings. |
| 3111 | This function wraps that one, but signals `icalendar-diary-export-error' | 3111 | This function wraps that one, but signals `icalendar-diary-export-error' |
| 3112 | instead if TZ cannot be converted." | 3112 | instead if TZ cannot be converted." |
| 3113 | (condition-case err | 3113 | (condition-case _ |
| 3114 | (icr:current-tz-to-vtimezone tz tzid start-year) | 3114 | (icr:current-tz-to-vtimezone tz tzid start-year) |
| 3115 | ((ical:tz-insufficient-data ical:tz-unsupported) | 3115 | ((ical:tz-insufficient-data ical:tz-unsupported) |
| 3116 | (di:signal-export-error | 3116 | (di:signal-export-error |
| @@ -3270,7 +3270,7 @@ recursive calls to this function made by | |||
| 3270 | :buffer (current-buffer) | 3270 | :buffer (current-buffer) |
| 3271 | :position (point))) | 3271 | :position (point))) |
| 3272 | (push (ical:make-property ical:duration | 3272 | (push (ical:make-property ical:duration |
| 3273 | (ical:duration-between dtstart dtend)) | 3273 | (ical:duration-between dtstart dtend)) |
| 3274 | all-props)) | 3274 | all-props)) |
| 3275 | ;; Otherwise we make a normal DTEND: | 3275 | ;; Otherwise we make a normal DTEND: |
| 3276 | (push (ical:make-property ical:dtend dtend) | 3276 | (push (ical:make-property ical:dtend dtend) |
| @@ -3309,7 +3309,7 @@ recursive calls to this function made by | |||
| 3309 | vtimezone))) | 3309 | vtimezone))) |
| 3310 | values))) | 3310 | values))) |
| 3311 | (push (ical:make-property ical:rdate rdates | 3311 | (push (ical:make-property ical:rdate rdates |
| 3312 | (ical:tzidparam tzid)) | 3312 | (ical:tzidparam tzid)) |
| 3313 | all-props))) | 3313 | all-props))) |
| 3314 | 3314 | ||
| 3315 | ;; preserve any other node read from date, e.g. RRULE, as is: | 3315 | ;; preserve any other node read from date, e.g. RRULE, as is: |
| @@ -3341,7 +3341,7 @@ recursive calls to this function made by | |||
| 3341 | (when url (push url all-props))) | 3341 | (when url (push url all-props))) |
| 3342 | (push (or (di:parse-uid) | 3342 | (push (or (di:parse-uid) |
| 3343 | (ical:make-property ical:uid | 3343 | (ical:make-property ical:uid |
| 3344 | (ical:make-uid all-props))) | 3344 | (ical:make-uid all-props))) |
| 3345 | all-props) | 3345 | all-props) |
| 3346 | 3346 | ||
| 3347 | ;; Allow users to add to the properties parsed: | 3347 | ;; Allow users to add to the properties parsed: |
diff --git a/lisp/calendar/icalendar-ast.el b/lisp/calendar/icalendar-ast.el index a84e28d36c1..e9c289f16db 100644 --- a/lisp/calendar/icalendar-ast.el +++ b/lisp/calendar/icalendar-ast.el | |||
| @@ -358,7 +358,7 @@ VALUE does not satisfy (any type in) TYPE." | |||
| 358 | (signal 'wrong-type-argument (list `(list-of ,type) value))) | 358 | (signal 'wrong-type-argument (list `(list-of ,type) value))) |
| 359 | (unless (cl-typep value type) | 359 | (unless (cl-typep value type) |
| 360 | (signal 'wrong-type-argument (list type value))) | 360 | (signal 'wrong-type-argument (list type value))) |
| 361 | (ical:make-ast-node type (list :value value)))) | 361 | (ical:make-ast-node type (list :value value)))) |
| 362 | ((listp type) | 362 | ((listp type) |
| 363 | ;; N.B. nil is allowed; in that case, `ical:type-of' will check all | 363 | ;; N.B. nil is allowed; in that case, `ical:type-of' will check all |
| 364 | ;; types in `ical:value-types': | 364 | ;; types in `ical:value-types': |
| @@ -416,7 +416,7 @@ will return an `icalendar-deltoparam' node whose value is a list of | |||
| 416 | 416 | ||
| 417 | The resulting syntax node is checked for validity by | 417 | The resulting syntax node is checked for validity by |
| 418 | `icalendar-ast-node-valid-p' before it is returned." | 418 | `icalendar-ast-node-valid-p' before it is returned." |
| 419 | (declare (debug (symbolp form form))) | 419 | (declare (debug (symbolp form))) |
| 420 | ;; TODO: support `ical:otherparam' | 420 | ;; TODO: support `ical:otherparam' |
| 421 | (unless (ical:param-type-symbol-p type) | 421 | (unless (ical:param-type-symbol-p type) |
| 422 | (error "Not an iCalendar param type: %s" type)) | 422 | (error "Not an iCalendar param type: %s" type)) |
| @@ -490,7 +490,7 @@ The resulting syntax node is checked for validity by | |||
| 490 | `icalendar-ast-node-valid-p' before it is returned." | 490 | `icalendar-ast-node-valid-p' before it is returned." |
| 491 | ;; TODO: support `ical:other-property', maybe like | 491 | ;; TODO: support `ical:other-property', maybe like |
| 492 | ;; (ical:other-property "X-NAME" value ...) | 492 | ;; (ical:other-property "X-NAME" value ...) |
| 493 | (declare (debug (symbolp form form &rest form)) | 493 | (declare (debug (symbolp form &rest form)) |
| 494 | (indent 2)) | 494 | (indent 2)) |
| 495 | (unless (ical:property-type-symbol-p type) | 495 | (unless (ical:property-type-symbol-p type) |
| 496 | (error "Not an iCalendar property type: %s" type)) | 496 | (error "Not an iCalendar property type: %s" type)) |
| @@ -554,7 +554,7 @@ properties. | |||
| 554 | 554 | ||
| 555 | The resulting syntax node is checked for validity by | 555 | The resulting syntax node is checked for validity by |
| 556 | `icalendar-ast-node-valid-p' before it is returned." | 556 | `icalendar-ast-node-valid-p' before it is returned." |
| 557 | (declare (debug (symbolp form &rest form)) | 557 | (declare (debug (symbolp &rest form)) |
| 558 | (indent 1)) | 558 | (indent 1)) |
| 559 | ;; TODO: support `ical:other-component', maybe like | 559 | ;; TODO: support `ical:other-component', maybe like |
| 560 | ;; (ical:other-component (:x-name "X-NAME") templates ...) | 560 | ;; (ical:other-component (:x-name "X-NAME") templates ...) |
| @@ -662,7 +662,7 @@ For example, an iCalendar VEVENT could be written like this: | |||
| 662 | 662 | ||
| 663 | Before the constructed node is returned, it is validated by | 663 | Before the constructed node is returned, it is validated by |
| 664 | `icalendar-ast-node-valid-p'." | 664 | `icalendar-ast-node-valid-p'." |
| 665 | (declare (debug (symbolp form &rest form)) | 665 | (declare (debug (symbolp &rest form)) |
| 666 | (indent 1)) | 666 | (indent 1)) |
| 667 | (cond | 667 | (cond |
| 668 | ((not (ical:type-symbol-p type)) | 668 | ((not (ical:type-symbol-p type)) |
diff --git a/lisp/calendar/icalendar-macs.el b/lisp/calendar/icalendar-macs.el index 852b48012a7..d46eca978a0 100644 --- a/lisp/calendar/icalendar-macs.el +++ b/lisp/calendar/icalendar-macs.el | |||
| @@ -830,7 +830,7 @@ Each binding in BINDINGS should be a list of one of the following forms: | |||
| 830 | nodes), or the :value-nodes themselves (if they are not). | 830 | nodes), or the :value-nodes themselves (if they are not). |
| 831 | It is a compile-time error to use the singular keywords with a TYPE that | 831 | It is a compile-time error to use the singular keywords with a TYPE that |
| 832 | takes multiple values, or the plural keywords with a TYPE that does not." | 832 | takes multiple values, or the plural keywords with a TYPE that does not." |
| 833 | (declare (debug (symbolp form form &rest form)) | 833 | (declare (debug (form form &rest form)) |
| 834 | (indent 2)) | 834 | (indent 2)) |
| 835 | ;; Static checks on the bindings prevent various annoying bugs: | 835 | ;; Static checks on the bindings prevent various annoying bugs: |
| 836 | (dolist (b bindings) | 836 | (dolist (b bindings) |
| @@ -1004,7 +1004,7 @@ is equivalent to | |||
| 1004 | 1004 | ||
| 1005 | BINDINGS are passed on to `icalendar-with-node-children' and will be | 1005 | BINDINGS are passed on to `icalendar-with-node-children' and will be |
| 1006 | available in BODY; see its docstring for their form." | 1006 | available in BODY; see its docstring for their form." |
| 1007 | (declare (debug (symbolp form &optional form &rest form)) | 1007 | (declare (debug (form &optional form &rest form)) |
| 1008 | (indent 2)) | 1008 | (indent 2)) |
| 1009 | (let ((vn (gensym "icalendar-node")) | 1009 | (let ((vn (gensym "icalendar-node")) |
| 1010 | (val (gensym "icalendar-value")) | 1010 | (val (gensym "icalendar-value")) |
| @@ -1069,7 +1069,7 @@ node's value. | |||
| 1069 | If PARAMETER's value is not a syntax node, then `value' is bound | 1069 | If PARAMETER's value is not a syntax node, then `value' is bound |
| 1070 | directly to PARAMETER's value, and `value-type' and `value-node' are | 1070 | directly to PARAMETER's value, and `value-type' and `value-node' are |
| 1071 | bound to nil." | 1071 | bound to nil." |
| 1072 | (declare (debug (symbolp form &rest form)) | 1072 | (declare (debug (form &rest form)) |
| 1073 | (indent 1)) | 1073 | (indent 1)) |
| 1074 | `(ical:with-node-value ,parameter nil ,@body)) | 1074 | `(ical:with-node-value ,parameter nil ,@body)) |
| 1075 | 1075 | ||
| @@ -1089,7 +1089,7 @@ is equivalent to | |||
| 1089 | (icalendar-with-child-of some-node some-type nil value) | 1089 | (icalendar-with-child-of some-node some-type nil value) |
| 1090 | 1090 | ||
| 1091 | See `icalendar-with-node-children' for the form of BINDINGS." | 1091 | See `icalendar-with-node-children' for the form of BINDINGS." |
| 1092 | (declare (debug (symbolp form form &optional form &rest form)) | 1092 | (declare (debug (form form &optional form &rest form)) |
| 1093 | (indent 3)) | 1093 | (indent 3)) |
| 1094 | (let ((child (gensym "icalendar-node"))) | 1094 | (let ((child (gensym "icalendar-node"))) |
| 1095 | `(let ((,child (ical:ast-node-first-child-of ,type ,node))) | 1095 | `(let ((,child (ical:ast-node-first-child-of ,type ,node))) |
| @@ -1123,7 +1123,7 @@ symbol `value'; thus | |||
| 1123 | (icalendar-with-param-of some-property some-type) | 1123 | (icalendar-with-param-of some-property some-type) |
| 1124 | is equivalent to | 1124 | is equivalent to |
| 1125 | (icalendar-with-param-of some-property some-type nil value)" | 1125 | (icalendar-with-param-of some-property some-type nil value)" |
| 1126 | (declare (debug (symbolp form form &rest form)) | 1126 | (declare (debug (form form &rest form)) |
| 1127 | (indent 2)) | 1127 | (indent 2)) |
| 1128 | `(ical:with-child-of ,node ,type nil ,@body)) | 1128 | `(ical:with-child-of ,node ,type nil ,@body)) |
| 1129 | 1129 | ||
diff --git a/lisp/calendar/icalendar-recur.el b/lisp/calendar/icalendar-recur.el index e3bee0923a9..391f3b91a92 100644 --- a/lisp/calendar/icalendar-recur.el +++ b/lisp/calendar/icalendar-recur.el | |||
| @@ -2123,22 +2123,22 @@ to start the observances in the time zone. It defaults to 1970." | |||
| 2123 | :minute (mod dst-end-minutes 60) | 2123 | :minute (mod dst-end-minutes 60) |
| 2124 | :second 0))) | 2124 | :second 0))) |
| 2125 | 2125 | ||
| 2126 | (ical:make-vtimezone | 2126 | (ical:make-vtimezone |
| 2127 | (ical:tzid (or tzid (concat icr:-emacs-local-tzid std-name))) | 2127 | (ical:tzid (or tzid (concat icr:-emacs-local-tzid std-name))) |
| 2128 | (ical:make-standard | 2128 | (ical:make-standard |
| 2129 | (ical:tzname std-name) | 2129 | (ical:tzname std-name) |
| 2130 | (ical:dtstart std-start) | 2130 | (ical:dtstart std-start) |
| 2131 | (ical:rrule dst->std-rule) | 2131 | (ical:rrule dst->std-rule) |
| 2132 | (ical:tzoffsetfrom dst-offset) | 2132 | (ical:tzoffsetfrom dst-offset) |
| 2133 | (ical:tzoffsetto std-offset) | 2133 | (ical:tzoffsetto std-offset) |
| 2134 | (ical:comment icr:-tz-warning)) | 2134 | (ical:comment icr:-tz-warning)) |
| 2135 | (ical:make-daylight | 2135 | (ical:make-daylight |
| 2136 | (ical:tzname dst-name) | 2136 | (ical:tzname dst-name) |
| 2137 | (ical:dtstart dst-start) | 2137 | (ical:dtstart dst-start) |
| 2138 | (ical:rrule std->dst-rule) | 2138 | (ical:rrule std->dst-rule) |
| 2139 | (ical:tzoffsetfrom std-offset) | 2139 | (ical:tzoffsetfrom std-offset) |
| 2140 | (ical:tzoffsetto dst-offset) | 2140 | (ical:tzoffsetto dst-offset) |
| 2141 | (ical:comment icr:-tz-warning))))))) | 2141 | (ical:comment icr:-tz-warning))))))) |
| 2142 | 2142 | ||
| 2143 | (provide 'icalendar-recur) | 2143 | (provide 'icalendar-recur) |
| 2144 | 2144 | ||