Mercurial > hg > octave-lyh
changeset 2174:68b02495a5ac
[project @ 1996-05-13 16:08:39 by jwe]
author | jwe |
---|---|
date | Mon, 13 May 1996 16:08:57 +0000 |
parents | b9cfacab52d1 |
children | ceaecd0967f3 |
files | src/error.cc |
diffstat | 1 files changed, 21 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/error.cc +++ b/src/error.cc @@ -39,6 +39,10 @@ #include "user-prefs.h" #include "utils.h" +// TRUE means that Octave will try to beep obnoxiously before printing +// error messages. +static bool Vbeep_on_error; + // Current error state. int error_state = 0; @@ -55,11 +59,11 @@ { flush_octave_stdout (); - int to_beep_or_not_to_beep = user_pref.beep_on_error && ! error_state; + bool to_beep_or_not_to_beep_p = Vbeep_on_error && ! error_state; ostrstream output_buf; - if (to_beep_or_not_to_beep) + if (to_beep_or_not_to_beep_p) output_buf << "\a"; if (name) output_buf << name << ": "; @@ -272,6 +276,21 @@ return handle_message (usage, "unknown", args); } +static int +beep_on_error (void) +{ + Vbeep_on_error = check_preference ("beep_on_error"); + + return 0; +} + +void +symbols_of_error (void) +{ + DEFVAR (beep_on_error, 0.0, 0, beep_on_error, + "if true, beep before printing error messages"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***