Mercurial > octave
changeset 33277:974e6fbb2d6a bytecode-interpreter
maint: Merge default to bytecode-interpreter
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Sat, 30 Mar 2024 11:04:26 -0400 |
parents | 660eb2766b9e (current diff) b4613ff2dac4 (diff) |
children | 92f34eda5c6e |
files | etc/NEWS.9.md |
diffstat | 5 files changed, 70 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/etc/NEWS.9.md Thu Mar 28 19:02:37 2024 -0400 +++ b/etc/NEWS.9.md Sat Mar 30 11:04:26 2024 -0400 @@ -5,12 +5,29 @@ ### Improvements and fixes +- `hist.m`: Add input validation for `Y` restricting it to 2-D array + (bug #65478). + ### GUI +- Use first word for options in right-click menu of command window widget + (bug #65518). +- Set `DontUseNativeDialog` flag as first property in `QFileDialog`. + ### Build system / Tests +- Avoid overriding `save_*` variables from outer scope (bug #65476). + This fixes an error that might have lead to overlinking of shared libraries + (e.g., `.oct` files). Consider rebuilding shared libraries that have been + built with Octave 9.1.0. + ### Documentation +- Describe shape of outputs for `hist` (bug #65471). +- Simplify programming notes for `patch` objects (bug #65421). +- `vecnorm.m`: Add missing parenthesis to equation in docstring. +- Update remaining copyright statements to 2024. + Summary of important user-visible changes for version 9 (2024-03-12): --------------------------------------------------------------------- @@ -264,7 +281,7 @@ `LDFLAGS` rather than `LFLAGS`. `LFLAGS` was deprecated in Octave 6 and has been removed. -Summary of bugs fixed for version 9.1.0 (yyyy-mm-dd): +Summary of bugs fixed for version 9.1.0 (2024-03-12): ---------------------------------------------------- - Bugfixes to `whos -file`, `urlread`, `mat2cell`, `set`, `savepath`,
--- a/libgui/qterminal/libqterminal/QTerminal.cc Thu Mar 28 19:02:37 2024 -0400 +++ b/libgui/qterminal/libqterminal/QTerminal.cc Sat Mar 30 11:04:26 2024 -0400 @@ -107,6 +107,7 @@ if (has_selected_text) { + // Find first word in selected text, trim everything else QRegularExpression expr {"(\\w+)"}; QRegularExpressionMatch match = expr.match (selected_text); @@ -115,15 +116,24 @@ QString expr_found = match.captured (1); m_edit_selected_action->setVisible (true); - m_edit_selected_action->setText (tr ("Edit %1").arg (expr_found)); + m_edit_selected_action->setText (tr ("Edit \"%1\"").arg (expr_found)); m_edit_selected_action->setData (expr_found); m_help_selected_action->setVisible (true); - m_help_selected_action->setText (tr ("Help on %1").arg (expr_found)); + m_help_selected_action->setText (tr ("Help on \"%1\"").arg (expr_found)); m_help_selected_action->setData (expr_found); + } + + // Grab all of selected text, but trim leading non-word characters + // and trailing whitespace + expr.setPattern ("(\\w.*)\\s*$"); + match = expr.match (selected_text); + if (match.hasMatch ()) + { + QString expr_found = match.captured (1); m_doc_selected_action->setVisible (true); - m_doc_selected_action->setText (tr ("Documentation on %1") + m_doc_selected_action->setText (tr ("Documentation on \"%1\"") .arg (expr_found)); m_doc_selected_action->setData (expr_found); }
--- a/libgui/src/m-editor/file-editor-tab.cc Thu Mar 28 19:02:37 2024 -0400 +++ b/libgui/src/m-editor/file-editor-tab.cc Sat Mar 30 11:04:26 2024 -0400 @@ -2591,6 +2591,21 @@ else fileDialog = new QFileDialog (this); + gui_settings settings; + + if (! settings.bool_value (global_use_native_dialogs)) + { + // Qt file dialogs + fileDialog->setOption(QFileDialog::DontUseNativeDialog); + } + else + { + // Native file dialogs: Test for already existing files is done manually + // since native file dialogs might not consider the automatically + // appended default extension when checking if the file already exists + fileDialog->setOption(QFileDialog::DontConfirmOverwrite); + } + // add the possible filters and the default suffix QStringList filters; filters << tr ("Octave Files (*.m)") @@ -2627,21 +2642,6 @@ // FIXME: Remove, if for all common KDE versions (bug #54607) is resolved. - gui_settings settings; - - if (! settings.bool_value (global_use_native_dialogs)) - { - // Qt file dialogs - fileDialog->setOption(QFileDialog::DontUseNativeDialog); - } - else - { - // Native file dialogs: Test for already existing files is done manually - // since native file dialogs might not consider the automatically - // appended default extension when checking if the file already exists - fileDialog->setOption(QFileDialog::DontConfirmOverwrite); - } - connect (fileDialog, &QFileDialog::filterSelected, this, &file_editor_tab::handle_save_as_filter_selected);
--- a/libgui/src/main-window.cc Thu Mar 28 19:02:37 2024 -0400 +++ b/libgui/src/main-window.cc Sat Mar 30 11:04:26 2024 -0400 @@ -1376,10 +1376,17 @@ global_use_custom_editor.def ()).toBool (); // Create a NonModal message. + QWidget *p = this; if (is_internal) p = m_editor_window; + QFileDialog *fileDialog = new QFileDialog (p); + + // FIXME: Remove, if for all common KDE versions (bug #54607) is resolved. + if (! settings.bool_value (global_use_native_dialogs)) + fileDialog->setOption(QFileDialog::DontUseNativeDialog); + fileDialog->setNameFilter (tr ("Octave Files (*.m);;All Files (*)")); fileDialog->setAcceptMode (QFileDialog::AcceptOpen); @@ -1387,10 +1394,6 @@ fileDialog->setFileMode (QFileDialog::ExistingFiles); fileDialog->setDirectory (m_current_directory_combo_box->itemText (0)); - // FIXME: Remove, if for all common KDE versions (bug #54607) is resolved. - if (! settings.bool_value (global_use_native_dialogs)) - fileDialog->setOption(QFileDialog::DontUseNativeDialog); - connect (fileDialog, &QFileDialog::filesSelected, this, &main_window::request_open_files);
--- a/libinterp/corefcn/data.cc Thu Mar 28 19:02:37 2024 -0400 +++ b/libinterp/corefcn/data.cc Sat Mar 30 11:04:26 2024 -0400 @@ -7089,13 +7089,19 @@ error (R"(sort: MODE must be either "ascend" or "descend")"); } else - dim = args(1).nint_value () - 1; + { + if (! args(1).is_scalar_type ()) + error ("sort: DIM must be a positive scalar integer"); + dim = args(1).nint_value () - 1; + if (dim < 0) + error ("sort: DIM must be a positive scalar integer"); + } } if (nargin > 2) { if (have_sortmode) - error ("sort: DIM must be a valid dimension"); + error ("sort: DIM argument must precede MODE argument"); std::string mode = args(2).xstring_value ("sort: MODE must be a string"); @@ -7112,11 +7118,6 @@ { dim = dv.first_non_singleton (); } - else - { - if (dim < 0) - error ("sort: DIM must be a valid dimension"); - } octave_value_list retval (return_idx ? 2 : 1); @@ -7354,8 +7355,15 @@ %! [v, i] = sort (a); %! assert (i, [1, 4, 2, 5, 3]); -%!error sort () -%!error sort (1, 2, 3, 4) +%!error <Invalid call> sort () +%!error <Invalid call> sort (1, 2, 3, 4) +%!error <MODE must be either "ascend" or "descend"> sort (1, "foobar") +%!error <DIM must be a positive scalar integer> sort (1, [1 2 3]) +%!error <DIM argument must precede MODE argument> sort (1, "ascend", 1) +%!error <MODE must be a string> sort (1, 1, 1) +%!error <MODE must be either "ascend" or "descend"> sort (1, 1, "foobar") +%!error <DIM must be a positive scalar integer> sort (1, 0) + */ // Sort the rows of the matrix @var{a} according to the order