emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ox-icalendar.el: create alarm at event time


From: Nicolas Goaziou
Subject: Re: [PATCH] ox-icalendar.el: create alarm at event time
Date: Sun, 26 Dec 2021 22:22:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hello,

Mikhail Skorzhinskii <mskorzhinskiy@eml.cc> writes:

> * lisp/ox-icalendar.el (org-icalendar-force-alarm): option to set alarm
> even if alarm time is set to zero.
> * lisp/ox-icalendar.el (org-icalendar--valarm): create VALARM at the
> event start if the alarm time is set to zero and
> `org-icalendar-force-alarm' is set to true.

Thanks. Some comments follow.

> +(defcustom org-icalendar-force-alarm nil
> +  "Non-nil means alarm will be created even if is set to zero.
> +
> +This overrides default behaviour where zero means no alarm. With
                                                             ^^^
You need two spaces after full stop.

> +this set to non-nil and alarm set to zero, alarm will be created
> +and will fire at the event start."
> +  :group 'org-export-icalendar
> +  :type 'bool)

`boolean' is the valid type.

You also need to add :package-version '(Org . "9.6") and :safe #'booleanp.
> +                (if org-icalendar-force-alarm
> +                    (if alarm-time
> +                        alarm-time
> +                      org-icalendar-alarm-time)
> +                  (if (zerop alarm-time)
> +                      org-icalendar-alarm-time
> +                    alarm-time))))))

I suggest to refactor the above into something like:

(cond
 ((> alarm-time 0) alarm-time)
 ((and (= 0 alarm-time) org-icalendar-force-alarm) alarm-time)
 (t org-icalendar-alarm-time))

Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]