changeset 18976:dcb260e7a648

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Fri, 01 Aug 2014 12:10:05 -0400
parents 19cb2530c16b (current diff) c59745865c7f (diff)
children fe505ff21d5b
files build-aux/common.mk configure.ac doc/interpreter/external.txi libgui/qterminal/libqterminal/unix/TerminalView.cpp libgui/src/m-editor/file-editor-interface.h libgui/src/m-editor/octave-qscintilla.cc libgui/src/main-window.cc libgui/src/settings-dialog.cc libgui/src/shortcut-manager.cc libinterp/parse-tree/lex.ll libinterp/parse-tree/module.mk libinterp/parse-tree/oct-parse.in.yy m4/acinclude.m4
diffstat 22 files changed, 395 insertions(+), 115 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/common.mk	Thu Jul 31 15:49:21 2014 +0200
+++ b/build-aux/common.mk	Fri Aug 01 12:10:05 2014 -0400
@@ -46,6 +46,7 @@
 
 YACC = @YACC@
 AM_YFLAGS = -dv
+BISON_API_PREFIX_DECL_STYLE = @BISON_API_PREFIX_DECL_STYLE@
 BISON_PUSH_PULL_DECL_STYLE = @BISON_PUSH_PULL_DECL_STYLE@
 
 GPERF = @GPERF@
--- a/configure.ac	Thu Jul 31 15:49:21 2014 +0200
+++ b/configure.ac	Fri Aug 01 12:10:05 2014 -0400
@@ -2767,6 +2767,7 @@
 
   if test $build_gui = yes; then
     OCTAVE_CHECK_QFONT_MONOSPACE
+    OCTAVE_CHECK_QFONT_FORCE_INTEGER_METRICS
     OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT
     OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE
     OCTAVE_CHECK_FUNC_QSCI_FINDSELECTION
--- a/doc/interpreter/external.txi	Thu Jul 31 15:49:21 2014 +0200
+++ b/doc/interpreter/external.txi	Fri Aug 01 12:10:05 2014 -0400
@@ -23,7 +23,7 @@
 @cindex Dynamically Linked Functions
 @cindex Octave API
 
-“The sum of human wisdom is not contained in any one language"
+"The sum of human wisdom is not contained in any one language"
   ---Ezra Pound
 
 Octave is a fantastic language for solving many problems in science and
--- a/libgui/Makefile.am	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/Makefile.am	Fri Aug 01 12:10:05 2014 -0400
@@ -22,6 +22,10 @@
 
 MOC_CPPFLAGS =
 
+## Fix for bug #42839 where -mieee CFLAG option is added to CPPFLAGS by gnulib.
+## Eventually gnulib will be appropriately fixed and this hack removed.
+MOC_OCTAVE_CPPFLAGS = $(filter-out -mieee, $(AM_CPPFLAGS) $(CPPFLAGS))
+
 octlib_LTLIBRARIES = liboctgui.la
 
 TRANSLATIONS = \
@@ -94,7 +98,7 @@
 ( echo '#ifdef HAVE_CONFIG_H'; \
   echo '#include <config.h>'; \
   echo '#endif'; \
-  $(MOC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(MOC_CPPFLAGS) $(liboctgui_la_CPPFLAGS) $< ) > $@-t
+  $(MOC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MOC_OCTAVE_CPPFLAGS) $(MOC_CPPFLAGS) $(liboctgui_la_CPPFLAGS) $< ) > $@-t
 mv $@-t $@
 endef
 
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Fri Aug 01 12:10:05 2014 -0400
@@ -212,8 +212,11 @@
       // Disabling kerning saves some computation when rendering text.
       // font.setKerning(false);
 
-      font.setStyleStrategy (  QFont::StyleStrategy(font.styleStrategy()
-                             | QFont::ForceIntegerMetrics)  );
+      QFont::StyleStrategy strategy = font.styleStrategy();
+#if defined (HAVE_QFONT_FORCE_INTEGER_METRICS)
+      strategy |= QFont::ForceIntegerMetrics;
+#endif
+      font.setStyleStrategy(QFont::StyleStrategy(strategy));
 
       QWidget::setFont(font);
       fontChange(font);
--- a/libgui/src/m-editor/file-editor-interface.h	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/m-editor/file-editor-interface.h	Fri Aug 01 12:10:05 2014 -0400
@@ -64,6 +64,8 @@
 
   virtual void empty_script (bool, bool) = 0;
 
+  virtual void enable_menu_shortcuts (bool enable) = 0;
+
 public slots:
   virtual void request_new_file (const QString& command = QString ()) = 0;
   virtual void request_new_script (const QString& command = QString ()) = 0;
--- a/libgui/src/m-editor/file-editor-tab.cc	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/m-editor/file-editor-tab.cc	Fri Aug 01 12:10:05 2014 -0400
@@ -1432,21 +1432,28 @@
 
   if (QFile::exists (_file_name))
     {
-      // Create a WindowModal message that blocks the edit area
-      // by making _edit_area parent.
-      QMessageBox* msgBox
-        = new QMessageBox (QMessageBox::Warning,
-                           tr ("Octave Editor"),
-                           tr ("It seems that \'%1\' has been modified by another application. Do you want to reload it?").
-                           arg (_file_name),
-                           QMessageBox::Yes | QMessageBox::No, this);
+      if (_always_reload_changed_files)
+
+              load_file (_file_name);
 
-      connect (msgBox, SIGNAL (finished (int)),
-               this, SLOT (handle_file_reload_answer (int)));
+      else
+        {
+          // Create a WindowModal message that blocks the edit area
+          // by making _edit_area parent.
+          QMessageBox* msgBox
+            = new QMessageBox (QMessageBox::Warning,
+                               tr ("Octave Editor"),
+                               tr ("It seems that \'%1\' has been modified by another application. Do you want to reload it?").
+                               arg (_file_name),
+                               QMessageBox::Yes | QMessageBox::No, this);
 
-      msgBox->setWindowModality (Qt::WindowModal);
-      msgBox->setAttribute (Qt::WA_DeleteOnClose);
-      msgBox->show ();
+          connect (msgBox, SIGNAL (finished (int)),
+                   this, SLOT (handle_file_reload_answer (int)));
+
+          msgBox->setWindowModality (Qt::WindowModal);
+          msgBox->setAttribute (Qt::WA_DeleteOnClose);
+          msgBox->show ();
+        }
     }
   else
     {
@@ -1577,6 +1584,9 @@
   else
     _edit_area->setEdgeMode (QsciScintilla::EdgeNone);
 
+  // reload changed files
+  _always_reload_changed_files = 
+        settings->value ("editor/always_reload_changed_files",false).toBool ();
 }
 
 void
