comparison src/octave.cc @ 1588:27f5ac98fc4a

[project @ 1995-10-31 06:04:47 by jwe]
author jwe
date Tue, 31 Oct 1995 06:04:47 +0000
parents 0d9e10d10bd7
children 583476712438
comparison
equal deleted inserted replaced
1587:dd087a402811 1588:27f5ac98fc4a
321 add_unwind_protect (restore_input_buffer, (void *) old_buf); 321 add_unwind_protect (restore_input_buffer, (void *) old_buf);
322 add_unwind_protect (delete_input_buffer, (void *) new_buf); 322 add_unwind_protect (delete_input_buffer, (void *) new_buf);
323 323
324 switch_to_buffer (new_buf); 324 switch_to_buffer (new_buf);
325 325
326 unwind_protect_int (echo_input);
327 unwind_protect_int (using_readline); 326 unwind_protect_int (using_readline);
328 unwind_protect_int (saving_history); 327 unwind_protect_int (saving_history);
329 unwind_protect_int (input_from_command_line_file); 328 unwind_protect_int (input_from_command_line_file);
330 329
331 echo_input = 0;
332 using_readline = 0; 330 using_readline = 0;
333 saving_history = 0; 331 saving_history = 0;
334 input_from_command_line_file = 0; 332 input_from_command_line_file = 0;
335 333
336 unwind_protect_ptr (curr_sym_tab); 334 unwind_protect_ptr (curr_sym_tab);
365 FILE *f = get_input_from_file (s, 0); 363 FILE *f = get_input_from_file (s, 0);
366 if (f) 364 if (f)
367 { 365 {
368 unwind_protect_int (input_line_number); 366 unwind_protect_int (input_line_number);
369 unwind_protect_int (current_input_column); 367 unwind_protect_int (current_input_column);
370 unwind_protect_int (echo_input);
371 368
372 input_line_number = 0; 369 input_line_number = 0;
373 current_input_column = 1; 370 current_input_column = 1;
374 echo_input = 0;
375 371
376 if (verbose) 372 if (verbose)
377 { 373 {
378 cout << "reading commands from " << s << " ... "; 374 cout << "reading commands from " << s << " ... ";
379 reading_startup_message_printed = 1; 375 reading_startup_message_printed = 1;
396 static void 392 static void
397 execute_startup_files (void) 393 execute_startup_files (void)
398 { 394 {
399 begin_unwind_frame ("execute_startup_files"); 395 begin_unwind_frame ("execute_startup_files");
400 396
397 unwind_protect_int (user_pref.echo_executing_commands);
401 unwind_protect_int (input_from_startup_file); 398 unwind_protect_int (input_from_startup_file);
399
400 user_pref.echo_executing_commands = ECHO_OFF;
402 input_from_startup_file = 1; 401 input_from_startup_file = 1;
403 402
404 int verbose = (verbose_flag && ! inhibit_startup_message); 403 int verbose = (verbose_flag && ! inhibit_startup_message);
405 404
406 // Execute commands from the site-wide configuration file. First 405 // Execute commands from the site-wide configuration file. First
545 // You guessed it. 544 // You guessed it.
546 545
547 int 546 int
548 main (int argc, char **argv) 547 main (int argc, char **argv)
549 { 548 {
549 int echo_commands = ECHO_OFF;
550
550 // The order of these calls is important, and initialize_globals 551 // The order of these calls is important, and initialize_globals
551 // must come before the options are processed because some command 552 // must come before the options are processed because some command
552 // line options override defaults. 553 // line options override defaults.
553 554
554 init_user_prefs (); 555 init_user_prefs ();
595 case 'q': 596 case 'q':
596 inhibit_startup_message = 1; 597 inhibit_startup_message = 1;
597 break; 598 break;
598 599
599 case 'x': 600 case 'x':
600 echo_input = 1; 601 echo_commands = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE);
601 break; 602 break;
602 603
603 case 'v': 604 case 'v':
604 print_version_and_exit (); 605 print_version_and_exit ();
605 break; 606 break;
647 cout << OCTAVE_STARTUP_MESSAGE "\n" << endl; 648 cout << OCTAVE_STARTUP_MESSAGE "\n" << endl;
648 649
649 if (traditional) 650 if (traditional)
650 maximum_braindamage (); 651 maximum_braindamage ();
651 652
653 bind_builtin_variable ("echo_executing_commands",
654 (double) echo_commands);
655
652 if (read_init_files) 656 if (read_init_files)
653 { 657 {
654 saving_history = 0; 658 saving_history = 0;
655 execute_startup_files (); 659 execute_startup_files ();
656 saving_history = 1; 660 saving_history = 1;
711 // has forced interactive behavior. 715 // has forced interactive behavior.
712 716
713 if (!interactive && forced_interactive) 717 if (!interactive && forced_interactive)
714 { 718 {
715 rl_blink_matching_paren = 0; 719 rl_blink_matching_paren = 0;
716 echo_input = 1; 720
721 // XXX FIXME XXX -- is this the right thing to do?
722
723 bind_builtin_variable ("echo_executing_commands",
724 (double) ECHO_CMD_LINE);
717 } 725 }
718 726
719 if (! interactive) 727 if (! interactive)
720 using_readline = 0; 728 using_readline = 0;
721 729