[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-wiki-discuss] planner-diary ( Last Day of Month )
From: |
Jim Ottaway |
Subject: |
Re: [emacs-wiki-discuss] planner-diary ( Last Day of Month ) |
Date: |
Fri, 01 Jul 2005 00:04:56 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>>>>> Paul D Kraus <address@hidden> writes:
> Jim Ottaway wrote:
>>>>>>> Paul D Kraus <address@hidden> writes:
>>> How can I set an appointment that is always going to be on the last day
>>> of the month?
>> This seems to work [in the diary file]:
>> &%%(= 1
>> (nth 1
>> (calendar-gregorian-from-absolute
>> (1+
>> (calendar-absolute-from-gregorian date))))) appointment last day of
>> the month
> This worked well. Is there a way to create a cyclic task that is on
> the last day of every month?
Isn't that what this does? What happens to the bit after the sexp
depends upon whether it looks like a task [or like a schedule line if
you use planner-appt `planner-appt-use-schedule' and
`planner-appt-schedule-cyclic-insinuate'].
Incidentally, I don't like the look of the `(nth 1 ...)' in the code I
posted; this is much better [doesn't rely on knowing the internals of
the date data structure]:
&%%(= 1
(extract-calendar-day
(calendar-gregorian-from-absolute
(1+ (calendar-absolute-from-gregorian date)))))
Or it could be functionized (tm):
(defun calendar-last-day-of-month (date &optional mark)
(when (= 1
(extract-calendar-day
(calendar-gregorian-from-absolute
(1+ (calendar-absolute-from-gregorian date)))))
(cons mark entry)))
... and then, if you want it highlighted in the calendar:
%% (calendar-last-day-of-month date) # A _ @13:00 Appointment X
... and if don't you want it highlighted in the calendar, miss out the
ampersand:
&%% (calendar-last-day-of-month date) # A _ @13:00 Appointment X
... and if it is a schedule appointment that you want highlighted in
the calendar:
%% (calendar-last-day-of-month date) @13:00 Appointment X
... etc.
Regards,
--
Jim Ottaway