about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-03-09 11:01:20 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-03-09 11:01:20 +0000
commit00e507fc0eb53fb00f34e55cd89bef4cfffa8663 (patch)
treee554eb6afda593d1b1f94e2d8c6d6939c593cb0f
parente050b88b970591f9c6eae2230520a0ddd12589ec (diff)
downloadzsh-00e507fc0eb53fb00f34e55cd89bef4cfffa8663.tar.gz
zsh-00e507fc0eb53fb00f34e55cd89bef4cfffa8663.tar.xz
zsh-00e507fc0eb53fb00f34e55cd89bef4cfffa8663.zip
unposted: fix calendar bug updating repeating events
allow calendar_edit to take arguments for editor
-rw-r--r--ChangeLog10
-rw-r--r--Doc/Zsh/calsys.yo7
-rw-r--r--Functions/Calendar/calendar4
-rw-r--r--Functions/Calendar/calendar_edit9
4 files changed, 25 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8813d32b5..900f84219 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
 *****************************************************
diff --git a/Doc/Zsh/calsys.yo b/Doc/Zsh/calsys.yo
index 94ddd9f75..ea315f5c3 100644
--- a/Doc/Zsh/calsys.yo
+++ b/Doc/Zsh/calsys.yo
@@ -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.
 
diff --git a/Functions/Calendar/calendar b/Functions/Calendar/calendar
index b87a14628..baf6b36da 100644
--- a/Functions/Calendar/calendar
+++ b/Functions/Calendar/calendar
@@ -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
diff --git a/Functions/Calendar/calendar_edit b/Functions/Calendar/calendar_edit
index e3ac5c39b..430c3b2e9 100644
--- a/Functions/Calendar/calendar_edit
+++ b/Functions/Calendar/calendar_edit
@@ -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