--- a/libgui/src/m-editor/file-editor-tab.h	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/m-editor/file-editor-tab.h	Fri Aug 01 12:10:05 2014 -0400
@@ -224,6 +224,7 @@
   bool _app_closing;
   bool _is_octave_file;
   bool _modal_dialog;
+  bool _always_reload_changed_files;
 
   QFileSystemWatcher _file_system_watcher;
 
--- a/libgui/src/m-editor/file-editor.cc	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/m-editor/file-editor.cc	Fri Aug 01 12:10:05 2014 -0400
@@ -821,8 +821,12 @@
 void
 file_editor::handle_mru_add_file (const QString& file_name)
 {
+  if (_mru_files.at (0) == file_name)
+    return;  // the first entry is already the actual file name
+
   _mru_files.removeAll (file_name);
   _mru_files.prepend (file_name);
+
   mru_menu_update ();
 }
 
@@ -1088,6 +1092,37 @@
 }
 
 void
+file_editor::enable_menu_shortcuts (bool enable)
+{
+  QHash<QMenu*, QStringList>::const_iterator i = _hash_menu_text.constBegin();
+
+ while (i != _hash_menu_text.constEnd())
+   {
+     i.key ()->setTitle (i.value ().at (! enable));
+     ++i;
+   }
+}
+
+QMenu*
+file_editor::m_add_menu (QMenuBar *p, QString name)
+{
+  QMenu *menu = p->addMenu (name);
+
+  QString base_name = name;  // get a copy
+  // replace intended '&' ("&&") by a temp. string
+  base_name.replace ("&&","___octave_amp_replacement___");
+  // remove single '&' (shortcut)
+  base_name.remove ("&");
+  // restore intended '&'
+  base_name.replace ("___octave_amp_replacement___","&&");
+
+  // remember names with and without shortcut
+  _hash_menu_text[menu] = QStringList () << name << base_name;
+
+  return menu;
+}
+
+void
 file_editor::construct (void)
 {
   QWidget *editor_widget = new QWidget (this);
@@ -1120,7 +1155,7 @@
 
   // file menu
 
-  _fileMenu = new QMenu (tr ("&File"), _menu_bar);
+  _fileMenu = m_add_menu (_menu_bar, tr ("&File"));
 
   // new and open menus are inserted later by the main window
   _mru_file_menu = new QMenu (tr ("&Recent Editor Files"), _fileMenu);
@@ -1157,11 +1192,9 @@
   _print_action = add_action (_fileMenu, QIcon (":/actions/icons/fileprint.png"),
           tr ("Print..."), SLOT (request_print_file (bool)));
 
-  _menu_bar->addMenu (_fileMenu);
-
   // edit menu
 
-  QMenu *editMenu = new QMenu (tr ("&Edit"), _menu_bar);
+  QMenu *editMenu = m_add_menu (_menu_bar, tr ("&Edit"));
 
   _undo_action = add_action (editMenu, QIcon (":/actions/icons/undo.png"),
           tr ("&Undo"), SLOT (request_undo (bool)));
@@ -1265,11 +1298,9 @@
           QIcon (":/actions/icons/configure.png"),
           tr ("&Styles Preferences..."), SLOT (request_styles_preferences (bool)));
 
-  _menu_bar->addMenu (editMenu);
-
   // view menu
 
-  QMenu *view_menu = new QMenu (tr ("&View"), _menu_bar);
+  QMenu *view_menu = m_add_menu (_menu_bar, tr ("&View"));
 
   _zoom_in_action = add_action (view_menu, QIcon (),
           tr ("Zoom &In"), SLOT (zoom_in (bool)));
@@ -1282,7 +1313,7 @@
 
   // debug menu
 
-  _debug_menu = new QMenu (tr ("&Debug"), _menu_bar);
+  _debug_menu = m_add_menu (_menu_bar, tr ("&Debug"));
 
   _toggle_breakpoint_action = add_action (_debug_menu,
           QIcon (":/actions/icons/bp_toggle.png"), tr ("Toggle &Breakpoint"),
@@ -1301,11 +1332,9 @@
 
   // The other debug actions will be added by the main window.
 
-  _menu_bar->addMenu (_debug_menu);
-
   // run menu
 
-  QMenu *_run_menu = new QMenu (tr ("&Run"), _menu_bar);
+  QMenu *_run_menu = m_add_menu (_menu_bar, tr ("&Run"));
 
   _run_action = add_action (_run_menu, QIcon (":/actions/icons/artsbuilderexecute.png"),
           tr ("Save File and Run"), SLOT (request_run_file (bool)));
@@ -1313,19 +1342,15 @@
           tr ("Run &Selection"), SLOT (request_context_run (bool)));
   _run_selection_action->setEnabled (false);
 
-  _menu_bar->addMenu (_run_menu);
-
   // help menu
 
