comparison src/w32console.c @ 23563:18c5f58b70b5

(Fset_message_beep): Recognize 'silent. (w32_sys_ring_bell): Do nothing for the 'silent sound.
author Geoff Voelker <voelker@cs.washington.edu>
date Wed, 28 Oct 1998 05:48:12 +0000
parents 0e7c65caf1cb
children 1fa5f9f5c92e
comparison
equal deleted inserted replaced
23562:5f3243813b18 23563:18c5f58b70b5
410 410
411 scroll_line (n, LEFT); 411 scroll_line (n, LEFT);
412 } 412 }
413 413
414 static unsigned int sound_type = 0xFFFFFFFF; 414 static unsigned int sound_type = 0xFFFFFFFF;
415 #define MB_EMACS_SILENT (0xFFFFFFFF - 1)
415 416
416 void 417 void
417 w32_sys_ring_bell (void) 418 w32_sys_ring_bell (void)
418 { 419 {
419 if (sound_type == 0xFFFFFFFF) 420 if (sound_type == 0xFFFFFFFF)
421 {
420 Beep (666, 100); 422 Beep (666, 100);
423 }
424 else if (sound_type == MB_EMACS_SILENT)
425 {
426 /* Do nothing. */
427 }
421 else 428 else
422 MessageBeep (sound_type); 429 MessageBeep (sound_type);
423 } 430 }
424 431
425 DEFUN ("set-message-beep", Fset_message_beep, Sset_message_beep, 1, 1, 0, 432 DEFUN ("set-message-beep", Fset_message_beep, Sset_message_beep, 1, 1, 0,
426 "Set the sound generated when the bell is rung.\n\ 433 "Set the sound generated when the bell is rung.\n\
427 SOUND is 'asterisk, 'exclamation, 'hand, 'question, or 'ok\n\ 434 SOUND is 'asterisk, 'exclamation, 'hand, 'question, 'ok, or 'silent\n\
428 to use the corresponding system sound for the bell.\n\ 435 to use the corresponding system sound for the bell. The 'silent sound\n\
436 prevents Emacs from making any sound at all.\n\
429 SOUND is nil to use the normal beep.") 437 SOUND is nil to use the normal beep.")
430 (sound) 438 (sound)
431 Lisp_Object sound; 439 Lisp_Object sound;
432 { 440 {
433 CHECK_SYMBOL (sound, 0); 441 CHECK_SYMBOL (sound, 0);
442 sound_type = MB_ICONHAND; 450 sound_type = MB_ICONHAND;
443 else if (EQ (sound, intern ("question"))) 451 else if (EQ (sound, intern ("question")))
444 sound_type = MB_ICONQUESTION; 452 sound_type = MB_ICONQUESTION;
445 else if (EQ (sound, intern ("ok"))) 453 else if (EQ (sound, intern ("ok")))
446 sound_type = MB_OK; 454 sound_type = MB_OK;
455 else if (EQ (sound, intern ("silent")))
456 sound_type = MB_EMACS_SILENT;
447 else 457 else
448 sound_type = 0xFFFFFFFF; 458 sound_type = 0xFFFFFFFF;
449 459
450 return sound; 460 return sound;
451 } 461 }