diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2007-03-26 14:33:31 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-03-26 14:33:31 +0000 |
| commit | 4b7b7f56f1cde7e317fce378d0d0e5c83686ff72 (patch) | |
| tree | 2420ad49f480b9c2de0c3f13da7bca9f8a415678 /Functions/Calendar/calendar_edit | |
| parent | users/11333: fix users-hosts for ssh when user matched (diff) | |
| download | zsh-4b7b7f56f1cde7e317fce378d0d0e5c83686ff72.tar zsh-4b7b7f56f1cde7e317fce378d0d0e5c83686ff72.tar.gz zsh-4b7b7f56f1cde7e317fce378d0d0e5c83686ff72.tar.bz2 zsh-4b7b7f56f1cde7e317fce378d0d0e5c83686ff72.tar.lz zsh-4b7b7f56f1cde7e317fce378d0d0e5c83686ff72.tar.xz zsh-4b7b7f56f1cde7e317fce378d0d0e5c83686ff72.tar.zst zsh-4b7b7f56f1cde7e317fce378d0d0e5c83686ff72.zip | |
unposted: more random calendar system fixes and improvements
Diffstat (limited to 'Functions/Calendar/calendar_edit')
| -rw-r--r-- | Functions/Calendar/calendar_edit | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Functions/Calendar/calendar_edit b/Functions/Calendar/calendar_edit new file mode 100644 index 000000000..e31decb76 --- /dev/null +++ b/Functions/Calendar/calendar_edit @@ -0,0 +1,21 @@ +local editor=${VISUAL:-${EDITOR:-vi}} +local line calendar +local -a lockfiles + +integer cal_running + +sched | while read line; do + [[ $line = *" calendar -s "<->" "<-> ]] && (( cal_running = 1 )) +done + +zstyle -s ':datetime:calendar:' calendar-file calendar || calendar=~/calendar + +{ + calendar_lockfiles $calendar || return 1 + + eval $editor \$calendar +} always { + (( ${#lockfiles} )) && rm -f $lockfiles +} + +(( cal_running )) && calendar -s |