-  QMenu *_help_menu = new QMenu (tr ("&Help"), _menu_bar);
+  QMenu *_help_menu = m_add_menu (_menu_bar, tr ("&Help"));
 
   _context_help_action = add_action (_help_menu, QIcon (),
           tr ("&Help on Keyword"), SLOT (request_context_help (bool)));
   _context_doc_action = add_action (_help_menu, QIcon (),
           tr ("&Documentation on Keyword"), SLOT (request_context_doc (bool)));
 
-  _menu_bar->addMenu (_help_menu);
-
   // toolbar
 
   // new and open actions are inserted later from main window
--- a/libgui/src/m-editor/file-editor.h	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/m-editor/file-editor.h	Fri Aug 01 12:10:05 2014 -0400
@@ -64,6 +64,7 @@
 
   void check_actions (void);
   void empty_script (bool startup, bool visible);
+  void enable_menu_shortcuts (bool enable);
 
 signals:
 
@@ -238,7 +239,10 @@
   QAction *add_action (QMenu *menu, const QIcon &icon, const QString &text,
                        const char *member);
 
+  QMenu* m_add_menu (QMenuBar *p, QString text);
+
   std::map<QString, QWidget *> editor_tab_map;
+  QHash<QMenu*, QStringList> _hash_menu_text;
 
   QString ced;
 
@@ -322,7 +326,6 @@
   QMenu *_mru_file_menu;
   QAction *_mru_file_actions[MaxMRUFiles];
   QStringList _mru_files;
-
 };
 
 #endif // FILEEDITORMDISUBWINDOW_H
--- a/libgui/src/m-editor/octave-qscintilla.cc	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Fri Aug 01 12:10:05 2014 -0400
@@ -98,6 +98,36 @@
         }
     }
 #endif
+
+#if defined (Q_OS_MAC)
+  // Octave interprets Cmd key as Meta whereas Qscintilla interprets it
+  // as Ctrl. We thus invert Meta/Ctrl in Qscintilla's shortcuts list.
+  QList< QsciCommand * > cmd_list_mac = cmd_set->commands ();
+  for (int i = 0; i < cmd_list_mac.length (); i++)
+    {
+      // Primary key 
+      int key = cmd_list_mac.at (i)->key ();
+
+      if (static_cast<int> (key | Qt::META) == key &&
+          static_cast<int> (key | Qt::CTRL) != key)
+        key = (key ^ Qt::META) | Qt::CTRL;
+      else if (static_cast<int> (key | Qt::CTRL) == key)
+        key = (key ^ Qt::CTRL) | Qt::META;
+
+      cmd_list_mac.at (i)->setKey (key);
+
+      // Alternate key
+      key = cmd_list_mac.at (i)->alternateKey ();
+
+      if (static_cast<int> (key | Qt::META) == key &&
+          static_cast<int> (key | Qt::CTRL) != key)
+        key = (key ^ Qt::META) | Qt::CTRL;
+      else if (static_cast<int> (key | Qt::CTRL) == key)
+        key = (key ^ Qt::CTRL) | Qt::META;
+
+      cmd_list_mac.at (i)->setAlternateKey (key);
+    }
+#endif
 }
 
 octave_qscintilla::~octave_qscintilla ()
--- a/libgui/src/main-window.cc	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/main-window.cc	Fri Aug 01 12:10:05 2014 -0400
@@ -1024,6 +1024,8 @@
 {
   foreach (octave_dock_widget *widget, dock_widget_list ())
     widget->connect_visibility_changed ();
+
+  editor_window->enable_menu_shortcuts (false);
 }
 
 void
@@ -1336,6 +1338,8 @@
   editor_window->empty_script (true, false);
 #endif
 
+  focus_command_window ();  // make sure that the command window has focus
+
 }
 
 
@@ -1466,9 +1470,40 @@
 }
 
 void
