From 9cfc991811c9affc47efec7a58bcf1df16790f53 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 17 Mar 2010 16:55:04 +0000 Subject: unposted: calendar -s was broken by file locking change --- Functions/Calendar/calendar | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Functions') diff --git a/Functions/Calendar/calendar b/Functions/Calendar/calendar index baf6b36da..a7aa08595 100644 --- a/Functions/Calendar/calendar +++ b/Functions/Calendar/calendar @@ -42,6 +42,8 @@ if [[ -n $warnstr ]]; then fi fi +local myschedcmds="${TMPPREFIX:-/tmp/zsh}.sched.$$" + [[ -f $calendar ]] || return 1 # We're not using getopts because we want +... to refer to a @@ -394,8 +396,10 @@ fi if [[ $next -ge 0 ]]; then # Remove any existing calendar scheduling. i=${"${(@)zsh_scheduled_events#*:*:}"[(I)calendar -s*]} - (( i )) && sched -$i - $sched $next calendar "${calopts[@]}" $next $next + { + (( i )) && print sched -$i + print $sched $next calendar "${calopts[@]}" $next $next + } >$myschedcmds else $showprog $start $stop \ "No more calendar events: calendar not rescheduled. @@ -427,4 +431,10 @@ Old calendar left in $calendar.old." >&2 } exit $rstat -) +) && { + # Tasks that need to be in the current shell + if [[ -f $myschedcmds ]]; then + . $myschedcmds + rm -f $myschedcmds + fi +} -- cgit 1.4.1