/timer off is not consistent when the current timer ($ctimer) is disabled specifically by name or as part of a wildcard.

The current timer does get deleted by the /timer off command, and after being deleted it does not respond to /timer -e. But the difference is whether the $ctimer timer appears in a listing of active timers while the $ctimer timer is running, whether the $timer().prop's return values for the current timer, and whether the $ctimer identifier becomes $null

This /test_timeroff alias defaults to disable both timerX8 and timerX9 by name unless its $1 is non-zero - in which case it instead disables the wildcard pattern X*

/timerX8 1 1 test_timeroff
/timerX9 1 1 test_timeroff

Both of the above commands delete X8 and X9 specifically by name, and both will show the calling timer as part of the existing X* timers, and report .prop values belonging to that timer.

/timerX9 1 1 test_timeroff 1

... changes behavior only by deleting the timers using the "/timerX? off" wildcard. Because the current timer was disabled using a wildcard it is not displayed as an active timer, none of the $timer .prop's return any values for it, and the $ctimer identifier is now $null.

I'm assuming the design behavior is that $ctimer not become $null in this case, and I'm guessing that, since an effort was made to have timeroff give special handling to the current timer, the intent was to have the same thing when it was disabled as part of a wildcard.

alias test_timeroff {
  if ($caller != timer) { timerx9 2 5 echo -a message from x9 $(|) test_timeroff $1 | return }
  echo 3 -a ctimer => $ctimer
  if ($1) {
    echo -a timers turned off: wildcard x?
    timerx? off
  else {
    echo -a timers turned off: x8 x9
    timerx8 off | timerx9 off
  .timerx2 1 1 noop
  echo -a display active timers matching x? wildcard:
  var %a | echo -a command line of ctimer $qt($ctimer) -> $timer( $timer($ctimer).name ).com

Last edited by maroon; 09/12/18 02:39 AM.