+main_window::enable_menu_shortcuts (bool enable)
+{
+  QHash<QMenu*, QStringList>::const_iterator i = _hash_menu_text.constBegin();
+
+ while (i != _hash_menu_text.constEnd())
+   {
+     i.key ()->setTitle (i.value ().at (! enable));
+     ++i;
+   }
+}
+
+QMenu*
+main_window::m_add_menu (QMenuBar *p, QString name)
+{
+  QMenu *menu = p->addMenu (name);
+
+  QString base_name = name;  // get a copy
+  // replace intended '&' ("&&") by a temp. string
+  base_name.replace ("&&","___octave_amp_replacement___");
+  // remove single '&' (shortcut)
+  base_name.remove ("&");
+  // restore intended '&'
+  base_name.replace ("___octave_amp_replacement___","&&");
+
+  // remember names with and without shortcut
+  _hash_menu_text[menu] = QStringList () << name << base_name;
+
+  return menu;
+}
+
+void
 main_window::construct_file_menu (QMenuBar *p)
 {
-  QMenu *file_menu = p->addMenu (tr ("&File"));
+  QMenu *file_menu = m_add_menu (p, tr ("&File"));
 
   construct_new_menu (file_menu);
 
@@ -1554,7 +1589,7 @@
 void
 main_window::construct_edit_menu (QMenuBar *p)
 {
-  QMenu *edit_menu = p->addMenu (tr ("&Edit"));
+  QMenu *edit_menu = m_add_menu (p, tr ("&Edit"));
 
   QKeySequence ctrl_shift = Qt::ControlModifier + Qt::ShiftModifier;
 
@@ -1629,7 +1664,7 @@
 void
 main_window::construct_debug_menu (QMenuBar *p)
 {
-  _debug_menu = p->addMenu (tr ("De&bug"));
+  _debug_menu = m_add_menu (p, tr ("De&bug"));
 
   _debug_step_over = construct_debug_menu_item
                       (":/actions/icons/db_step.png", tr ("Step"),
@@ -1691,7 +1726,7 @@
 void
 main_window::construct_window_menu (QMenuBar *p)
 {
-  QMenu *window_menu = p->addMenu (tr ("&Window"));
+  QMenu *window_menu = m_add_menu (p, tr ("&Window"));
 
   _show_command_window_action = construct_window_menu_item
             (window_menu, tr ("Show Command Window"), true, command_window);
@@ -1740,7 +1775,7 @@
 void
 main_window::construct_help_menu (QMenuBar *p)
 {
-  QMenu *help_menu = p->addMenu (tr ("&Help"));
+  QMenu *help_menu = m_add_menu (p, tr ("&Help"));
 
   construct_documentation_menu (help_menu);
 
@@ -1782,7 +1817,7 @@
 void
 main_window::construct_news_menu (QMenuBar *p)
 {
-  QMenu *news_menu = p->addMenu (tr ("&News"));
+  QMenu *news_menu = m_add_menu (p, tr ("&News"));
 
   _release_notes_action = add_action (news_menu, QIcon (),
             tr ("Release Notes"), SLOT (display_release_notes ()));
@@ -2216,6 +2251,7 @@
   // this slot is called when editor gets/loses focus
   if (enable)
     { // editor loses focus, set the global shortcuts
+      // and disable the editor's menu
       shortcut_manager::set_shortcut (_copy_action, "main_edit:copy");
       shortcut_manager::set_shortcut (_paste_action, "main_edit:paste");
       shortcut_manager::set_shortcut (_undo_action, "main_edit:undo");
@@ -2223,12 +2259,17 @@
     }
   else
     { // disable shortcuts that are also provided by the editor itself
+      // and enable editor's menu
       QKeySequence no_key = QKeySequence ();
       _copy_action->setShortcut (no_key);
       _paste_action->setShortcut (no_key);
       _undo_action->setShortcut (no_key);
       _select_all_action->setShortcut (no_key);
     }
+
+  // enable/disable the main and the editor's menu shortcuts (alt-key)
+  editor_window->enable_menu_shortcuts (! enable);
+  enable_menu_shortcuts (enable);
 }
 
 void
--- a/libgui/src/main-window.h	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/main-window.h	Fri Aug 01 12:10:05 2014 -0400
@@ -216,6 +216,8 @@
   QAction *add_action (QMenu *menu, const QIcon &icon, const QString &text,
                        const char *member, const QWidget *receiver = 0);
 
+  void enable_menu_shortcuts (bool enable);
+  QMenu* m_add_menu (QMenuBar *p, QString text);
   void construct_menu_bar (void);
   void construct_file_menu (QMenuBar *p);
   void construct_new_menu (QMenu *p);
@@ -276,6 +278,9 @@
 
   workspace_model *_workspace_model;
 
+  QHash<QMenu*, QStringList> _hash_menu_text;
+
+
   // Toolbars.
   QStatusBar *status_bar;
 
--- a/libgui/src/settings-dialog.cc	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/settings-dialog.cc	Fri Aug 01 12:10:05 2014 -0400
@@ -206,6 +206,8 @@
     settings->value ("editor/restoreSession", true).toBool ());
   ui->editor_create_new_file->setChecked (
     settings->value ("editor/create_new_file",false).toBool ());
+  ui->editor_reload_changed_files->setChecked (
+    settings->value ("editor/always_reload_changed_files",false).toBool ());
 
   // terminal
   ui->terminal_fontName->setCurrentFont (QFont (
@@ -649,6 +651,8 @@
                       ui->editor_restoreSession->isChecked ());
   settings->setValue ("editor/create_new_file",
                       ui->editor_create_new_file->isChecked ());
+  settings->setValue ("editor/always_reload_changed_files",
+                      ui->editor_reload_changed_files->isChecked ());
   settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value ());
   settings->setValue ("terminal/fontName",
                       ui->terminal_fontName->currentFont ().family ());
--- a/libgui/src/settings-dialog.ui	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/settings-dialog.ui	Fri Aug 01 12:10:05 2014 -0400
@@ -404,9 +404,9 @@
           <property name="geometry">
            <rect>
             <x>0</x>
-            <y>-146</y>
+            <y>-175</y>
             <width>662</width>
-            <height>553</height>
+            <height>580</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_16">
@@ -1083,6 +1083,13 @@
                  </property>
                 </widget>
                </item>
+               <item>
+                <widget class="QCheckBox" name="editor_reload_changed_files">
+                 <property name="text">
+                  <string>Reload externally changed files without prompt</string>
+                 </property>
+                </widget>
+               </item>
               </layout>
              </item>
              <item>
--- a/libgui/src/shortcut-manager.cc	Thu Jul 31 15:49:21 2014 +0200
+++ b/libgui/src/shortcut-manager.cc	Fri Aug 01 12:10:05 2014 -0400
@@ -24,6 +24,7 @@
 #include <config.h>
 #endif
 
+#include <QtCore>
 #include <QMessageBox>
 #include <QDebug>
 #include <QGridLayout>
@@ -46,6 +47,11 @@
 shortcut_manager::shortcut_manager ()
 {
   setObjectName ("Shortcut_Manager");
+  
+  // Mac: don't let Qt interpret CMD key ("Meta" in Qt terminology) as Ctrl
+#if defined (Q_OS_MAC)
+  QCoreApplication::setAttribute (Qt::AA_MacDontSwapCtrlAndMeta, true);
+#endif
 
   _settings = resource_manager::get_settings ();
 }
@@ -80,12 +86,29 @@
 void
 shortcut_manager::do_init_data ()
 {
+  QKeySequence ctrl;
+  int prefix; 
+#if defined (Q_OS_MAC)
+  // Use CMD key as an equivalent of Ctrl key on other platforms
+  ctrl =  Qt::MetaModifier;
+  // Some of octave default shortcuts on windows/linux are already defined 
+  // as system wide shortcuts on Mac Os X (almost all Function keys). 
+  // Prefix those with Option (Alt) modifier to avoid conflicts.
+  prefix = Qt::AltModifier;
+#else
+  ctrl = Qt::ControlModifier;
+  prefix = Qt::NoModifier;
+#endif
+
+  QKeySequence ctrl_shift = ctrl + Qt::ShiftModifier;
+  QKeySequence ctrl_alt = ctrl + Qt::AltModifier;
+  
   // actions of the main window
 
   // file
   init (tr ("New File"), "main_file:new_file", QKeySequence::New);
   init (tr ("New Function"), "main_file:new_function",
-        QKeySequence ("Ctrl+Shift+N"));
+        QKeySequence (ctrl_shift + Qt::Key_N));
   init (tr ("New Figure"), "main_file:new_figure", QKeySequence ());
   init (tr ("Open File"), "main_file:open_file", QKeySequence::Open);
   init (tr ("Load Workspace"), "main_file:load_workspace", QKeySequence ());
@@ -100,35 +123,50 @@
   init (tr ("Select All"), "main_edit:select_all", QKeySequence ());
   init (tr ("Clear Clipboard"), "main_edit:clear_clipboard", QKeySequence ());
   init (tr ("Find in Files"), "main_edit:find_in_files",
-        QKeySequence (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_F));
+        QKeySequence (ctrl_shift + Qt::Key_F));
   init (tr ("Clear Command Window"), "main_edit:clear_command_window",
         QKeySequence ());
   init (tr ("Clear Command History"), "main_edit:clear_history",
         QKeySequence ());
   init (tr ("Clear Workspace"), "main_edit:clear_workspace", QKeySequence ());
 
-  // debug
-  init (tr ("Step Over"), "main_debug:step_over", QKeySequence (Qt::Key_F10));
-  init (tr ("Step Into"), "main_debug:step_into", QKeySequence (Qt::Key_F11));
-  init (tr ("Step Out"), "main_debug:step_out", QKeySequence (Qt::ShiftModifier + Qt::Key_F11));
-  init (tr ("Continue"), "main_debug:continue", QKeySequence (Qt::Key_F5));
-  init (tr ("Quit Debug Mode"), "main_debug:quit", QKeySequence (Qt::ShiftModifier + Qt::Key_F5));
+  // debug 
+  init (tr ("Step Over"), "main_debug:step_over", 
+        QKeySequence (prefix + Qt::Key_F10));
+  init (tr ("Step Into"), "main_debug:step_into", 
+        QKeySequence (prefix + Qt::Key_F11));
+  init (tr ("Step Out"), "main_debug:step_out", 
+        QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_F11));
+  init (tr ("Continue"), "main_debug:continue", 
+        QKeySequence (prefix + Qt::Key_F5));
+  init (tr ("Quit Debug Mode"), "main_debug:quit", 
+        QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_F5));
 
   // window
-  QKeySequence ctrl = Qt::ControlModifier;
-  QKeySequence ctrl_shift = Qt::ControlModifier + Qt::ShiftModifier;
-  init (tr ("Show Command Window"), "main_window:show_command", ctrl_shift + Qt::Key_0);
-  init (tr ("Show Command History"), "main_window:show_history", ctrl_shift + Qt::Key_1);
-  init (tr ("Show File Browser"), "main_window:show_file_browser", ctrl_shift + Qt::Key_2);
-  init (tr ("Show Workspace"), "main_window:show_workspace", ctrl_shift + Qt::Key_3);
-  init (tr ("Show Editor"), "main_window:show_editor", ctrl_shift + Qt::Key_4);
-  init (tr ("Show Documentation"), "main_window:show_doc", ctrl_shift + Qt::Key_5);
-  init (tr ("Command Window"), "main_window:command", ctrl + Qt::Key_0);
-  init (tr ("Command History"), "main_window:history", ctrl + Qt::Key_1);
-  init (tr ("File Browser"), "main_window:file_browser", ctrl + Qt::Key_2);
-  init (tr ("Workspace"), "main_window:workspace", ctrl + Qt::Key_3);
-  init (tr ("Editor"), "main_window:editor", ctrl + Qt::Key_4);
-  init (tr ("Documentation"), "main_window:doc", ctrl + Qt::Key_5);
+  init (tr ("Show Command Window"), "main_window:show_command", 
+        prefix + ctrl_shift + Qt::Key_0);
+  init (tr ("Show Command History"), "main_window:show_history", 
+        prefix + ctrl_shift + Qt::Key_1);
+  init (tr ("Show File Browser"), "main_window:show_file_browser", 
+        prefix + ctrl_shift + Qt::Key_2);
+  init (tr ("Show Workspace"), "main_window:show_workspace", 
+        prefix + ctrl_shift + Qt::Key_3);
+  init (tr ("Show Editor"), "main_window:show_editor", 
+        prefix + ctrl_shift + Qt::Key_4);
+  init (tr ("Show Documentation"), "main_window:show_doc", 
+        prefix + ctrl_shift + Qt::Key_5);
+  init (tr ("Command Window"), "main_window:command", 
+        prefix + ctrl + Qt::Key_0);
+  init (tr ("Command History"), "main_window:history", 
+        prefix + ctrl + Qt::Key_1);
+  init (tr ("File Browser"), "main_window:file_browser", 
+        prefix + ctrl + Qt::Key_2);
+  init (tr ("Workspace"), "main_window:workspace", 
+        prefix + ctrl + Qt::Key_3);
+  init (tr ("Editor"), "main_window:editor", 
+        prefix + ctrl + Qt::Key_4);
+  init (tr ("Documentation"), "main_window:doc", 
+        prefix + ctrl + Qt::Key_5);
   init (tr ("Reset Window Layout"), "main_window:reset", QKeySequence ());
 
   // help
@@ -149,7 +187,7 @@
 
   // file
   init (tr ("Edit Function"), "editor_file:edit_function",
-        QKeySequence (Qt::ControlModifier + Qt::Key_E));
+        QKeySequence (ctrl + Qt::Key_E));
   init (tr ("Save File"), "editor_file:save", QKeySequence::Save);
   init (tr ("Save File As"), "editor_file:save_as", QKeySequence::SaveAs);
   init (tr ("Close"), "editor_file:close", QKeySequence::Close);
@@ -166,49 +204,56 @@
   init (tr ("Select All"), "editor_edit:select_all", QKeySequence::SelectAll);
   init (tr ("Find and Replace"), "editor_edit:find_replace",
         QKeySequence::Find);
-
   init (tr ("Delete to Start of Word"), "editor_edit:delete_start_word", 
         QKeySequence::DeleteStartOfWord);
   init (tr ("Delete to End of Word"), "editor_edit:delete_end_word", 
         QKeySequence::DeleteEndOfWord);
-  init (tr ("Delete to Start of Line"), "editor_edit:delete_start_line",
-        QKeySequence (Qt::ControlModifier + Qt::SHIFT + Qt::Key_Backspace));
-  init (tr ("Delete to End of Line"), "editor_edit:delete_end_line",
-        QKeySequence (Qt::ControlModifier + Qt::SHIFT + Qt::Key_Delete));
-  init (tr ("Delete Line"), "editor_edit:delete_line", 
-        QKeySequence (Qt::ControlModifier + Qt::SHIFT + Qt::Key_L));
-  init (tr ("Copy Line"), "editor_edit:copy_line",
-        QKeySequence (Qt::ControlModifier + Qt::SHIFT + Qt::Key_C));
-  init (tr ("Cut Line"), "editor_edit:cut_line",
-        QKeySequence (Qt::ControlModifier + Qt::SHIFT + Qt::Key_X));
-  init (tr ("Duplicate Selection/Line"), "editor_edit:duplicate_selection", 
-        QKeySequence (Qt::ControlModifier + Qt::Key_D));
-  init (tr ("Transpose Line"), "editor_edit:transpose_line", 
-        QKeySequence (Qt::ControlModifier + Qt::Key_T));
-  init (tr ("Completion List"), "editor_edit:completion_list",
-        QKeySequence (Qt::ControlModifier + Qt::Key_Space));
+  init (tr ("Delete to Start of Line"), "editor_edit:delete_start_line",  
+        QKeySequence (ctrl_shift + Qt::Key_Backspace));
+  init (tr ("Delete to End of Line"), "editor_edit:delete_end_line",  
+        QKeySequence (ctrl_shift + Qt::Key_Delete));
+  init (tr ("Delete Line"), "editor_edit:delete_line",  
+        QKeySequence (ctrl_shift + Qt::Key_L));
+  init (tr ("Copy Line"), "editor_edit:copy_line",  
+        QKeySequence (ctrl_shift + Qt::Key_C));
+  init (tr ("Cut Line"), "editor_edit:cut_line",  
+        QKeySequence (ctrl_shift + Qt::Key_X));
+  init (tr ("Duplicate Selection/Line"), "editor_edit:duplicate_selection",  
+        QKeySequence (ctrl + Qt::Key_D));
+  init (tr ("Transpose Line"), "editor_edit:transpose_line",  
+        QKeySequence (ctrl + Qt::Key_T));
+  init (tr ("Completion List"), "editor_edit:completion_list",  
+        QKeySequence (ctrl + Qt::Key_Space));
 
-  init (tr ("Comment Selection"), "editor_edit:comment_selection",
-        QKeySequence (Qt::ControlModifier + Qt::Key_R));
-  init (tr ("Uncomment Selection"), "editor_edit:uncomment_selection", 
-        QKeySequence (Qt::SHIFT + Qt::ControlModifier + Qt::Key_R));
-  init (tr ("Uppercase Selection"), "editor_edit:upper_case",
-        QKeySequence (Qt::ControlModifier + Qt::Key_U));
-  init (tr ("Lowercase Selection"), "editor_edit:lower_case",
-        QKeySequence (Qt::ControlModifier + Qt::AltModifier + Qt::Key_U));
-  init (tr ("Indent Selection"), "editor_edit:indent_selection", 
-        QKeySequence (Qt::ControlModifier + Qt::Key_Tab));
-  init (tr ("Unindent Selection"), "editor_edit:unindent_selection",
-        QKeySequence (Qt::SHIFT + Qt::ControlModifier + Qt::Key_Tab));
+  init (tr ("Comment Selection"), "editor_edit:comment_selection",  
+        QKeySequence (ctrl + Qt::Key_R));
+  init (tr ("Uncomment Selection"), "editor_edit:uncomment_selection",  
+        QKeySequence (ctrl_shift + Qt::Key_R));
+  init (tr ("Uppercase Selection"), "editor_edit:upper_case",  
+        QKeySequence (ctrl + Qt::Key_U));
+  init (tr ("Lowercase Selection"), "editor_edit:lower_case",  
+        QKeySequence (ctrl_alt + Qt::Key_U));
 
-  init (tr ("Goto Line"), "editor_edit:goto_line",
-        QKeySequence (Qt::ControlModifier+ Qt::Key_G));
+#if defined (Q_OS_MAC)
+  init (tr ("Indent Selection"), "editor_edit:indent_selection",  
+        QKeySequence (prefix + Qt::Key_Tab));
+  init (tr ("Unindent Selection"), "editor_edit:unindent_selection",  
+        QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_Tab));
+#else
+  init (tr ("Indent Selection"), "editor_edit:indent_selection",  
+        QKeySequence (ctrl + Qt::Key_Tab));
+  init (tr ("Unindent Selection"), "editor_edit:unindent_selection",  
+        QKeySequence (ctrl_shift + Qt::Key_Tab));
+#endif
+
+  init (tr ("Goto Line"), "editor_edit:goto_line",  
+        QKeySequence (ctrl + Qt::Key_G));
   init (tr ("Toggle Bookmark"), "editor_edit:toggle_bookmark",
-        QKeySequence (Qt::Key_F7));
+        QKeySequence (prefix + Qt::Key_F7));
   init (tr ("Next Bookmark"), "editor_edit:next_bookmark",
-        QKeySequence (Qt::Key_F2));
+        QKeySequence (prefix + Qt::Key_F2));
   init (tr ("Previous Bookmark"), "editor_edit:previous_bookmark",
-        QKeySequence (Qt::SHIFT + Qt::Key_F2));
+        QKeySequence (prefix + Qt::SHIFT + Qt::Key_F2));
   init (tr ("Remove All Bookmark"), "editor_edit:remove_bookmark",
         QKeySequence ());
 
