1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 09:41:44 +02:00

unposted: fix calendar bug updating repeating events

allow calendar_edit to take arguments for editor
This commit is contained in:
Peter Stephenson 2010-03-09 11:01:20 +00:00
parent e050b88b97
commit 00e507fc0e
4 changed files with 25 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2010-03-09 Peter Stephenson <pws@csr.com>
* unposted: Doc/Zsh/calsys.yo, Functions/Calendar/calendar,
Functions/Calendar/calendar_editfiles: Fix bug that
calendar wouldn't update repeating event times for events
that were already in the past; allow calendar_editfiles to
take argument to specify editor.
2010-03-07 Peter Stephenson <p.w.stephenson@ntlworld.com>
* Michael Hwang: 27773: Src/linklist.c: document how linked
@ -12869,5 +12877,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.4925 $
* $Revision: 1.4926 $
*****************************************************

View file

@ -463,8 +463,11 @@ The second line will not be shown by the tt(calendar) function.
)
findex(calendar_edit)
item(tt(calendar_edit))(
This calls the user's editor to edit the calendar file. The editor
is given by the variable tt(VISUAL), if set, else the variable tt(EDITOR).
This calls the user's editor to edit the calendar file. If
there are arguments, they are taken as the editor to use (the file name
is appended to the commands); otherwise, the editor is given by the
variable tt(VISUAL), if set, else the variable tt(EDITOR).
If the calendar scheduler was running, then after editing the file
tt(calendar -s) is called to update it.

View file

@ -328,6 +328,10 @@ fi
(( tsched = t - mywarntime ))
if (( tsched >= start && tsched <= stop)); then
$showprog $start $stop "due in ${mywarnstr}: $showline"
elif (( tsched < start )); then
# We haven't actually shown it, but it's in the past,
# so treat it the same. Should probably rename this variable.
(( shown = 1 ))
fi
fi
if [[ -n $sched ]]; then

View file

@ -1,9 +1,14 @@
local editor=${VISUAL:-${EDITOR:-vi}}
local line calendar
local -a lockfiles
local -a lockfiles editor
integer cal_running
if (( $# )); then
editor=("$@")
else
editor=(${VISUAL:-${EDITOR:-vi}})
fi
sched | while read line; do
[[ $line = *" calendar -s "<->" "<-> ]] && (( cal_running = 1 ))
done