!bell - Sound audio alarm
!bell [n]
!bell provides a warning (audible or visual) to alert the user of a problem. !bell honors the quiet(2m) mode, as such if quiet mode is disabled an audible warning is given, otherwise a visual warning is given to the user (usually the message "[BELL]" in the bottom left hand corner of the message line).
The optional numerical argument n over-rides the current setting of quite, a value of 0 specifies a quite bell, 2 an audible one, when omitted the default is 1 honoring the setting of quite mode.
!bell is generally used in conjunction with !abort, the !bell function warning the user and the !abort function to quit the macro.
The following macro example checks for incoming mail and is taken from mail.emf. If any mail has arrived an audible warning is assured by toggling the quiet mode.
; ; Mail checker define-macro mail-check !if &seq &set %vm-mail-src ® &spr "/history/%s/mail-src" $platform "" ml-write "[Incoming mail file not setup! Use Help/User setup]" !abort !endif 600000 create-callback mail-check ml-write &spr "Checking for mail in %s..." %vm-mail-src set-variable #l0 &cond &gre &stat "s" %vm-mail-src 0 "M" "-" !if ¬ &seq &mid $mode-line 2 1 #l0 set-variable #l1 &rig $mode-line &cond &seq &mid $mode-line 2 1 "%" 4 3 set-variable $mode-line &cat &cat &lef $mode-line 2 #l0 #l1 screen-update !if &seq #l0 "M" ; use no argument to the global-mode so it toggles it back to its original state !bell global-mode "quiet" !bell global-mode "quiet" !endif !endif 0 ml-write !emacro
Copyright (c) 1998-2006 JASSPA
Last Modified: 2005/01/23
Generated On: 2006/10/07