@@ -219,7 +264,13 @@
   // view
   init (tr ("Zoom In"), "editor_view:zoom_in", QKeySequence::ZoomIn);
   init (tr ("Zoom Out"), "editor_view:zoom_out", QKeySequence::ZoomOut);
-  init (tr ("Zoom Normal"), "editor_view:zoom_normal",  QKeySequence (Qt::ControlModifier + Qt::AltModifier + Qt::Key_0));
+#if defined (Q_OS_MAC)
+  init (tr ("Zoom Normal"), "editor_view:zoom_normal",
+        QKeySequence (ctrl + Qt::Key_Underscore));
+#else
+  init (tr ("Zoom Normal"), "editor_view:zoom_normal",
+        QKeySequence (ctrl_alt + Qt::Key_0));
+#endif
 
   // debug
   init (tr ("Toggle Breakpoint"), "editor_debug:toggle_breakpoint",
@@ -232,8 +283,10 @@
         QKeySequence ());
 
   // run
-  init (tr ("Run File"), "editor_run:run_file", QKeySequence (Qt::Key_F5));
-  init (tr ("Run Selection"), "editor_run:run_selection", QKeySequence (Qt::Key_F9));
+  init (tr ("Run File"), "editor_run:run_file", 
+        QKeySequence (prefix + Qt::Key_F5) );
+  init (tr ("Run Selection"), "editor_run:run_selection", 
+        QKeySequence (prefix + Qt::Key_F9) );
 
   // help
   init (tr ("Help on Keyword"), "editor_help:help_keyword", QKeySequence::HelpContents);
