# HG changeset patch # User Rik # Date 1392917277 28800 # Node ID 4e0d72145c5a9cfcc0d2a6d05a57ac40904843d2 # Parent 80b8873c90ba9198a0d69f74642f47696cdc84e8# Parent 1ec884e5ff009030f382f231dc9e5e73e29efbaf maint: Merge gui-release to default. diff -r 80b8873c90ba -r 4e0d72145c5a doc/interpreter/func.txi --- a/doc/interpreter/func.txi Thu Feb 20 09:26:45 2014 -0800 +++ b/doc/interpreter/func.txi Thu Feb 20 09:27:57 2014 -0800 @@ -1054,18 +1054,22 @@ As an example, @example -mlock ("my_function"); +@group +function my_function () + mlock (); + @dots{} +@end group @end example @noindent -prevents @code{my_function} from being removed from memory, even if -@code{clear} is called. It is possible to determine if a function is -locked into memory with the @code{mislocked}, and to unlock a function -with @code{munlock}, which the following illustrates. +prevents @code{my_function} from being removed from memory after it is +called, even if @code{clear} is called. It is possible to determine if +a function is locked into memory with the @code{mislocked}, and to unlock +a function with @code{munlock}, which the following illustrates. @example @group -mlock ("my_function"); +my_function (); mislocked ("my_function") @result{} ans = 1 munlock ("my_function"); @@ -1080,11 +1084,11 @@ @example @group function count_calls () + mlock (); persistent calls = 0; printf ("'count_calls' has been called %d times\n", ++calls); endfunction -mlock ("count_calls"); count_calls (); @print{} 'count_calls' has been called 1 times @@ -1095,22 +1099,6 @@ @end group @end example -@noindent -It is, however, often inconvenient to lock a function from the prompt, -so it is also possible to lock a function from within its body. This -is simply done by calling @code{mlock} from within the function. - -@example -@group -function count_calls () - mlock (); - persistent calls = 0; - printf ("'count_calls' has been called %d times\n", - ++calls); -endfunction -@end group -@end example - @code{mlock} might equally be used to prevent changes to a function from having effect in Octave, though a similar effect can be had with the @code{ignore_function_time_stamp} function. diff -r 80b8873c90ba -r 4e0d72145c5a libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Thu Feb 20 09:26:45 2014 -0800 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Feb 20 09:27:57 2014 -0800 @@ -1448,6 +1448,13 @@ _long_title = settings->value ("editor/longWindowTitle", false).toBool (); update_window_title (_edit_area->isModified ()); + _edit_area->setEdgeColumn ( + settings->value ("editor/long_line_column",80).toInt ()); + if (settings->value ("editor/long_line_marker",true).toBool ()) + _edit_area->setEdgeMode (QsciScintilla::EdgeLine); + else + _edit_area->setEdgeMode (QsciScintilla::EdgeNone); + } void diff -r 80b8873c90ba -r 4e0d72145c5a libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Thu Feb 20 09:26:45 2014 -0800 +++ b/libgui/src/settings-dialog.cc Thu Feb 20 09:27:57 2014 -0800 @@ -142,6 +142,10 @@ _editor_current_line_color, SLOT (setEnabled (bool))); ui->editor_highlightCurrentLine->setChecked ( settings->value ("editor/highlightCurrentLine",true).toBool () ); + ui->editor_long_line_marker->setChecked ( + settings->value ("editor/long_line_marker",true).toBool ()); + ui->editor_long_line_column->setValue ( + settings->value ("editor/long_line_column",80).toInt ()); ui->editor_codeCompletion->setChecked ( settings->value ("editor/codeCompletion", true).toBool () ); @@ -181,6 +185,8 @@ settings->value ("editor/restoreSession", true).toBool ()); ui->editor_create_new_file->setChecked ( settings->value ("editor/create_new_file",false).toBool ()); + + // terminal ui->terminal_fontName->setCurrentFont (QFont ( settings->value ("terminal/fontName","Courier New").toString ()) ); ui->terminal_fontSize->setValue ( @@ -542,6 +548,10 @@ ui->editor_highlightCurrentLine->isChecked ()); settings->setValue ("editor/highlight_current_line_color", _editor_current_line_color->color ()); + settings->setValue ("editor/long_line_marker", + ui->editor_long_line_marker->isChecked ()); + settings->setValue ("editor/long_line_column", + ui->editor_long_line_column->value ()); settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ()); settings->setValue ("editor/codeCompletion_threshold", diff -r 80b8873c90ba -r 4e0d72145c5a libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui Thu Feb 20 09:26:45 2014 -0800 +++ b/libgui/src/settings-dialog.ui Thu Feb 20 09:27:57 2014 -0800 @@ -389,7 +389,7 @@ 0 0 662 - 419 + 470 @@ -397,7 +397,7 @@ - + 6 @@ -440,19 +440,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -525,32 +512,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -630,6 +591,56 @@ + + + + This works well for monospaced fonts. The line is drawn at a position based on the width of a space character in the default font. It may not work very well if styles use proportional fonts or if varied font sizes or bold, italic and normal texts are used. + + + Draw a long line marker + + + true + + + + + + + + + After Column + + + + + + + 2 + + + 256 + + + 80 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -778,9 +789,6 @@ - - 0 - @@ -800,9 +808,6 @@ - - 0 - @@ -895,17 +900,17 @@ - + false - after number of characters typed: + Number of characters before list is shwon: - + false @@ -930,20 +935,7 @@ - - - - true - - - Show completion list automatically ... - - - false - - - - + Qt::Horizontal @@ -956,6 +948,35 @@ + + + + true + + + Show completion list automatically + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + @@ -2195,5 +2216,37 @@ + + editor_long_line_marker + toggled(bool) + editor_long_line_column + setEnabled(bool) + + + 145 + 187 + + + 355 + 187 + + + + + editor_long_line_marker + toggled(bool) + editor_long_line_column_text + setEnabled(bool) + + + 145 + 187 + + + 302 + 187 + + + diff -r 80b8873c90ba -r 4e0d72145c5a libinterp/corefcn/lu.cc --- a/libinterp/corefcn/lu.cc Thu Feb 20 09:26:45 2014 -0800 +++ b/libinterp/corefcn/lu.cc Thu Feb 20 09:27:57 2014 -0800 @@ -574,7 +574,7 @@ %!error lu () %!error lu ([1, 2; 3, 4], 2) -%!test +%!testif HAVE_UMFPACK %! Bi = [1 2 3 4 5 2 3 6 7 8 4 5 7 8 9]; %! Bj = [1 3 4 5 6 7 8 9 11 12 13 14 15 16 17]; %! Bv = [1 1 1 1 1 1 -1 1 1 1 1 -1 1 -1 1]; diff -r 80b8873c90ba -r 4e0d72145c5a libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Thu Feb 20 09:26:45 2014 -0800 +++ b/libinterp/parse-tree/lex.ll Thu Feb 20 09:27:57 2014 -0800 @@ -1218,6 +1218,8 @@ } "@" { + curr_lexer->lexer_debug ("@"); + if (curr_lexer->previous_token_may_be_command () && curr_lexer->space_follows_previous_token ()) { @@ -1226,15 +1228,26 @@ } else { - curr_lexer->lexer_debug ("@"); - - curr_lexer->current_input_column++; - - curr_lexer->looking_at_function_handle++; - curr_lexer->looking_for_object_index = false; - curr_lexer->at_beginning_of_statement = false; - - return curr_lexer->count_token ('@'); + int tok = curr_lexer->previous_token_value (); + + if (curr_lexer->whitespace_is_significant () + && curr_lexer->space_follows_previous_token () + && ! (tok == '[' || tok == '{' + || curr_lexer->previous_token_is_binop ())) + { + yyless (0); + unput (','); + } + else + { + curr_lexer->current_input_column++; + + curr_lexer->looking_at_function_handle++; + curr_lexer->looking_for_object_index = false; + curr_lexer->at_beginning_of_statement = false; + + return curr_lexer->count_token ('@'); + } } } diff -r 80b8873c90ba -r 4e0d72145c5a scripts/gui/waitbar.m --- a/scripts/gui/waitbar.m Thu Feb 20 09:26:45 2014 -0800 +++ b/scripts/gui/waitbar.m Thu Feb 20 09:27:57 2014 -0800 @@ -106,7 +106,8 @@ ## Save and restore current figure cf = get (0, "currentfigure"); - hf = figure ("position", [250, 500, 400, 100], + hf = figure ("units", "pixels", + "position", [250, 500, 400, 100], "numbertitle", "off", "menubar", "none", "toolbar", "none", "integerhandle", "off", diff -r 80b8873c90ba -r 4e0d72145c5a test/parser.tst --- a/test/parser.tst Thu Feb 20 09:26:45 2014 -0800 +++ b/test/parser.tst Thu Feb 20 09:27:57 2014 -0800 @@ -287,3 +287,10 @@ %! a = [97 ... % comment %! 'b']; %! assert (a, 'ab'); + +## Check that a cell array containing function handles is parsed +## correctly with or without commas. +%!test +%! a = {1, @sin, 2, @cos}; +%! b = {1 @sin 2 @cos}; +%! assert (a, b)