GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
input.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2015 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 // Get command input interactively or from files.
24 
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
28 
29 #include <cstdio>
30 #include <cstdlib>
31 #include <cstring>
32 #include <cassert>
33 
34 #include <iostream>
35 #include <sstream>
36 #include <string>
37 
38 #include <sys/types.h>
39 #include <unistd.h>
40 
41 #include "cmd-edit.h"
42 #include "file-ops.h"
43 #include "quit.h"
44 #include "str-vec.h"
45 
46 #include "debug.h"
47 #include "defun.h"
48 #include "dirfns.h"
49 #include "error.h"
50 #include "gripes.h"
51 #include "help.h"
52 #include "hook-fcn.h"
53 #include "input.h"
54 #include "lex.h"
55 #include "load-path.h"
56 #include "octave-link.h"
57 #include "oct-map.h"
58 #include "oct-hist.h"
59 #include "toplev.h"
60 #include "octave-link.h"
61 #include "oct-obj.h"
62 #include "ov-fcn-handle.h"
63 #include "pager.h"
64 #include "parse.h"
65 #include "pathlen.h"
66 #include "pt.h"
67 #include "pt-const.h"
68 #include "pt-eval.h"
69 #include "pt-stmt.h"
70 #include "sighandlers.h"
71 #include "symtab.h"
72 #include "sysdep.h"
73 #include "toplev.h"
74 #include "unwind-prot.h"
75 #include "utils.h"
76 #include "variables.h"
77 
78 // Primary prompt string.
79 static std::string VPS1;
80 
81 // Secondary prompt string.
82 static std::string VPS2;
83 
84 // String printed before echoed input (enabled by --echo-input).
85 std::string VPS4 = "+ ";
86 
87 // Echo commands as they are executed?
88 //
89 // 1 ==> echo commands read from script files
90 // 2 ==> echo commands from functions
91 // 4 ==> echo commands read from command line
92 //
93 // more than one state can be active at once.
95 
96 // The time we last printed a prompt.
98 
99 // Character to append after successful command-line completion attempts.
100 static char Vcompletion_append_char = ' ';
101 
102 // TRUE means this is an interactive shell (either forced or not)
103 bool interactive = false;
104 
105 // TRUE means the user forced this shell to be interactive (-i).
106 // FALSE means the shell would be interactive, independent of user settings.
107 bool forced_interactive = false;
108 
109 // TRUE after a call to completion_matches.
111 
112 // TRUE if the plotting system has requested a call to drawnow at
113 // the next user prompt.
114 bool Vdrawnow_requested = false;
115 
116 // TRUE if we are in debugging mode.
117 bool Vdebugging = false;
118 
119 // If we are in debugging mode, this is the last command entered, so
120 // that we can repeat the previous command if the user just types RET.
121 static std::string last_debugging_command = "\n";
122 
123 // TRUE if we are running in the Emacs GUD mode.
124 static bool Vgud_mode = false;
125 
126 // The filemarker used to separate filenames from subfunction names
127 char Vfilemarker = '>';
128 
130 
131 // For octave_quit.
132 void
134 {
135  input_event_hook_functions.clear ();
136 }
137 
138 void
140 {
141  // Use literal "octave" instead of "\\s" to avoid setting the prompt
142  // to "octave.exe" or "octave-gui", etc.
143 
144  VPS1 = "octave:\\#> ";
145  VPS2 = "> ";
146  VPS4 = "+ ";
147 
149 }
150 
151 void
152 octave_base_reader::do_input_echo (const std::string& input_string) const
153 {
154  int do_echo = reading_script_file ()
155  ? (Vecho_executing_commands & ECHO_SCRIPTS)
156  : (Vecho_executing_commands & ECHO_CMD_LINE) && ! forced_interactive;
157 
158  if (do_echo)
159  {
160  if (forced_interactive)
161  {
162  if (pflag > 0)
164  else
166  }
167  else
169 
170  if (! input_string.empty ())
171  {
172  octave_stdout << input_string;
173 
174  if (input_string[input_string.length () - 1] != '\n')
175  octave_stdout << "\n";
176  }
177  }
178 }
179 
180 static std::string
181 gnu_readline (const std::string& s, bool& eof)
182 {
183  octave_quit ();
184 
185  eof = false;
186 
187  std::string retval = command_editor::readline (s, eof);
188 
189  if (! eof && retval.empty ())
190  retval = "\n";
191 
192  return retval;
193 }
194 
195 static inline std::string
196 interactive_input (const std::string& s, bool& eof)
197 {
198  Vlast_prompt_time.stamp ();
199 
201  {
202  feval ("drawnow");
203 
205 
206  // We set Vdrawnow_requested to false even if there is an error
207  // in drawnow so that the error doesn't reappear at every prompt.
208 
209  Vdrawnow_requested = false;
210 
211  if (error_state)
212  return "\n";
213  }
214 
215  return gnu_readline (s, eof);
216 }
217 
218 std::string
220 {
221  octave_quit ();
222 
223  eof = false;
224 
225  std::string retval;
226 
227  // Process pre input event hook function prior to flushing output and
228  // printing the prompt.
229 
230  if (interactive)
231  {
232  if (! Vdebugging)
234 
236 
238  }
239 
240  bool history_skip_auto_repeated_debugging_command = false;
241 
242  std::string ps = (pflag > 0) ? VPS1 : VPS2;
243 
244  std::string prompt = command_editor::decode_prompt_string (ps);
245 
247 
249 
252 
253  octave_diary << prompt;
254 
255  retval = interactive_input (prompt, eof);
256 
257  // There is no need to update the load_path cache if there is no
258  // user input.
259  if (retval != "\n"
260  && retval.find_first_not_of (" \t\n\r") != std::string::npos)
261  {
263 
264  if (Vdebugging)
265  last_debugging_command = retval;
266  else
267  last_debugging_command = "\n";
268  }
269  else if (Vdebugging)
270  {
271  retval = last_debugging_command;
272  history_skip_auto_repeated_debugging_command = true;
273  }
274 
275  if (retval != "\n")
276  {
277  if (! history_skip_auto_repeated_debugging_command)
278  {
279  if (command_history::add (retval))
281  }
282 
283  octave_diary << retval;
284 
285  if (retval[retval.length () - 1] != '\n')
286  octave_diary << "\n";
287 
288  do_input_echo (retval);
289  }
290  else
291  octave_diary << "\n";
292 
293  // Process post input event hook function after the internal history
294  // list has been updated.
295 
296  if (interactive)
298 
299  return retval;
300 }
301 
302 bool
304 {
305  return lexer ? lexer->reading_fcn_file : false;
306 }
307 
308 bool
310 {
311  return lexer ? lexer->reading_classdef_file : false;
312 }
313 
314 bool
316 {
317  return lexer ? lexer->reading_script_file : false;
318 }
319 
320 // Fix things up so that input can come from the standard input. This
321 // may need to become much more complicated, which is why it's in a
322 // separate function.
323 
324 FILE *
326 {
329 }
330 
331 // FIXME: make this generate file names when appropriate.
332 
333 static string_vector
334 generate_possible_completions (const std::string& text, std::string& prefix,
335  std::string& hint)
336 {
338 
339  prefix = "";
340 
341  if (looks_like_struct (text))
342  names = generate_struct_completions (text, prefix, hint);
343  else
344  names = make_name_list ();
345 
346  // Sort and remove duplicates.
347 
348  names.sort (true);
349 
350  return names;
351 }
352 
353 static bool
355 {
356  static std::string dirfns_commands[] = {"cd", "ls"};
357  static const size_t dirfns_commands_length = 2;
358 
359  bool retval = false;
360 
361  std::string line = command_editor::get_line_buffer ();
362 
363  for (size_t i = 0; i < dirfns_commands_length; i++)
364  {
365  int index = line.find (dirfns_commands[i] + " ");
366 
367  if (index == 0)
368  {
369  retval = true;
370  break;
371  }
372  }
373 
374  return retval;
375 }
376 
377 static std::string
378 generate_completion (const std::string& text, int state)
379 {
380  std::string retval;
381 
382  static std::string prefix;
383  static std::string hint;
384 
385  static size_t hint_len = 0;
386 
387  static int list_index = 0;
388  static int name_list_len = 0;
389  static int name_list_total_len = 0;
390  static string_vector name_list;
391  static string_vector file_name_list;
392 
393  static int matches = 0;
394 
395  if (state == 0)
396  {
397  list_index = 0;
398 
399  prefix = "";
400 
401  hint = text;
402 
403  // No reason to display symbols while completing a
404  // file/directory operation.
405 
406  if (is_completing_dirfns ())
407  name_list = string_vector ();
408  else
409  name_list = generate_possible_completions (text, prefix, hint);
410 
411  name_list_len = name_list.length ();
412 
413  file_name_list = command_editor::generate_filename_completions (text);
414 
415  name_list.append (file_name_list);
416 
417  name_list_total_len = name_list.length ();
418 
419  hint_len = hint.length ();
420 
421  matches = 0;
422 
423  for (int i = 0; i < name_list_len; i++)
424  if (hint == name_list[i].substr (0, hint_len))
425  matches++;
426  }
427 
428  if (name_list_total_len > 0 && matches > 0)
429  {
430  while (list_index < name_list_total_len)
431  {
432  std::string name = name_list[list_index];
433 
434  list_index++;
435 
436  if (hint == name.substr (0, hint_len))
437  {
438  if (list_index <= name_list_len && ! prefix.empty ())
439  retval = prefix + "." + name;
440  else
441  retval = name;
442 
443  // FIXME: looks_like_struct is broken for now,
444  // so it always returns false.
445 
446  if (matches == 1 && looks_like_struct (retval))
447  {
448  // Don't append anything, since we don't know
449  // whether it should be '(' or '.'.
450 
452  }
453  else
455  (Vcompletion_append_char);
456 
457  break;
458  }
459  }
460  }
461 
462  return retval;
463 }
464 
465 static std::string
466 quoting_filename (const std::string &text, int, char quote)
467 {
468  if (quote)
469  return text;
470  else
471  return (std::string ("'") + text);
472 }
473 
474 void
476 {
477  // If we are using readline, this allows conditional parsing of the
478  // .inputrc file.
479 
480  command_editor::set_name ("Octave");
481 
482  // FIXME: this needs to include a comma too, but that
483  // causes trouble for the new struct element completion code.
484 
485  static const char *s = "\t\n !\"\'*+-/:;<=>(){}[\\]^`~";
486 
488 
490 
492 
493  command_editor::set_filename_quote_characters (" \t\n\\\"'@<>=;|&()#$`?*[!:{");
495 
497 
499 }
500 
501 static void
502 execute_in_debugger_handler (const std::pair<std::string, int>& arg)
503 {
504  octave_link::execute_in_debugger_event (arg.first, arg.second);
505 }
506 
507 static void
508 get_debug_input (const std::string& prompt)
509 {
510  unwind_protect frame;
511 
514 
516  std::string nm;
517  int curr_debug_line;
518 
519  bool have_file = false;
520 
521  if (caller)
522  {
523  nm = caller->fcn_file_name ();
524 
525  if (nm.empty ())
526  nm = caller->name ();
527  else
528  have_file = true;
529 
530  curr_debug_line = octave_call_stack::caller_user_code_line ();
531  }
532  else
533  curr_debug_line = octave_call_stack::current_line ();
534 
535  std::ostringstream buf;
536 
537  if (! nm.empty ())
538  {
539  if (Vgud_mode)
540  {
541  static char ctrl_z = 'Z' & 0x1f;
542 
543  buf << ctrl_z << ctrl_z << nm << ":" << curr_debug_line;
544  }
545  else
546  {
547  // FIXME: we should come up with a clean way to detect
548  // that we are stopped on the no-op command that marks the
549  // end of a function or script.
550 
551  if (! silent)
552  {
553  buf << "stopped in " << nm;
554 
555  if (curr_debug_line > 0)
556  buf << " at line " << curr_debug_line;
557  }
558 
559  if (have_file)
560  {
561  octave_link::enter_debugger_event (nm, curr_debug_line);
562 
564 
566  std::pair<std::string, int> (nm, curr_debug_line));
567 
568  if (! silent)
569  {
570  std::string line_buf
571  = get_file_line (nm, curr_debug_line);
572 
573  if (! line_buf.empty ())
574  buf << "\n" << curr_debug_line << ": " << line_buf;
575  }
576  }
577  }
578  }
579 
580  if (silent)
582 
583  std::string msg = buf.str ();
584 
585  if (! msg.empty ())
586  std::cerr << msg << std::endl;
587 
588  frame.protect_var (VPS1);
589  VPS1 = prompt;
590 
591  if (! interactive)
592  {
593  frame.protect_var (interactive);
594  interactive = true;
596  forced_interactive = true;
597  }
598 
599  octave_parser curr_parser;
600 
601  while (Vdebugging)
602  {
603  unwind_protect middle_frame;
604 
606 
607  curr_parser.reset ();
608 
609  int retval = curr_parser.run ();
610 
611  if (command_editor::interrupt (false))
612  break;
613  else
614  {
615  if (retval == 0 && curr_parser.stmt_list)
616  {
617  curr_parser.stmt_list->accept (*current_evaluator);
618 
621  }
622 
623  octave_quit ();
624  }
625  }
626 }
627 
628 const std::string octave_base_reader::in_src ("invalid");
629 
630 const std::string octave_terminal_reader::in_src ("terminal");
631 
632 std::string
634 {
635  octave_quit ();
636 
637  eof = false;
638 
639  return octave_gets (eof);
640 }
641 
642 const std::string octave_file_reader::in_src ("file");
643 
644 std::string
646 {
647  octave_quit ();
648 
649  eof = false;
650 
651  return octave_fgets (file, eof);
652 }
653 
654 const std::string octave_eval_string_reader::in_src ("eval_string");
655 
656 std::string
658 {
659  octave_quit ();
660 
661  eof = false;
662 
663  std::string retval;
664 
665  retval = eval_string;
666 
667  // Clear the eval string so that the next call will return
668  // an empty character string with EOF = true.
669  eval_string = "";
670 
671  if (retval.empty ())
672  eof = true;
673 
674  return retval;
675 }
676 
677 // If the user simply hits return, this will produce an empty matrix.
678 
679 static octave_value_list
680 get_user_input (const octave_value_list& args, int nargout)
681 {
682  octave_value_list retval;
683 
684  int nargin = args.length ();
685 
686  int read_as_string = 0;
687 
688  if (nargin == 2)
689  read_as_string++;
690 
691  std::string prompt = args(0).string_value ();
692 
693  if (error_state)
694  {
695  error ("input: unrecognized argument");
696  return retval;
697  }
698 
700 
703 
704  octave_diary << prompt;
705 
706  bool eof = false;
707 
708  std::string input_buf = interactive_input (prompt.c_str (), eof);
709 
710  if (! (error_state || input_buf.empty ()))
711  {
712  size_t len = input_buf.length ();
713 
714  octave_diary << input_buf;
715 
716  if (input_buf[len - 1] != '\n')
717  octave_diary << "\n";
718 
719  if (len < 1)
720  return read_as_string ? octave_value ("") : octave_value (Matrix ());
721 
722  if (read_as_string)
723  {
724  // FIXME: fix gnu_readline and octave_gets instead!
725  if (input_buf.length () == 1 && input_buf[0] == '\n')
726  retval(0) = "";
727  else
728  retval(0) = input_buf;
729  }
730  else
731  {
732  int parse_status = 0;
733 
734  retval = eval_string (input_buf, true, parse_status, nargout);
735 
736  if (! Vdebugging && retval.length () == 0)
737  retval(0) = Matrix ();
738  }
739  }
740  else
741  error ("input: reading user-input failed!");
742 
743  return retval;
744 }
745 
746 DEFUN (input, args, nargout,
747  "-*- texinfo -*-\n\
748 @deftypefn {Built-in Function} {@var{ans} =} input (@var{prompt})\n\
749 @deftypefnx {Built-in Function} {@var{ans} =} input (@var{prompt}, \"s\")\n\
750 Print @var{prompt} and wait for user input.\n\
751 \n\
752 For example,\n\
753 \n\
754 @example\n\
755 input (\"Pick a number, any number! \")\n\
756 @end example\n\
757 \n\
758 @noindent\n\
759 prints the prompt\n\
760 \n\
761 @example\n\
762 Pick a number, any number!\n\
763 @end example\n\
764 \n\
765 @noindent\n\
766 and waits for the user to enter a value. The string entered by the user\n\
767 is evaluated as an expression, so it may be a literal constant, a variable\n\
768 name, or any other valid Octave code.\n\
769 \n\
770 The number of return arguments, their size, and their class depend on the\n\
771 expression entered.\n\
772 \n\
773 If you are only interested in getting a literal string value, you can call\n\
774 @code{input} with the character string @qcode{\"s\"} as the second argument.\n\
775 This tells Octave to return the string entered by the user directly, without\n\
776 evaluating it first.\n\
777 \n\
778 Because there may be output waiting to be displayed by the pager, it is a\n\
779 good idea to always call @code{fflush (stdout)} before calling @code{input}.\n\
780  This will ensure that all pending output is written to the screen before\n\
781 your prompt.\n\
782 @seealso{yes_or_no, kbhit, pause, menu, listdlg}\n\
783 @end deftypefn")
784 {
785  octave_value_list retval;
786 
787  int nargin = args.length ();
788 
789  if (nargin == 1 || nargin == 2)
790  retval = get_user_input (args, std::max (nargout, 1));
791  else
792  print_usage ();
793 
794  return retval;
795 }
796 
797 bool
798 octave_yes_or_no (const std::string& prompt)
799 {
800  std::string prompt_string = prompt + "(yes or no) ";
801 
802  while (1)
803  {
804  bool eof = false;
805 
806  std::string input_buf = interactive_input (prompt_string, eof);
807 
808  if (input_buf == "yes")
809  return true;
810  else if (input_buf == "no")
811  return false;
812  else
813  message (0, "Please answer yes or no.");
814  }
815 }
816 
817 DEFUN (yes_or_no, args, ,
818  "-*- texinfo -*-\n\
819 @deftypefn {Built-in Function} {@var{ans} =} yes_or_no (\"@var{prompt}\")\n\
820 Ask the user a yes-or-no question.\n\
821 \n\
822 Return logical true if the answer is yes or false if the answer is no.\n\
823 \n\
824 Takes one argument, @var{prompt}, which is the string to display when asking\n\
825 the question. @var{prompt} should end in a space; @code{yes-or-no} adds the\n\
826 string @samp{(yes or no) } to it. The user must confirm the answer with\n\
827 @key{RET} and can edit it until it has been confirmed.\n\
828 @seealso{input}\n\
829 @end deftypefn")
830 {
831  octave_value retval;
832 
833  int nargin = args.length ();
834 
835  if (nargin == 0 || nargin == 1)
836  {
837  std::string prompt;
838 
839  if (nargin == 1)
840  {
841  if (args(0).is_string ())
842  prompt = args(0).string_value ();
843  else
844  {
845  error ("yes_or_no: PROMPT must be a string");
846  return retval;
847  }
848  }
849 
850  retval = octave_yes_or_no (prompt);
851  }
852  else
853  print_usage ();
854 
855  return retval;
856 }
857 
860 {
861  octave_value retval;
862 
863  int nargin = args.length ();
864 
865  assert (nargin == 0 || nargin == 1);
866 
867  unwind_protect frame;
868 
871 
873 
874  frame.protect_var (Vdebugging);
875 
878 
879  // FIXME: probably we just want to print one line, not the
880  // entire statement, which might span many lines...
881  //
882  // tree_print_code tpc (octave_stdout);
883  // stmt.accept (tpc);
884 
885  Vdebugging = true;
886 
887  std::string prompt = "debug> ";
888  if (nargin > 0)
889  prompt = args(0).string_value ();
890 
891  if (! error_state)
892  get_debug_input (prompt);
893 
894  return retval;
895 }
896 
897 DEFUN (keyboard, args, ,
898  "-*- texinfo -*-\n\
899 @deftypefn {Built-in Function} {} keyboard ()\n\
900 @deftypefnx {Built-in Function} {} keyboard (\"@var{prompt}\")\n\
901 Stop m-file execution and enter debug mode.\n\
902 \n\
903 When the @code{keyboard} function is executed, Octave prints a prompt and\n\
904 waits for user input. The input strings are then evaluated and the results\n\
905 are printed. This makes it possible to examine the values of variables\n\
906 within a function, and to assign new values if necessary. To leave the\n\
907 prompt and return to normal execution type @samp{return} or @samp{dbcont}.\n\
908 The @code{keyboard} function does not return an exit status.\n\
909 \n\
910 If @code{keyboard} is invoked without arguments, a default prompt of\n\
911 @samp{debug> } is used.\n\
912 @seealso{dbstop, dbcont, dbquit}\n\
913 @end deftypefn")
914 {
915  octave_value_list retval;
916 
917  int nargin = args.length ();
918 
919  if (nargin == 0 || nargin == 1)
920  {
921  unwind_protect frame;
922 
925 
926  // Skip the frame assigned to the keyboard function.
928 
931 
933 
934  do_keyboard (args);
935  }
936  else
937  print_usage ();
938 
939  return retval;
940 }
941 
942 DEFUN (echo, args, ,
943  "-*- texinfo -*-\n\
944 @deftypefn {Command} {} echo\n\
945 @deftypefnx {Command} {} echo on\n\
946 @deftypefnx {Command} {} echo off\n\
947 @deftypefnx {Command} {} echo on all\n\
948 @deftypefnx {Command} {} echo off all\n\
949 Control whether commands are displayed as they are executed.\n\
950 \n\
951 Valid options are:\n\
952 \n\
953 @table @code\n\
954 @item on\n\
955 Enable echoing of commands as they are executed in script files.\n\
956 \n\
957 @item off\n\
958 Disable echoing of commands as they are executed in script files.\n\
959 \n\
960 @item on all\n\
961 Enable echoing of commands as they are executed in script files and\n\
962 functions.\n\
963 \n\
964 @item off all\n\
965 Disable echoing of commands as they are executed in script files and\n\
966 functions.\n\
967 @end table\n\
968 \n\
969 @noindent\n\
970 With no arguments, @code{echo} toggles the current echo state.\n\
971 @end deftypefn")
972 {
973  octave_value_list retval;
974 
975  int argc = args.length () + 1;
976 
977  string_vector argv = args.make_argv ("echo");
978 
979  if (error_state)
980  return retval;
981 
982  switch (argc)
983  {
984  case 1:
985  {
986  if ((Vecho_executing_commands & ECHO_SCRIPTS)
987  || (Vecho_executing_commands & ECHO_FUNCTIONS))
988  Vecho_executing_commands = ECHO_OFF;
989  else
990  Vecho_executing_commands = ECHO_SCRIPTS;
991  }
992  break;
993 
994  case 2:
995  {
996  std::string arg = argv[1];
997 
998  if (arg == "on")
999  Vecho_executing_commands = ECHO_SCRIPTS;
1000  else if (arg == "off")
1001  Vecho_executing_commands = ECHO_OFF;
1002  else
1003  print_usage ();
1004  }
1005  break;
1006 
1007  case 3:
1008  {
1009  std::string arg = argv[1];
1010 
1011  if (arg == "on" && argv[2] == "all")
1012  {
1013  int tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS);
1014  Vecho_executing_commands = tmp;
1015  }
1016  else if (arg == "off" && argv[2] == "all")
1017  Vecho_executing_commands = ECHO_OFF;
1018  else
1019  print_usage ();
1020  }
1021  break;
1022 
1023  default:
1024  print_usage ();
1025  break;
1026  }
1027 
1028  return retval;
1029 }
1030 
1031 DEFUN (__echostate__, , ,
1032  "-*- texinfo -*-\n\
1033 @deftypefn {Built-in Function} {@var{state} =} __echostate__ ()\n\
1034 Undocumented internal function\n\
1035 @end deftypefn")
1036 {
1037  return ovl (Vecho_executing_commands == ECHO_SCRIPTS);
1038 }
1039 
1040 DEFUN (completion_matches, args, nargout,
1041  "-*- texinfo -*-\n\
1042 @deftypefn {Built-in Function} {} completion_matches (@var{hint})\n\
1043 Generate possible completions given @var{hint}.\n\
1044 \n\
1045 This function is provided for the benefit of programs like Emacs which\n\
1046 might be controlling Octave and handling user input. The current\n\
1047 command number is not incremented when this function is called. This is\n\
1048 a feature, not a bug.\n\
1049 @end deftypefn")
1050 {
1051  octave_value retval;
1052 
1053  int nargin = args.length ();
1054 
1055  if (nargin == 1)
1056  {
1057  std::string hint = args(0).string_value ();
1058 
1059  if (! error_state)
1060  {
1061  int n = 32;
1062 
1063  string_vector list (n);
1064 
1065  int k = 0;
1066 
1067  for (;;)
1068  {
1069  std::string cmd = generate_completion (hint, k);
1070 
1071  if (! cmd.empty ())
1072  {
1073  if (k == n)
1074  {
1075  n *= 2;
1076  list.resize (n);
1077  }
1078 
1079  list[k++] = cmd;
1080  }
1081  else
1082  {
1083  list.resize (k);
1084  break;
1085  }
1086  }
1087 
1088  if (nargout > 0)
1089  {
1090  if (! list.empty ())
1091  retval = list;
1092  else
1093  retval = "";
1094  }
1095  else
1096  {
1097  // We don't use string_vector::list_in_columns here
1098  // because it will be easier for Emacs if the names
1099  // appear in a single column.
1100 
1101  int len = list.length ();
1102 
1103  for (int i = 0; i < len; i++)
1104  octave_stdout << list[i] << "\n";
1105  }
1106 
1108  }
1109  }
1110  else
1111  print_usage ();
1112 
1113  return retval;
1114 }
1115 
1116 DEFUN (readline_read_init_file, args, ,
1117  "-*- texinfo -*-\n\
1118 @deftypefn {Built-in Function} {} readline_read_init_file (@var{file})\n\
1119 Read the readline library initialization file @var{file}.\n\
1120 \n\
1121 If @var{file} is omitted, read the default initialization file\n\
1122 (normally @file{~/.inputrc}).\n\
1123 \n\
1124 @xref{Readline Init File, , , readline, GNU Readline Library},\n\
1125 for details.\n\
1126 @seealso{readline_re_read_init_file}\n\
1127 @end deftypefn")
1128 {
1129  octave_value_list retval;
1130 
1131  int nargin = args.length ();
1132 
1133  if (nargin == 0)
1135  else if (nargin == 1)
1136  {
1137  std::string file = args(0).string_value ();
1138 
1139  if (! error_state)
1141  }
1142  else
1143  print_usage ();
1144 
1145  return retval;
1146 }
1147 
1148 DEFUN (readline_re_read_init_file, args, ,
1149  "-*- texinfo -*-\n\
1150 @deftypefn {Built-in Function} {} readline_re_read_init_file ()\n\
1151 Re-read the last readline library initialization file that was read.\n\
1152 \n\
1153 @xref{Readline Init File, , , readline, GNU Readline Library},\n\
1154 for details.\n\
1155 @seealso{readline_read_init_file}\n\
1156 @end deftypefn")
1157 {
1158  octave_value_list retval;
1159 
1160  if (args.length () == 0)
1162  else
1163  print_usage ();
1164 
1165  return retval;
1166 }
1167 
1168 static int
1170 {
1171  input_event_hook_functions.run ();
1172 
1173  if (input_event_hook_functions.empty ())
1175 
1176  return 0;
1177 }
1178 
1179 DEFUN (add_input_event_hook, args, ,
1180  "-*- texinfo -*-\n\
1181 @deftypefn {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn})\n\
1182 @deftypefnx {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn}, @var{data})\n\
1183 Add the named function or function handle @var{fcn} to the list of functions\n\
1184 to call periodically when Octave is waiting for input.\n\
1185 \n\
1186 The function should have the form\n\
1187 \n\
1188 @example\n\
1189 @var{fcn} (@var{data})\n\
1190 @end example\n\
1191 \n\
1192 If @var{data} is omitted, Octave calls the function without any arguments.\n\
1193 \n\
1194 The returned identifier may be used to remove the function handle from the\n\
1195 list of input hook functions.\n\
1196 @seealso{remove_input_event_hook}\n\
1197 @end deftypefn")
1198 {
1199  octave_value retval;
1200 
1201  int nargin = args.length ();
1202 
1203  if (nargin == 1 || nargin == 2)
1204  {
1205  octave_value user_data;
1206 
1207  if (nargin == 2)
1208  user_data = args(1);
1209 
1210  hook_function hook_fcn (args(0), user_data);
1211 
1212  if (! error_state)
1213  {
1214  if (input_event_hook_functions.empty ())
1216 
1217  input_event_hook_functions.insert (hook_fcn.id (), hook_fcn);
1218 
1219  retval = hook_fcn.id ();
1220  }
1221  else
1222  error ("add_input_event_hook: FCN must be a function handle or string");
1223  }
1224  else
1225  print_usage ();
1226 
1227  return retval;
1228 }
1229 
1230 DEFUN (remove_input_event_hook, args, ,
1231  "-*- texinfo -*-\n\
1232 @deftypefn {Built-in Function} {} remove_input_event_hook (@var{name})\n\
1233 @deftypefnx {Built-in Function} {} remove_input_event_hook (@var{fcn_id})\n\
1234 Remove the named function or function handle with the given identifier\n\
1235 from the list of functions to call periodically when Octave is waiting\n\
1236 for input.\n\
1237 @seealso{add_input_event_hook}\n\
1238 @end deftypefn")
1239 {
1240  octave_value_list retval;
1241 
1242  int nargin = args.length ();
1243 
1244  if (nargin == 1 || nargin == 2)
1245  {
1246  std::string hook_fcn_id = args(0).string_value ();
1247 
1248  bool warn = (nargin < 2);
1249 
1250  if (! error_state)
1251  {
1253  = input_event_hook_functions.find (hook_fcn_id);
1254 
1255  if (p != input_event_hook_functions.end ())
1256  input_event_hook_functions.erase (p);
1257  else if (warn)
1258  warning ("remove_input_event_hook: %s not found in list",
1259  hook_fcn_id.c_str ());
1260 
1261  if (input_event_hook_functions.empty ())
1263  }
1264  else
1265  error ("remove_input_event_hook: argument not valid as a hook function name or id");
1266  }
1267  else
1268  print_usage ();
1269 
1270  return retval;
1271 }
1272 
1273 DEFUN (PS1, args, nargout,
1274  "-*- texinfo -*-\n\
1275 @deftypefn {Built-in Function} {@var{val} =} PS1 ()\n\
1276 @deftypefnx {Built-in Function} {@var{old_val} =} PS1 (@var{new_val})\n\
1277 @deftypefnx {Built-in Function} {} PS1 (@var{new_val}, \"local\")\n\
1278 Query or set the primary prompt string.\n\
1279 \n\
1280 When executing interactively, Octave displays the primary prompt when it is\n\
1281 ready to read a command.\n\
1282 \n\
1283 The default value of the primary prompt string is @qcode{\"octave:\\#> \"}.\n\
1284 To change it, use a command like\n\
1285 \n\
1286 @example\n\
1287 PS1 (\"\\\\u@@\\\\H> \")\n\
1288 @end example\n\
1289 \n\
1290 @noindent\n\
1291 which will result in the prompt @samp{boris@@kremvax> } for the user\n\
1292 @samp{boris} logged in on the host @samp{kremvax.kgb.su}. Note that two\n\
1293 backslashes are required to enter a backslash into a double-quoted\n\
1294 character string. @xref{Strings}.\n\
1295 \n\
1296 You can also use ANSI escape sequences if your terminal supports them.\n\
1297 This can be useful for coloring the prompt. For example,\n\
1298 \n\
1299 @example\n\
1300 PS1 (\"\\\\[\\\\033[01;31m\\\\]\\\\s:\\\\#> \\\\[\\\\033[0m\\\\]\")\n\
1301 @end example\n\
1302 \n\
1303 @noindent\n\
1304 will give the default Octave prompt a red coloring.\n\
1305 \n\
1306 When called from inside a function with the @qcode{\"local\"} option, the\n\
1307 variable is changed locally for the function and any subroutines it calls.\n\
1308 The original variable value is restored when exiting the function.\n\
1309 @seealso{PS2, PS4}\n\
1310 @end deftypefn")
1311 {
1312  return SET_INTERNAL_VARIABLE (PS1);
1313 }
1314 
1315 DEFUN (PS2, args, nargout,
1316  "-*- texinfo -*-\n\
1317 @deftypefn {Built-in Function} {@var{val} =} PS2 ()\n\
1318 @deftypefnx {Built-in Function} {@var{old_val} =} PS2 (@var{new_val})\n\
1319 @deftypefnx {Built-in Function} {} PS2 (@var{new_val}, \"local\")\n\
1320 Query or set the secondary prompt string.\n\
1321 \n\
1322 The secondary prompt is printed when Octave is expecting additional input to\n\
1323 complete a command. For example, if you are typing a @code{for} loop that\n\
1324 spans several lines, Octave will print the secondary prompt at the beginning\n\
1325 of each line after the first. The default value of the secondary prompt\n\
1326 string is @qcode{\"> \"}.\n\
1327 \n\
1328 When called from inside a function with the @qcode{\"local\"} option, the\n\
1329 variable is changed locally for the function and any subroutines it calls.\n\
1330 The original variable value is restored when exiting the function.\n\
1331 @seealso{PS1, PS4}\n\
1332 @end deftypefn")
1333 {
1334  return SET_INTERNAL_VARIABLE (PS2);
1335 }
1336 
1337 DEFUN (PS4, args, nargout,
1338  "-*- texinfo -*-\n\
1339 @deftypefn {Built-in Function} {@var{val} =} PS4 ()\n\
1340 @deftypefnx {Built-in Function} {@var{old_val} =} PS4 (@var{new_val})\n\
1341 @deftypefnx {Built-in Function} {} PS4 (@var{new_val}, \"local\")\n\
1342 Query or set the character string used to prefix output produced\n\
1343 when echoing commands is enabled.\n\
1344 \n\
1345 The default value is @qcode{\"+ \"}.\n\
1346 @xref{Diary and Echo Commands}, for a description of echoing commands.\n\
1347 \n\
1348 When called from inside a function with the @qcode{\"local\"} option, the\n\
1349 variable is changed locally for the function and any subroutines it calls.\n\
1350 The original variable value is restored when exiting the function.\n\
1351 @seealso{echo, echo_executing_commands, PS1, PS2}\n\
1352 @end deftypefn")
1353 {
1354  return SET_INTERNAL_VARIABLE (PS4);
1355 }
1356 
1357 DEFUN (completion_append_char, args, nargout,
1358  "-*- texinfo -*-\n\
1359 @deftypefn {Built-in Function} {@var{val} =} completion_append_char ()\n\
1360 @deftypefnx {Built-in Function} {@var{old_val} =} completion_append_char (@var{new_val})\n\
1361 @deftypefnx {Built-in Function} {} completion_append_char (@var{new_val}, \"local\")\n\
1362 Query or set the internal character variable that is appended to\n\
1363 successful command-line completion attempts.\n\
1364 \n\
1365 The default value is @qcode{\" \"} (a single space).\n\
1366 \n\
1367 When called from inside a function with the @qcode{\"local\"} option, the\n\
1368 variable is changed locally for the function and any subroutines it calls.\n\
1369 The original variable value is restored when exiting the function.\n\
1370 @end deftypefn")
1371 {
1372  return SET_INTERNAL_VARIABLE (completion_append_char);
1373 }
1374 
1375 DEFUN (echo_executing_commands, args, nargout,
1376  "-*- texinfo -*-\n\
1377 @deftypefn {Built-in Function} {@var{val} =} echo_executing_commands ()\n\
1378 @deftypefnx {Built-in Function} {@var{old_val} =} echo_executing_commands (@var{new_val})\n\
1379 @deftypefnx {Built-in Function} {} echo_executing_commands (@var{new_val}, \"local\")\n\
1380 Query or set the internal variable that controls the echo state.\n\
1381 \n\
1382 It may be the sum of the following values:\n\
1383 \n\
1384 @table @asis\n\
1385 @item 1\n\
1386 Echo commands read from script files.\n\
1387 \n\
1388 @item 2\n\
1389 Echo commands from functions.\n\
1390 \n\
1391 @item 4\n\
1392 Echo commands read from command line.\n\
1393 @end table\n\
1394 \n\
1395 More than one state can be active at once. For example, a value of 3 is\n\
1396 equivalent to the command @kbd{echo on all}.\n\
1397 \n\
1398 The value of @code{echo_executing_commands} may be set by the @kbd{echo}\n\
1399 command or the command line option @option{--echo-commands}.\n\
1400 \n\
1401 When called from inside a function with the @qcode{\"local\"} option, the\n\
1402 variable is changed locally for the function and any subroutines it calls.\n\
1403 The original variable value is restored when exiting the function.\n\
1404 @end deftypefn")
1405 {
1406  return SET_INTERNAL_VARIABLE (echo_executing_commands);
1407 }
1408 
1409 DEFUN (__request_drawnow__, args, ,
1410  "-*- texinfo -*-\n\
1411 @deftypefn {Built-in Function} {} __request_drawnow__ ()\n\
1412 @deftypefnx {Built-in Function} {} __request_drawnow__ (@var{flag})\n\
1413 Undocumented internal function.\n\
1414 @end deftypefn")
1415 {
1416  octave_value retval;
1417 
1418  int nargin = args.length ();
1419 
1420  if (nargin == 0)
1421  Vdrawnow_requested = true;
1422  else if (nargin == 1)
1423  Vdrawnow_requested = args(0).bool_value ();
1424  else
1425  print_usage ();
1426 
1427  return retval;
1428 }
1429 
1430 DEFUN (__gud_mode__, args, ,
1431  "-*- texinfo -*-\n\
1432 @deftypefn {Built-in Function} {} __gud_mode__ ()\n\
1433 Undocumented internal function.\n\
1434 @end deftypefn")
1435 {
1436  octave_value retval;
1437 
1438  int nargin = args.length ();
1439 
1440  if (nargin == 0)
1441  retval = Vgud_mode;
1442  else if (nargin == 1)
1443  Vgud_mode = args(0).bool_value ();
1444  else
1445  print_usage ();
1446 
1447  return retval;
1448 }
1449 
1450 DEFUN (filemarker, args, nargout,
1451  "-*- texinfo -*-\n\
1452 @deftypefn {Built-in Function} {@var{val} =} filemarker ()\n\
1453 @deftypefnx {Built-in Function} {@var{old_val} =} filemarker (@var{new_val})\n\
1454 @deftypefnx {Built-in Function} {} filemarker (@var{new_val}, \"local\")\n\
1455 Query or set the character used to separate the filename from the subfunction\n\
1456 names contained within the file.\n\
1457 \n\
1458 By default this is the character @samp{>}.\n\
1459 This can be used in a generic manner to interact with subfunctions.\n\
1460 For example,\n\
1461 \n\
1462 @example\n\
1463 help ([\"myfunc\", filemarker, \"mysubfunc\"])\n\
1464 @end example\n\
1465 \n\
1466 @noindent\n\
1467 returns the help string associated with the subfunction @code{mysubfunc}\n\
1468 located in the file @file{myfunc.m}.\n\
1469 \n\
1470 @code{filemarker} is also useful during debugging for placing breakpoints\n\
1471 within subfunctions or nested functions.\n\
1472 For example,\n\
1473 \n\
1474 @example\n\
1475 dbstop ([\"myfunc\", filemarker, \"mysubfunc\"])\n\
1476 @end example\n\
1477 \n\
1478 @noindent\n\
1479 will set a breakpoint at the first line of the subfunction @code{mysubfunc}.\n\
1480 \n\
1481 When called from inside a function with the @qcode{\"local\"} option, the\n\
1482 variable is changed locally for the function and any subroutines it calls.\n\
1483 The original variable value is restored when exiting the function.\n\
1484 @end deftypefn")
1485 {
1486  char tmp = Vfilemarker;
1487  octave_value retval = SET_INTERNAL_VARIABLE (filemarker);
1488 
1489  // The character passed must not be a legal character for a function name
1490  if (! error_state && (::isalnum (Vfilemarker) || Vfilemarker == '_'))
1491  {
1492  Vfilemarker = tmp;
1493  error ("filemarker: character can not be a valid character for a function name");
1494  }
1495 
1496  return retval;
1497 }
static FILE * get_input_stream(void)
Definition: cmd-edit.cc:1098
static bool is_completing_dirfns(void)
Definition: input.cc:354
static hook_function_list input_event_hook_functions
Definition: input.cc:129
static bool ignoring_entries(void)
Definition: cmd-hist.cc:606
static std::string last_debugging_command
Definition: input.cc:121
void flush_octave_stdout(void)
Definition: pager.cc:458
static void restore_frame(size_t n)
Definition: toplev.h:272
static std::string generate_completion(const std::string &text, int state)
Definition: input.cc:378
static const std::string in_src
Definition: input.h:186
static bool debug_mode
Definition: pt-eval.h:152
Definition: input.h:75
virtual bool reading_fcn_file(void) const
Definition: input.cc:303
static void reset(void)
Definition: pager.cc:340
static bool erase_empty_line(bool flag)
Definition: cmd-edit.cc:1203
static uint32_t state[624]
Definition: randmtzig.c:188
static std::string quoting_filename(const std::string &text, int, char quote)
Definition: input.cc:466
std::string octave_fgets(FILE *f)
Definition: lo-utils.cc:112
OCTINTERP_API void print_usage(void)
Definition: defun.cc:51
static octave_value_list get_user_input(const octave_value_list &args, int nargout)
Definition: input.cc:680
FILE * get_input_from_stdin(void)
Definition: input.cc:325
octave_idx_type length(void) const
Definition: oct-obj.h:89
void accept(tree_walker &tw)
Definition: pt-stmt.cc:289
bool empty(void) const
Definition: str-vec.h:73
std::string octave_gets(bool &eof)
Definition: input.cc:219
static void re_read_init_file(void)
Definition: cmd-edit.cc:1487
void protect_var(T &var)
static void set_filename_quote_characters(const std::string &s)
Definition: cmd-edit.cc:1230
#define DEFUN(name, args_name, nargout_name, doc)
Definition: defun.h:44
void error(const char *fmt,...)
Definition: error.cc:476
bool forced_interactive
Definition: input.cc:107
static void add_event_hook(event_hook_fcn f)
Definition: cmd-edit.cc:1440
std::string name(void) const
Definition: ov-fcn.h:161
#define SET_INTERNAL_VARIABLE(NM)
Definition: variables.h:120
octave_value_list feval(const std::string &name, const octave_value_list &args, int nargout)
Definition: oct-parse.cc:8625
static string_vector names(const map_type &lst)
Definition: help.cc:782
bool reading_script_file
Definition: lex.h:371
static bool Vgud_mode
Definition: input.cc:124
static void set_completion_append_character(char c)
Definition: cmd-edit.cc:1244
void stamp(void)
Definition: oct-time.cc:84
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
Definition: oct-parse.cc:8810
#define octave_diary
Definition: pager.h:146
std::string eval_string
Definition: input.h:207
iterator find(const std::string &id)
Definition: hook-fcn.h:223
static bool quiet_breakpoint_flag
Definition: pt-eval.h:154
static void set_name(const std::string &n)
Definition: cmd-edit.cc:1060
static bool add(const std::string &)
Definition: cmd-hist.cc:613
static void set_basic_quote_characters(const std::string &s)
Definition: cmd-edit.cc:1223
static const std::string in_src
Definition: input.h:165
void do_input_echo(const std::string &) const
Definition: input.cc:152
static void get_debug_input(const std::string &prompt)
Definition: input.cc:508
void insert(const std::string &id, const hook_function &f)
Definition: hook-fcn.h:218
void message(const char *name, const char *fmt,...)
Definition: error.cc:380
octave_base_lexer * lexer
Definition: input.h:141
static int current_line(void)
Definition: toplev.h:152
static octave_user_code * caller_user_code(size_t nskip=0)
Definition: toplev.h:221
void add_fcn(void(*fcn)(void))
static int internal_input_event_hook_fcn(void)
Definition: input.cc:1169
bool interactive
Definition: input.cc:103
static size_t current_frame(void)
Definition: toplev.h:181
void erase(iterator p)
Definition: hook-fcn.h:237
octave_time Vlast_prompt_time
Definition: input.cc:97
bool Vdrawnow_requested
Definition: input.cc:114
static string_vector generate_filename_completions(const std::string &text)
Definition: cmd-edit.cc:1321
static void set_input_stream(FILE *f)
Definition: cmd-edit.cc:1091
void initialize_command_input(void)
Definition: input.cc:475
int run(void)
Definition: oct-parse.cc:7955
void resize(octave_idx_type n, const std::string &rfv=std::string())
Definition: str-vec.h:91
std::string get_input(bool &eof)
Definition: input.cc:657
static std::string gnu_readline(const std::string &s, bool &eof)
Definition: input.cc:181
std::string get_input(bool &eof)
Definition: input.cc:633
static std::string VPS2
Definition: input.cc:82
static string_vector generate_possible_completions(const std::string &text, std::string &prefix, std::string &hint)
Definition: input.cc:334
static void reset(void)
Definition: pager.cc:419
string_vector generate_struct_completions(const std::string &text, std::string &prefix, std::string &hint)
Definition: variables.cc:241
int error_state
Definition: error.cc:101
string_vector & append(const std::string &s)
Definition: str-vec.cc:140
std::string get_input(bool &eof)
Definition: input.cc:645
static void read_init_file(const std::string &file=std::string())
Definition: cmd-edit.cc:1476
static std::string interactive_input(const std::string &s, bool &eof)
Definition: input.cc:196
static bool interrupt(bool=true)
Definition: cmd-edit.cc:1515
static void set_completion_function(completion_fcn f)
Definition: cmd-edit.cc:1251
static std::string VPS1
Definition: input.cc:79
void reset_error_handler(void)
Definition: error.cc:124
string_vector & sort(bool make_uniq=false)
Definition: str-vec.cc:107
octave_idx_type length(void) const
Definition: ov.cc:1525
Definition: dMatrix.h:35
iterator end(void)
Definition: hook-fcn.h:233
tree_evaluator * current_evaluator
Definition: pt-eval.cc:52
static std::string decode_prompt_string(const std::string &s)
Definition: cmd-edit.cc:1161
int pipe_handler_error_count
Definition: sighandlers.cc:58
virtual bool reading_script_file(void) const
Definition: input.cc:315
static std::string get_line_buffer(void)
Definition: cmd-edit.cc:1328
static void remove_event_hook(event_hook_fcn f)
Definition: cmd-edit.cc:1453
double arg(double x)
Definition: lo-mappers.h:37
static std::string readline(const std::string &prompt)
Definition: cmd-edit.cc:1067
static int caller_user_code_line(void)
Definition: toplev.h:164
std::string id(void)
Definition: hook-fcn.h:99
void warning(const char *fmt,...)
Definition: error.cc:681
bool looks_like_struct(const std::string &text)
Definition: variables.cc:295
void reset(void)
Definition: oct-parse.cc:5995
static void set_basic_word_break_characters(const std::string &s)
Definition: cmd-edit.cc:1209
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:233
virtual std::string fcn_file_name(void) const
Definition: ov-fcn.h:62
static const std::string in_src
Definition: input.h:145
octave_idx_type length(void) const
Number of elements in the array.
Definition: Array.h:267
bool octave_yes_or_no(const std::string &prompt)
Definition: input.cc:798
virtual bool reading_classdef_file(void) const
Definition: input.cc:309
int Vecho_executing_commands
Definition: input.cc:94
#define octave_stdout
Definition: pager.h:144
static const std::string in_src
Definition: input.h:209
octave_value_list ovl(const octave_value &a0)
Definition: oct-obj.h:178
static size_t current_frame
Definition: pt-eval.h:150
static void update(void)
Definition: load-path.h:85
char Vfilemarker
Definition: input.cc:127
static void set_quoting_function(quoting_fcn f)
Definition: cmd-edit.cc:1258
void remove_input_event_hook_functions(void)
Definition: input.cc:133
bool empty(void) const
Definition: hook-fcn.h:214
tree_statement_list * stmt_list
Definition: parse.h:456
void clear(void)
Definition: hook-fcn.h:216
string_vector make_name_list(void)
Definition: help.cc:798
bool reading_classdef_file
Definition: lex.h:374
static void set_completer_word_break_characters(const std::string &s)
Definition: cmd-edit.cc:1216
static int input(yyscan_t yyscanner)
std::string get_file_line(const std::string &fname, size_t line)
Definition: debug.cc:132
static void set_completer_quote_characters(const std::string &s)
Definition: cmd-edit.cc:1237
bool Vdebugging
Definition: input.cc:117
octave_value do_keyboard(const octave_value_list &args)
Definition: input.cc:859
bool octave_completion_matches_called
Definition: input.cc:110
static bool goto_frame_relative(int n, bool verbose=false)
Definition: toplev.h:277
std::string VPS4
Definition: input.cc:85
bool reading_fcn_file
Definition: lex.h:368
static void execute_in_debugger_handler(const std::pair< std::string, int > &arg)
Definition: input.cc:502
void set_default_prompts(void)
Definition: input.cc:139
void run(const octave_value_list &initial_args=octave_value_list())
Definition: hook-fcn.h:239
static char Vcompletion_append_char
Definition: input.cc:100
static void ignore_entries(bool=true)
Definition: cmd-hist.cc:599
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
map_type::iterator iterator
Definition: hook-fcn.h:195