--- a/libinterp/parse-tree/lex.ll	Thu Jul 31 15:49:21 2014 +0200
+++ b/libinterp/parse-tree/lex.ll	Fri Aug 01 12:10:05 2014 -0400
@@ -98,6 +98,17 @@
 #include <oct-parse.h>
 #include <oct-gperf.h>
 
+// FIXME: with bison 3.x, OCTAVE_STYPE appears in the generated
+// oct-parse.h file, but there is no definition for YYSTYPE, which is
+// needed by the code that is generated by flex.  I can't seem to find a
+// way to tell flex to use OCTAVE_STYPE instead of YYSTYPE in the code
+// it generates, or to tell bison to provide the definition of YYSTYPE
+// in the generated oct-parse.h file.
+
+#if defined (OCTAVE_STYPE_IS_DECLARED) && ! defined YYSTYPE
+#define YYSTYPE OCTAVE_STYPE
+#endif
+
 #if defined (GNULIB_NAMESPACE)
 // Calls to the following functions appear in the generated output from
 // flex without the namespace tag.  Redefine them so we will use them
--- a/libinterp/parse-tree/module.mk	Thu Jul 31 15:49:21 2014 +0200
+++ b/libinterp/parse-tree/module.mk	Fri Aug 01 12:10:05 2014 -0400
@@ -90,15 +90,20 @@
 	rm -f $@-t1
 
 parse-tree/oct-parse.yy: parse-tree/oct-parse.in.yy
+	case "$(BISON_API_PREFIX_DECL_STYLE)" in \
+	  *api*) api_prefix_decl='%define api.prefix "octave-"'; ;; \
+	  *name*) api_prefix_decl='%name-prefix="octave_"'; ;; \
+	esac; \
 	case "$(BISON_PUSH_PULL_DECL_STYLE)" in \
-          *quote*) quote='"' ;; \
+	  *quote*) quote='"' ;; \
 	  *) quote="" ;; \
-        esac; \
-        case "$(BISON_PUSH_PULL_DECL_STYLE)" in \
-          *dash*) decl="%define api.push-pull $${quote}both$${quote}"; ;; \
-          *underscore*) decl="%define api.push_pull $${quote}both$${quote}"; ;; \
-        esac; \
-	$(SED) "s/%PUSH_PULL_DECL%/$$decl/" $< > $@-t
+	esac; \
+	case "$(BISON_PUSH_PULL_DECL_STYLE)" in \
+	  *dash*) push_pull_decl="%define api.push-pull $${quote}both$${quote}"; ;; \
+	  *underscore*) push_pull_decl="%define api.push_pull $${quote}both$${quote}"; ;; \
+	esac; \
+	$(SED) -e "s/%PUSH_PULL_DECL%/$$push_pull_decl/" \
+	       -e "s/%API_PREFIX_DECL%/$$api_prefix_decl/" $< > $@-t
 	mv $@-t $@
 
 noinst_LTLIBRARIES += \
--- a/libinterp/parse-tree/oct-parse.in.yy	Thu Jul 31 15:49:21 2014 +0200
+++ b/libinterp/parse-tree/oct-parse.in.yy	Fri Aug 01 12:10:05 2014 -0400
@@ -131,10 +131,7 @@
 
 %expect 14
 
-// Don't add spaces around the = here; it causes some versions of
-// bison to fail to properly recognize the directive.
-
-%name-prefix="octave_"
+%API_PREFIX_DECL%
 
 // We are using the pure parser interface and the reentrant lexer
 // interface but the Octave parser and lexer are NOT properly
--- a/m4/acinclude.m4	Thu Jul 31 15:49:21 2014 +0200
+++ b/m4/acinclude.m4	Fri Aug 01 12:10:05 2014 -0400
@@ -383,6 +383,30 @@
   fi
 ])
 dnl
+dnl Check whether Qt provides QFont::ForceIntegerMetrics
+dnl
+AC_DEFUN([OCTAVE_CHECK_QFONT_FORCE_INTEGER_METRICS], [
+  AC_CACHE_CHECK([whether Qt provides QFont::ForceIntegerMetrics],
+    [octave_cv_decl_qfont_force_integer_metrics],
+    [AC_LANG_PUSH(C++)
+    ac_octave_save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+        #include <QFont>
+        ]], [[
+        QFont::StyleStrategy strategy = QFont::ForceIntegerMetrics;
+        ]])],
+      octave_cv_decl_qfont_force_integer_metrics=yes,
+      octave_cv_decl_qfont_force_integer_metrics=no)
+    CPPFLAGS="$ac_octave_save_CPPFLAGS"
+    AC_LANG_POP(C++)
+  ])
+  if test $octave_cv_decl_qfont_force_integer_metrics = yes; then
+    AC_DEFINE(HAVE_QFONT_FORCE_INTEGER_METRICS, 1,
+      [Define to 1 if Qt provides QFont::ForceIntegerMetrics.])
+  fi
+])
+dnl
 dnl Check whether Qscintilla SetPlaceholderText function exists.
 dnl FIXME: This test uses a version number.  It potentially could
 dnl        be re-written to actually call the function, but is it worth it?
@@ -1863,6 +1887,49 @@
   esac
 
   if test $tmp_have_bison = yes; then
+    AC_CACHE_CHECK([syntax of bison api.prefix (or name-prefix) declaration],
+                   [octave_cv_bison_api_prefix_decl_style], [
+      style="api name"
+      for s in $style; do
+        if test $s = "api"; then
+          def='%define api.prefix "foo_"'
+        else
+          def='%name-prefix="foo_"'
+        fi
+        cat << EOF > conftest.yy
+$def
+%start input
+%%
+input:;
+%%
+EOF
+        $YACC conftest.yy > /dev/null 2>&1
+        ac_status=$?
+        if test $ac_status -eq 0; then
+          octave_cv_bison_api_prefix_decl_style="$s"
+          break
+        fi
+        if test $ac_status -eq 0; then
+          break
+        fi
+      done
+      rm -f conftest.yy y.tab.h y.tab.c
+      ])
+  fi
+
+  AC_SUBST(BISON_API_PREFIX_DECL_STYLE, $octave_cv_bison_api_prefix_decl_style)
+
+  if test -z "$octave_cv_bison_api_prefix_decl_style"; then
+    YACC=
+    warn_bison_api_prefix_decl_style="
+
+I wasn't able to find a suitable style for declaring the api prefix
+in a bison input file so I'm disabling bison.
+"
+    OCTAVE_CONFIGURE_WARNING([warn_bison_api_prefix_decl_style])
+  fi
+
+  if test $tmp_have_bison = yes; then
     AC_CACHE_CHECK([syntax of bison push/pull declaration],
                    [octave_cv_bison_push_pull_decl_style], [
       style="dash underscore"
--- a/scripts/gui/waitforbuttonpress.m	Thu Jul 31 15:49:21 2014 +0200
+++ b/scripts/gui/waitforbuttonpress.m	Fri Aug 01 12:10:05 2014 -0400
@@ -18,7 +18,7 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} waitforbuttonpress ()
-## @deftypefnx {Function File} {@var{a} =} waitforbuttonpress ()
+## @deftypefnx {Function File} {@var{b} =} waitforbuttonpress ()
 ## Wait for mouse click or key press over the current figure window.
 ##
 ## The return value of @var{b} is 0 if a mouse button was pressed or 1 if a
--- a/scripts/statistics/base/statistics.m	Thu Jul 31 15:49:21 2014 +0200
+++ b/scripts/statistics/base/statistics.m	Fri Aug 01 12:10:05 2014 -0400
@@ -61,7 +61,7 @@
   emp_inv = quantile (x, [0.25; 0.5; 0.75], dim, 7);
 
   stats = cat (dim, min (x, [], dim), emp_inv, max (x, [], dim), mean (x, dim),
-               std (x, [], dim), skewness (x, dim), kurtosis (x, dim));
+               std (x, [], dim), skewness (x, [], dim), kurtosis (x, [], dim));
 
 endfunction
 
@@ -77,6 +77,16 @@
 %! assert (skewness (x), s(8,:), eps);
 %! assert (kurtosis (x), s(9,:), eps);
 
+%! x = rand (7,5);
+%! s = statistics (x, 2);
+%! assert (min (x, [], 2), s(:,1), eps);
+%! assert (median (x, 2), s(:,3), eps);
+%! assert (max (x, [], 2), s(:,5), eps);
+%! assert (mean (x, 2), s(:,6), eps);
+%! assert (std (x, [], 2), s(:,7), eps);
+%! assert (skewness (x, [], 2), s(:,8), eps);
+%! assert (kurtosis (x, [], 2), s(:,9), eps);
+
 %% Test input validation
 %!error statistics ()
 %!error statistics (1, 2, 3)