changeset 17117:dd399f461ff3

Merged my LaTeX markup with Savannah. * txt-latex.cc: Moved from libinterp/interp-core to libinterp/corefcn. * txt-latex.h: Moved from libinterp/interp-core to libinterp/corefcn. * txt-render.cc Moved from libinterp/interp-core to libinterp/corefcn. * txt-render.h Moved from libinterp/interp-core to libinterp/corefcn. * module.mk: Deleted interp-core/module.mk and edit corefcn/module.mk .
author AndrejLojdl <andrej.lojdl@gmail.com>
date Tue, 30 Jul 2013 22:47:01 +0200
parents 8ad11cc45df6 (current diff) 1c421f01b737 (diff)
children 527991b748ba
files doc/doxyhtml/Doxygen.cfg doc/interpreter/dynamic.txi examples/firstmexdemo.c examples/hello.cc libinterp/corefcn/gl-render.cc libinterp/corefcn/gl-render.h libinterp/corefcn/graphics.cc libinterp/corefcn/graphics.in.h libinterp/corefcn/module.mk libinterp/corefcn/txt-eng-ft.cc libinterp/corefcn/txt-eng-ft.h libinterp/corefcn/txt-eng.h libinterp/corefcn/txt-latex.cc libinterp/corefcn/txt-latex.h libinterp/corefcn/txt-render.cc libinterp/corefcn/txt-render.h libinterp/interp-core/Cell.cc libinterp/interp-core/Cell.h libinterp/interp-core/action-container.h libinterp/interp-core/c-file-ptr-stream.cc libinterp/interp-core/c-file-ptr-stream.h libinterp/interp-core/comment-list.cc libinterp/interp-core/comment-list.h libinterp/interp-core/cutils.c libinterp/interp-core/cutils.h libinterp/interp-core/defun-dld.h libinterp/interp-core/defun-int.h libinterp/interp-core/display.cc libinterp/interp-core/display.h libinterp/interp-core/dynamic-ld.cc libinterp/interp-core/dynamic-ld.h libinterp/interp-core/event-queue.h libinterp/interp-core/gl-render.cc libinterp/interp-core/gl-render.h libinterp/interp-core/gl2ps-renderer.cc libinterp/interp-core/gl2ps-renderer.h libinterp/interp-core/gl2ps.c libinterp/interp-core/gl2ps.h libinterp/interp-core/gripes.cc libinterp/interp-core/gripes.h libinterp/interp-core/jit-ir.cc libinterp/interp-core/jit-ir.h libinterp/interp-core/jit-typeinfo.cc libinterp/interp-core/jit-typeinfo.h libinterp/interp-core/jit-util.cc libinterp/interp-core/jit-util.h libinterp/interp-core/ls-ascii-helper.cc libinterp/interp-core/ls-ascii-helper.h libinterp/interp-core/ls-hdf5.cc libinterp/interp-core/ls-hdf5.h libinterp/interp-core/ls-mat-ascii.cc libinterp/interp-core/ls-mat-ascii.h libinterp/interp-core/ls-mat4.cc libinterp/interp-core/ls-mat4.h libinterp/interp-core/ls-mat5.cc libinterp/interp-core/ls-mat5.h libinterp/interp-core/ls-oct-binary.cc libinterp/interp-core/ls-oct-binary.h libinterp/interp-core/ls-utils.cc libinterp/interp-core/ls-utils.h libinterp/interp-core/matherr.c libinterp/interp-core/mex.cc libinterp/interp-core/mex.h libinterp/interp-core/mexproto.h libinterp/interp-core/module.mk libinterp/interp-core/mxarray.in.h libinterp/interp-core/oct-errno.h libinterp/interp-core/oct-errno.in.cc libinterp/interp-core/oct-fstrm.cc libinterp/interp-core/oct-fstrm.h libinterp/interp-core/oct-hdf5.h libinterp/interp-core/oct-iostrm.cc libinterp/interp-core/oct-iostrm.h libinterp/interp-core/oct-lvalue.cc libinterp/interp-core/oct-lvalue.h libinterp/interp-core/oct-map.cc libinterp/interp-core/oct-map.h libinterp/interp-core/oct-obj.cc libinterp/interp-core/oct-obj.h libinterp/interp-core/oct-prcstrm.cc libinterp/interp-core/oct-prcstrm.h libinterp/interp-core/oct-procbuf.cc libinterp/interp-core/oct-procbuf.h libinterp/interp-core/oct-stdstrm.h libinterp/interp-core/oct-stream.cc libinterp/interp-core/oct-stream.h libinterp/interp-core/oct-strstrm.cc libinterp/interp-core/oct-strstrm.h libinterp/interp-core/oct.h libinterp/interp-core/procstream.cc libinterp/interp-core/procstream.h libinterp/interp-core/pt-jit.cc libinterp/interp-core/pt-jit.h libinterp/interp-core/siglist.c libinterp/interp-core/siglist.h libinterp/interp-core/sparse-xdiv.cc libinterp/interp-core/sparse-xdiv.h libinterp/interp-core/sparse-xpow.cc libinterp/interp-core/sparse-xpow.h libinterp/interp-core/txt-eng-ft.cc libinterp/interp-core/txt-eng-ft.h libinterp/interp-core/txt-eng.h libinterp/interp-core/txt-latex.cc libinterp/interp-core/txt-latex.h libinterp/interp-core/txt-render.cc libinterp/interp-core/txt-render.h libinterp/interp-core/unwind-prot.cc libinterp/interp-core/unwind-prot.h libinterp/interp-core/xdiv.cc libinterp/interp-core/xdiv.h libinterp/interp-core/xgl2ps.c libinterp/interp-core/xnorm.cc libinterp/interp-core/xnorm.h libinterp/interp-core/xpow.cc libinterp/interp-core/xpow.h libinterp/interp-core/zfstream.cc libinterp/interp-core/zfstream.h libinterp/interpfcn/data.cc libinterp/interpfcn/data.h libinterp/interpfcn/debug.cc libinterp/interpfcn/debug.h libinterp/interpfcn/defaults.cc libinterp/interpfcn/defaults.in.h libinterp/interpfcn/defun.cc libinterp/interpfcn/defun.h libinterp/interpfcn/dirfns.cc libinterp/interpfcn/dirfns.h libinterp/interpfcn/error.cc libinterp/interpfcn/error.h libinterp/interpfcn/file-io.cc libinterp/interpfcn/file-io.h libinterp/interpfcn/graphics.cc libinterp/interpfcn/graphics.in.h libinterp/interpfcn/help.cc libinterp/interpfcn/help.h libinterp/interpfcn/hook-fcn.cc libinterp/interpfcn/hook-fcn.h libinterp/interpfcn/input.cc libinterp/interpfcn/input.h libinterp/interpfcn/load-path.cc libinterp/interpfcn/load-path.h libinterp/interpfcn/load-save.cc libinterp/interpfcn/load-save.h libinterp/interpfcn/ls-oct-ascii.cc libinterp/interpfcn/ls-oct-ascii.h libinterp/interpfcn/module.mk libinterp/interpfcn/oct-hist.cc libinterp/interpfcn/oct-hist.h libinterp/interpfcn/octave-link.cc libinterp/interpfcn/octave-link.h libinterp/interpfcn/pager.cc libinterp/interpfcn/pager.h libinterp/interpfcn/pr-output.cc libinterp/interpfcn/pr-output.h libinterp/interpfcn/profiler.cc libinterp/interpfcn/profiler.h libinterp/interpfcn/sighandlers.cc libinterp/interpfcn/sighandlers.h libinterp/interpfcn/symtab.cc libinterp/interpfcn/symtab.h libinterp/interpfcn/sysdep.cc libinterp/interpfcn/sysdep.h libinterp/interpfcn/toplev.cc libinterp/interpfcn/toplev.h libinterp/interpfcn/utils.cc libinterp/interpfcn/utils.h libinterp/interpfcn/variables.cc libinterp/interpfcn/variables.h libinterp/interpfcn/workspace-element.h liboctave/util/regexp.cc liboctave/util/regexp.h scripts/deprecated/setstr.m scripts/general/isequalwithequalnans.m scripts/help/gen_doc_cache.m
diffstat 650 files changed, 23970 insertions(+), 12505 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am
+++ b/Makefile.am
@@ -146,6 +146,12 @@
   NEWS \
   CITATION
 
+doxyhtml:
+	$(MAKE) -C doc/doxyhtml doxyhtml
+.PHONY: doxyhtml
+
+octetc_DATA = NEWS
+
 DIRS_TO_MAKE = \
   $(localfcnfiledir) \
   $(localapifcnfiledir) \
--- a/NEWS
+++ b/NEWS
@@ -17,39 +17,6 @@
 Summary of important user-visible changes for version 3.8:
 ---------------------------------------------------------
 
- ** strsplit has been modified to be compatible with Matlab.  There
-    are two instances where backward compatibility is broken.
-
-    (1) Delimiters are now string vectors, not scalars.
-
-    Octave's legacy behavior
-
-      strsplit ("1 2, 3", ", ")
-      ans = 
-      {
-       [1,1] = 1
-       [1,2] = 2
-       [1,3] = 
-       [1,4] = 3
-      }
-
-    Matlab compatible behavior
-
-      strsplit ("1 2, 3", ", ")
-      ans = 
-      {
-       [1,1] = 1 2
-       [1,2] = 3
-      }
-
-    (2) By default, Matlab treats consecutive delimiters are as a single
-    delimiter.  By default, Octave's legacy behavior was to return an
-    empty string for the part between the delmiters.
-
-    Where the legacy behavior is desired, the call to strsplit() may be
-    replaced by ostrsplit(), which is Octave's original implementation of
-    strsplit().
-
  ** Octave now supports nested functions with scoping rules that are
     compatible with Matlab.  A nested function is one declared and defined
     within the body of another function.  The nested function is only
@@ -110,17 +77,22 @@
      c,...
     ] = deal (1,2,3)
 
+ ** Line continuations inside character strings have changed.
+
+    The sequence '...' is no longer recognized as a line continuations
+    are inside character strings.  A backslash followed by a newline
+    character is no longer recognized as a line continuation inside
+    single-quoted character strings.  Inside double-quoted character
+    strings, a backslash followed by a newline character is still
+    recognized as a line continuation but the backslash character must
+    be followed immediately by the newline character.  No whitespace or
+    end-of-linecomment may appear between them.
+
  ** Warning IDs renamed:
 
     Octave:array-as-scalar => Octave:array-to-scalar
     Octave:array-as-vector => Octave:array-to-vector
 
- ** The colormap function now provides new options--"list", "register",
-    and "unregister"--to list all available colormap functions, and to
-    add or remove a function name from the list of known colormap
-    functions.  Packages that implement extra colormaps should use these
-    commands with PKG_ADD and PKG_DEL statements.
-
  ** The m-files in the image directory have been overhauled.
 
     The principal benefit is that Octave will now no longer automatically
@@ -131,7 +103,48 @@
 
     Other changes include fixes to the way indexed images are read from a
     colormap depending on the image class (integer images have a -1 offset to
-    the colormap row number).
+    the colormap row number), and always returning the actual indexed image
+    with imread instead of a RGB image if the colormap was not requested
+    as output.
+
+ ** The colormap function now provides new options--"list", "register",
+    and "unregister"--to list all available colormap functions, and to
+    add or remove a function name from the list of known colormap
+    functions.  Packages that implement extra colormaps should use these
+    commands with PKG_ADD and PKG_DEL statements.
+
+ ** strsplit has been modified to be compatible with Matlab.  There
+    are two instances where backward compatibility is broken.
+
+    (1) Delimiters are now string vectors, not scalars.
+
+    Octave's legacy behavior
+
+      strsplit ("1 2, 3", ", ")
+      ans = 
+      {
+       [1,1] = 1
+       [1,2] = 2
+       [1,3] = 
+       [1,4] = 3
+      }
+
+    Matlab compatible behavior
+
+      strsplit ("1 2, 3", ", ")
+      ans = 
+      {
+       [1,1] = 1 2
+       [1,2] = 3
+      }
+
+    (2) By default, Matlab treats consecutive delimiters are as a single
+    delimiter.  By default, Octave's legacy behavior was to return an
+    empty string for the part between the delmiters.
+
+    Where the legacy behavior is desired, the call to strsplit() may be
+    replaced by ostrsplit(), which is Octave's original implementation of
+    strsplit().
 
  ** The datevec function has been extended for better Matlab compatibility.
     It now accepts string inputs in the following numerical formats: 12, 21,
@@ -175,21 +188,32 @@
       inputdlg   msgbox    warndlg
 
  ** Other new functions added in 3.8.0:
-
-      betaincinv   ellipj    findfigs     lines          strjoin
-      cmpermute    ellipke   fminsearch   polyeig        tetramesh
-      cmunique     erfcinv   gallery      rgbplot        waterfall
-      colorcube    erfi      importdata   shrinkfaces
-      dawson       expint    iscolormap   splinefit  
+                                                  
+      atan2d                      erfcinv         jit_startcnt
+      base64_decode               erfi            lines                     
+      base64_encode               expint          polyeig                   
+      betaincinv                  findfigs        prefdir                   
+      built_in_docstrings_file    flintmax        preferences               
+      cmpermute                   fminsearch      readline_re_read_init_file
+      cmunique                    gallery         readline_read_init_file   
+      colorcube                   gco             rgbplot                   
+      copyobj                     hdl2struct      save_default_options      
+      dawson                      history_save    shrinkfaces               
+      dblist                      imformats       splinefit                 
+      debug_jit                   importdata      stemleaf                  
+      doc_cache_create            iscolormap      strjoin                   
+      ellipj                      isequaln        struct2hdl                
+      ellipke                     jit_debug       tetramesh
+                                  jit_enable      waterfall                 
 
  ** Deprecated functions.
 
     The following functions were deprecated in Octave 3.4 and have been
     removed from Octave 3.8.
                                            
-      autocor    dispatch              is_global    strerror
-      autocov    fstat                 krylovb      values  
-      betai      gammai                perror               
+      autocor    dispatch              is_global    setstr
+      autocov    fstat                 krylovb      strerror
+      betai      gammai                perror       values
       cellidx    glpkmex               replot               
       cquad      is_duplicate_entry    saveimage            
       
@@ -197,15 +221,14 @@
     be removed from Octave 3.12 (or whatever version is the second major
     release after 3.8):
 
-      java_convert_matrix
-      java_debug
-      java_get
-      java_invoke
-      java_new
-      java_set
-      java_unsigned_conversion
-      javafields
-      javamethods
+      default_save_options    java_set                  
+      gen_doc_cache           java_unsigned_conversion  
+      isequalwithequalnans    javafields                
+      java_convert_matrix     javamethods               
+      java_debug              re_read_readline_init_file
+      java_get                read_readline_init_file   
+      java_invoke             saving_history            
+      java_new           
 
     The following keywords have been deprecated in Octave 3.8 and will
     be removed from Octave 3.12 (or whatever version is the second major
@@ -220,6 +243,11 @@
       CC_VERSION  (now GCC_VERSION)
       CXX_VERSION (now GXX_VERSION)
 
+    The internal class <Octave_map> has been deprecated in Octave 3.8 and will
+    be removed from Octave 3.12 (or whatever version is the second major
+    release after 3.8).  Replacement classes are <octave_map> (struct array)
+    or <octave_scalar_map> for single structure.
+
 Summary of important user-visible changes for version 3.6:
 ---------------------------------------------------------
 
--- a/configure.ac
+++ b/configure.ac
@@ -766,6 +766,11 @@
     AC_CHECK_HEADER([llvm/Support/TargetSelect.h], [
       warn_llvm=
       XTRA_CXXFLAGS="$XTRA_CXXFLAGS $LLVM_CXXFLAGS $LLVM_CPPFLAGS"])
+    OCTAVE_LLVM_IRBUILDER_HEADER
+    OCTAVE_LLVM_DATALAYOUT_HEADER
+    OCTAVE_LLVM_FUNCTION_ADDATTRIBUTE_API
+    OCTAVE_LLVM_FUNCTION_ADDFNATTR_API
+    OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API
     AC_LANG_POP(C++)
     CPPFLAGS="$save_CPPFLAGS"
     CXXFLAGS="$save_CXXFLAGS"
@@ -2527,6 +2532,7 @@
         JAVA_CPPFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32"
       fi
       JAVA_LIBS=-ladvapi32
+      LDFLAGS="$LDFLAGS -Wl,--export-all-symbols"
     ;;
     *)
       if test -n "$JAVA_CPPFLAGS"; then
@@ -2613,6 +2619,14 @@
   fi
 
   if test $build_gui = yes; then
+    OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL
+    if test $octave_cv_func_qabstractitemmodel_beginresetmodel = no; then
+      AC_MSG_WARN([QAbstractItemModel::beginResetModel() not found -- disabling GUI])
+      build_gui=no
+    fi
+  fi
+
+  if test $build_gui = yes; then
     OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT
   fi
 
@@ -2712,6 +2726,7 @@
   Makefile 
   doc/Makefile
   doc/doxyhtml/Makefile
+  doc/doxyhtml/Doxyfile
   doc/icons/Makefile
   doc/interpreter/Makefile
   doc/liboctave/Makefile
new file mode 100644
--- /dev/null
+++ b/doc/doxyhtml/Doxyfile.in
@@ -0,0 +1,320 @@
+# -*- mode: conf; -*-
+
+# Doxyfile for Doxygen 1.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for GNU Octave.
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the
+# config file that follow. We don't use anything but ASCII, but
+# there's no problem using UTF-8 from now on
+
+DOXYFILE_ENCODING      = UTF-8
+
+# Who we are. :-)
+
+PROJECT_NAME           = "GNU Octave"
+
+PROJECT_BRIEF          =  "A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab"
+
+# The public stable API version (unrelated to the internal API
+# version).
+
+PROJECT_NUMBER         = @PACKAGE_VERSION@
+
+# Our logo!
+
+PROJECT_LOGO           = @top_srcdir@/doc/icons/octave-logo.png
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+
+OUTPUT_DIRECTORY       = @abs_top_builddir@/doc
+
+# Create 4096 sub-directories (in 2 levels) under the output directory
+# of each output format and will distribute the generated files over
+# these directories. Enabling this option is useful for us, since
+# feeding doxygen a huge amount of source files would put all
+# generated files in the same directory would otherwise cause
+# performance problems for the file system.
+
+CREATE_SUBDIRS         = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written.
+
+OUTPUT_LANGUAGE        = English
+
+# Include brief member descriptions after the members that are listed
+# in the file and class documentation (similar to JavaDoc). Set to NO
+# to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# Prepend the brief description of a member or function before the
+# detailed description. Note: if both HIDE_UNDOC_MEMBERS and
+# BRIEF_MEMBER_DESC are set to NO, the brief descriptions will be
+# completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# Show inherited members as if they were part of the current class
+
+INLINE_INHERITED_MEMB  = YES
+
+# Prepend the full path before files name in the file list and in the
+# header files.
+
+FULL_PATH_NAMES        = YES
+
+# Remove from the full path names the absolute prefix
+
+STRIP_FROM_PATH        = @top_srcdir@
+
+# Interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description (without needing the @brief
+# command).
+
+JAVADOC_AUTOBRIEF      = YES
+
+# Interpret the first line (until the first dot) of a Qt-style comment
+# as the brief descriptio (without needing the \brief command).
+
+QT_AUTOBRIEF           = NO
+
+# Undocumented member inherits the documentation from any documented
+# member that it re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+# We shouldn't have any tabs in the source code to begin with, however.
+
+TAB_SIZE               = 2
+
+# Figure out C++ stdlib classes without needing to parse those files.
+
+BUILTIN_STL_SUPPORT    = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# Assume all entities in documentation are documented, even if no
+# documentation was available.
+
+EXTRACT_ALL            = YES
+
+# Include all private members of a class.
+
+EXTRACT_PRIVATE        = YES
+
+# Include  all static members of a file.
+
+EXTRACT_STATIC         = YES
+
+# Include classes (and structs) defined locally in source files in the
+# documentation.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# We have very few namespaces, so show the ones we have
+
+SHOW_NAMESPACES        = YES
+
+# We don't use namespaces, but if we did, this would extract the
+# anonymous one.
+
+EXTRACT_ANON_NSPACES   = YES
+
+# Hide internal docs, those with the \internal command.
+
+INTERNAL_DOCS          = NO
+
+# Case-sensitive filenames
+
+CASE_SENSE_NAMES       = YES
+
+# List include files with double quotes in the documentation rather
+# than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = YES
+
+# Show members alphabetically
+
+SORT_MEMBER_DOCS       = YES
+
+# Also sort the brief descriptions
+
+SORT_BRIEF_DOCS        = YES
+
+# Put ctors first.
+
+SORT_MEMBERS_CTORS_1ST = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# On by default, but let's be explicit
+
+ENABLE_PREPROCESSING   = YES
+
+# Expand the DEFUN family of macros
+
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = YES
+EXPAND_AS_DEFINED = DEFUN DEFUN_DLD  # As defined in the Octave source
+                                     # code, i.e. not overriden by this
+                                     # config file
+
+# So that features that are behind #ifdef HAVE_FOO macros get processed by Doxygen
+
+PREDEFINED = HAVE_ARPACK=1          \
+             HAVE_CHOLMOD=1         \
+             HAVE_CCOLAMD=1         \
+             HAVE_CURL=1            \
+             HAVE_CXSPARSE=1        \
+             HAVE_FFTW=1            \
+             HAVE_FFTW3=1           \
+             HAVE_FFTW3F=1          \
+             HAVE_FFTW3F_THREADS=1  \
+             HAVE_FFTW3_THREADS=1   \
+             HAVE_FREETYPE=1        \
+             HAVE_GLPK=1            \
+             HAVE_HDF5=1            \
+             HAVE_LLVM=1            \
+             HAVE_MAGICK=1          \
+             HAVE_OPENMP=1          \
+             HAVE_PCRE_H=1          \
+             HAVE_PCRE_COMPILE=1    \
+             HAVE_QHULL=1           \
+             HAVE_QRUPDATE=1        \
+             HAVE_QRUPDATE_LUU=1    \
+             HAVE_QT=1              \
+             HAVE_UMFPACK=1         \
+             HAVE_X_WINDOWS=1       \
+             HAVE_ZLIB=1
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# Which directories contain Octave source code
+
+INPUT                  = @top_srcdir@/src/ @top_srcdir@/liboctave/
+INPUT                 += @top_srcdir@/libinterp @top_srcdir@/libgui
+
+# Search subdirectories for input.
+
+RECURSIVE              = YES
+
+# Our examples.
+
+EXAMPLE_PATH           = @top_srcdir@/examples/
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# There are no extra C++ files in the examples subdir
+
+EXAMPLE_RECURSIVE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# Generate a list of source files will be generated.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Don't hide the special Doxygen comment blocks
+
+STRIP_CODE_COMMENTS    = NO
+
+# For each documented function, list all documented functions
+# referencing it.
+
+REFERENCED_BY_RELATION = YES
+
+# For each documented function all documented entities called/used by
+# that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# References link to documentation, not source code.
+
+REFERENCES_LINK_SOURCE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# Generate HTML
+
+GENERATE_HTML          = YES
+
+# i.e. @abs_top_builddir@/doc/doxyhtml
+
+HTML_OUTPUT            = doxyhtml
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# No LaTeX
+
+GENERATE_LATEX         = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# Show undocumented relations
+
+HIDE_UNDOC_RELATIONS   = NO
+
+# Use dot from graphviz to generate class diagrams.
+
+HAVE_DOT               = YES
+
+# Remove intermediate dot files.
+
+DOT_CLEANUP            = YES
+
+# Some of our dependency graphs are really huge...
+
+DOT_GRAPH_MAX_NODES    = 100
\ No newline at end of file
deleted file mode 100644
--- a/doc/doxyhtml/Doxygen.cfg
+++ /dev/null
@@ -1,267 +0,0 @@
-# -*- mode: conf; -*-
-
-# Doxyfile for Doxygen 1.7.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for GNU Octave.
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the
-# config file that follow. We don't use anything but ASCII, but
-# there's no problem using UTF-8 from now on
-
-DOXYFILE_ENCODING      = UTF-8
-
-# Who we are. :-)
-
-PROJECT_NAME           = "GNU Octave"
-
-# The public stable API version (unrelated to the internal API
-# version).
-
-PROJECT_NUMBER         = 3.7
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-
-OUTPUT_DIRECTORY       = doc/
-
-# Create 4096 sub-directories (in 2 levels) under the output directory
-# of each output format and will distribute the generated files over
-# these directories. Enabling this option is useful for us, since
-# feeding doxygen a huge amount of source files would put all
-# generated files in the same directory would otherwise cause
-# performance problems for the file system.
-
-CREATE_SUBDIRS         = YES
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written.
-
-OUTPUT_LANGUAGE        = English
-
-# Include brief member descriptions after the members that are listed
-# in the file and class documentation (similar to JavaDoc). Set to NO
-# to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# Prepend the brief description of a member or function before the
-# detailed description. Note: if both HIDE_UNDOC_MEMBERS and
-# BRIEF_MEMBER_DESC are set to NO, the brief descriptions will be
-# completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# Show inherited members as if they were part of the current class
-
-INLINE_INHERITED_MEMB  = YES
-
-# Prepend the full path before files name in the file list and in the
-# header files.
-
-FULL_PATH_NAMES        = YES
-
-# Interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description (without needing the @brief
-# command).
-
-JAVADOC_AUTOBRIEF      = YES
-
-# Interpret the first line (until the first dot) of a Qt-style comment
-# as the brief descriptio (without needing the \brief command).
-
-QT_AUTOBRIEF           = NO
-
-# Undocumented member inherits the documentation from any documented
-# member that it re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-# We shouldn't have any tabs in the source code to begin with, however.
-
-TAB_SIZE               = 2
-
-# Figure out C++ stdlib classes without needing to parse those files.
-
-BUILTIN_STL_SUPPORT    = YES
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# Assume all entities in documentation are documented, even if no
-# documentation was available.
-
-EXTRACT_ALL            = YES
-
-# Include all private members of a class.
-
-EXTRACT_PRIVATE        = YES
-
-# Include  all static members of a file.
-
-EXTRACT_STATIC         = YES
-
-# Include classes (and structs) defined locally in source files in the
-# documentation.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# We don't use namespaces, but if we did, this would extract the
-# anonymous one.
-
-EXTRACT_ANON_NSPACES   = YES
-
-# Hide internal docs, those with the \internal command.
-
-INTERNAL_DOCS          = NO
-
-# Case-sensitive filenames
-
-CASE_SENSE_NAMES       = YES
-
-# List include files with double quotes in the documentation rather
-# than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES   = YES
-
-# Show members alphabetically
-
-SORT_MEMBER_DOCS       = YES
-
-# Also sort the brief descriptions
-
-SORT_BRIEF_DOCS        = YES
-
-# Put ctors first.
-
-SORT_MEMBERS_CTORS_1ST = YES
-
-# Show which directories the file is in.
-
-SHOW_DIRECTORIES       = YES
-
-# We don't have namespaces, so don't show them.
-
-SHOW_NAMESPACES        = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# Which directories contain Octave source code
-
-INPUT                  = src/ liboctave/ libinterp/
-
-# Search subdirectories for input.
-
-RECURSIVE              = YES
-
-# Our examples.
-
-EXAMPLE_PATH           = examples/
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS       =
-
-# There are no extra C++ files in the examples subdir
-
-EXAMPLE_RECURSIVE      = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# Generate a list of source files will be generated.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = NO
-
-# Hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = YES
-
-# For each documented function, list all documented functions
-# referencing it.
-
-REFERENCED_BY_RELATION = YES
-
-# For each documented function all documented entities called/used by
-# that function will be listed.
-
-REFERENCES_RELATION    = YES
-
-# References link to documenation, not source code.
-
-REFERENCES_LINK_SOURCE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# Generate HTML
-
-GENERATE_HTML          = YES
-
-# i.e. doc/doxyhtml
-
-HTML_OUTPUT            = doxyhtml
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# No LaTeX
-
-GENERATE_LATEX         = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# Show undocumented relations
-
-HIDE_UNDOC_RELATIONS   = NO
-
-# Use dot from graphviz to generate class diagrams.
-
-HAVE_DOT               = YES
-
-# Remove intermediate dot files.
-
-DOT_CLEANUP            = YES
-
--- a/doc/doxyhtml/Makefile.am
+++ b/doc/doxyhtml/Makefile.am
@@ -21,12 +21,12 @@
 include $(top_srcdir)/build-aux/common.mk
 
 doxyhtml:
-	cd ../..; doxygen doc/doxyhtml/Doxygen.cfg 
+	doxygen Doxyfile
 
 EXTRA_DIST = \
-  Doxygen.cfg \
+  Doxyfile.in \
   Makefile.am \
   README
 
 maintainer-clean-local:
-	rm -rf `ls | $(GREP) -v Doxygen.cfg | $(GREP) -v Makefile.am | $(GREP) -v Makefile.in | $(GREP) -v README`
+	rm -rf `ls | $(GREP) -v Doxyfile | $(GREP) -v Makefile.am | $(GREP) -v Makefile.in | $(GREP) -v README`
--- a/doc/interpreter/Makefile.am
+++ b/doc/interpreter/Makefile.am
@@ -58,7 +58,6 @@
   $(top_srcdir)/examples/addtwomatrices.cc \
   $(top_srcdir)/examples/celldemo.cc \
   $(top_srcdir)/examples/embedded.cc \
-  $(top_srcdir)/examples/firstmexdemo.c \
   $(top_srcdir)/examples/fortdemo.cc \
   $(top_srcdir)/examples/fortsub.f \
   $(top_srcdir)/examples/funcdemo.cc \
@@ -67,6 +66,7 @@
   $(top_srcdir)/examples/mycell.c \
   $(top_srcdir)/examples/myfeval.c \
   $(top_srcdir)/examples/myfunc.c \
+  $(top_srcdir)/examples/myhello.c \
   $(top_srcdir)/examples/mypow2.c \
   $(top_srcdir)/examples/mysparse.c \
   $(top_srcdir)/examples/mystring.c \
@@ -125,7 +125,7 @@
   debug.texi \
   diffeq.texi \
   diagperm.texi \
-  dynamic.texi \
+  external.texi \
   emacs.texi \
   errors.texi \
   eval.texi \
--- a/doc/interpreter/arith.txi
+++ b/doc/interpreter/arith.txi
@@ -190,6 +190,7 @@
 @DOCSTRING(asind)
 @DOCSTRING(acosd)
 @DOCSTRING(atand)
+@DOCSTRING(atan2d)
 @DOCSTRING(asecd)
 @DOCSTRING(acscd)
 @DOCSTRING(acotd)
@@ -311,7 +312,7 @@
 
 @DOCSTRING(legendre)
 
-@anchor{doc-gammaln}
+@anchor{XREFgammaln}
 @DOCSTRING(lgamma)
 
 @node Rational Approximations
--- a/doc/interpreter/basics.txi
+++ b/doc/interpreter/basics.txi
@@ -67,6 +67,13 @@
 
 
 @table @code
+
+@item --built-in-docstrings-file @var{filename}
+@cindex @code{--built-in-docstrings-file @var{filename}}
+Specify the name of the file containing documentation strings for the
+built-in functions of Octave.  This value is normally correct and should
+only need to specified in extraordinary situations.
+
 @item  --debug
 @itemx -d
 @cindex @code{--debug}
@@ -75,6 +82,10 @@
 parser to print a lot of information about the commands it reads, and is
 probably only useful if you are actually trying to debug the parser.
 
+@item --debug-jit
+@cindex @code{--debug-jit}
+Enable JIT compiler debugging and tracing.
+
 @item --doc-cache-file @var{filename}
 @cindex @code{--doc-cache-file @var{filename}}
 Specify the name of the doc cache file to use.  The value of @var{filename}
@@ -143,11 +154,7 @@
 @cindex @code{-i}
 Force interactive behavior.  This can be useful for running Octave via a
 remote shell command or inside an Emacs shell buffer.  For another way
-to run Octave within Emacs, see @ref{Emacs Octave Support}.
-
-@item --jit-debug
-@cindex @code{--jit-debug}
-Enable JIT compiler debugging and tracing.
+to run Octave within Emacs, @pxref{Emacs Octave Support}.
 
 @item --line-editing
 @cindex @code{--line-editing}
@@ -185,7 +192,8 @@
 @cindex @code{--no-site-file}
 Don't read the site-wide @file{octaverc} initialization files.
 
-@item --no-window-system
+@item  --no-window-system
+@itemx -W
 @cindex @code{--no-window-system}
 Disable use of a windowing system including graphics.  This forces a
 strictly terminal-only environment.
@@ -240,7 +248,7 @@
 beep_on_error                   = true
 confirm_recursive_rmdir         = false
 crash_dumps_octave_core         = false
-default_save_options            = "-mat-binary"
+save_default_options            = "-mat-binary"
 do_braindead_shortcircuit_evaluation = true
 fixed_point_format              = true
 history_timestamp_format_string = "%%-- %D %I:%M %p --%%"
@@ -264,8 +272,8 @@
 @noindent
 Note that this does not enable the @code{Octave:matlab-incompatible}
 warning, which you might want if you want to be told about writing code
-that works in Octave but not Matlab (@pxref{doc-warning},
-@pxref{doc-warning_ids}).
+that works in Octave but not @sc{matlab} (@pxref{XREFwarning,,warning},
+@ref{XREFwarning_ids,,warning_ids}).
 
 @item  --verbose
 @itemx -V
@@ -425,13 +433,15 @@
 
 @DOCSTRING(doc_cache_file)
 
+@DOCSTRING(built_in_docstrings_file)
+
 @DOCSTRING(suppress_verbose_help_message)
 
 The following functions are principally used internally by Octave for
 generating the documentation.  They are documented here for completeness
 and because they may occasionally be useful for users.
 
-@DOCSTRING(gen_doc_cache)
+@DOCSTRING(doc_cache_create)
 
 @DOCSTRING(get_help_text)
 
@@ -712,7 +722,7 @@
 Octave also allows you customize the details of when, where, and how history
 is saved.
 
-@DOCSTRING(saving_history)
+@DOCSTRING(history_save)
 
 @DOCSTRING(history_control)
 
@@ -739,9 +749,9 @@
 Octave provides two commands for initializing Readline and thereby changing
 the command line behavior.
 
-@DOCSTRING(read_readline_init_file)
+@DOCSTRING(readline_read_init_file)
 
-@DOCSTRING(re_read_readline_init_file)
+@DOCSTRING(readline_re_read_init_file)
 
 @node Customizing the Prompt
 @subsection Customizing the Prompt
--- a/doc/interpreter/container.txi
+++ b/doc/interpreter/container.txi
@@ -38,7 +38,7 @@
 @cindex structures
 @cindex data structures
 
-Octave includes support for organizing data in structures. The current
+Octave includes support for organizing data in structures.  The current
 implementation uses an associative array with indices limited to
 strings, but the syntax is more like C-style structures.
 
@@ -392,7 +392,7 @@
 
 @noindent
 Dynamic indexing also allows you to use arbitrary strings, not merely
-valid Octave identifiers (note that this does not work on @sc{Matlab}):
+valid Octave identifiers (note that this does not work on @sc{matlab}):
 
 @example
 @group
@@ -410,7 +410,7 @@
 
 @noindent
 The warning id @code{Octave:matlab-incompatible} can be enabled to warn
-about this usage. @xref{doc-warning_ids}.
+about this usage.  @xref{XREFwarning_ids,,warning_ids}.
 
 More realistically, all of the functions that operate on strings can be used
 to build the correct field name before it is entered into the data structure.
@@ -529,7 +529,8 @@
 The simplest way to process data in a structure is within a @code{for}
 loop (@pxref{Looping Over Structure Elements}).  A similar effect can be
 achieved with the @code{structfun} function, where a user defined
-function is applied to each field of the structure.  @xref{doc-structfun}.
+function is applied to each field of the structure.
+@xref{XREFstructfun,,structfun}.
 
 Alternatively, to process the data in a structure, the structure might
 be converted to another type of container before being treated.
@@ -683,11 +684,10 @@
 @end example
 
 @noindent
-As can be seen, the @ref{doc-size, @code{size}} function also works
+As can be seen, the @ref{XREFsize,,size} function also works
 for cell arrays.  As do other functions describing the size of an
-object, such as @ref{doc-length, @code{length}}, @ref{doc-numel,
-@code{numel}}, @ref{doc-rows, @code{rows}}, and @ref{doc-columns,
-@code{columns}}.
+object, such as @ref{XREFlength,,length}, @ref{XREFnumel,, numel},
+@ref{XREFrows,,rows}, and @ref{XREFcolumns,,columns}.
 
 @DOCSTRING(cell)
 
@@ -907,7 +907,7 @@
 is to iterate through it using one or more @code{for} loops.  The same
 idea can be implemented more easily through the use of the @code{cellfun}
 function that calls a user-specified function on all elements of a cell
-array.  @xref{doc-cellfun}.
+array.  @xref{XREFcellfun,,cellfun}.
 
 An alternative is to convert the data to a different container, such as
 a matrix or a data structure.  Depending on the data this is possible
--- a/doc/interpreter/contrib.txi
+++ b/doc/interpreter/contrib.txi
@@ -41,7 +41,7 @@
 development of Octave core, i.e., code that goes to Octave directly.
 You may consider developing and publishing a package instead; a great
 place for this is the allied Octave-Forge project
-(@url{http://octave.sourceforge.net}).  Note that the Octave project is
+(@url{http://octave.sourceforge.net}).  Note that the Octave core project is
 inherently more conservative and follows narrower rules.
 
 @node Building the Development Sources
@@ -56,8 +56,8 @@
 @section Basics of Generating a Changeset
 
 The preferable form of contribution is creating a Mercurial changeset
-and submit it to the @uref{http://savannah.gnu.org/bugs/?group=octave, bug} or
-@uref{http://savannah.gnu.org/patch/?func=additem&group=octave, patch}
+and submit it to the @url{http://savannah.gnu.org/bugs/?group=octave, bug} or
+@url{http://savannah.gnu.org/patch/?func=additem&group=octave, patch}
 trackers@footnote{Please use the patch tracker only for patches which add new
 features.  If you have a patch to submit that fixes a bug, you should use the
 bug tracker instead.}.
@@ -89,7 +89,18 @@
 @end example
 
 You may want to get familiar with Mercurial queues to manage your
-changesets.  Here is a slightly more complex example using Mercurial
+changesets.  For working with queues you have to activate the extension
+@nospell{mq} with the following entry in Mercurial's configuration file
+@file{.hgrc} (or @file{Mercurial.ini} on Windows):
+
+@example
+@group
+[extensions]
+mq=
+@end group
+@end example
+
+Here is a slightly more complex example using Mercurial
 queues, where work on two unrelated changesets is done in parallel and
 one of the changesets is updated after discussion on the bug tracker:
 
@@ -122,6 +133,60 @@
 # attach ../nasty2.diff to your bug report
 @end example
 
+Mercurial has a more useful extensions that really should be enabled.
+They are not enabled by default due to a number of factors
+(mostly because they don't work in all terminal types).
+
+The following entries in the @file{.hgrc} are recommended
+
+@example
+@group
+[extensions]
+graphlog=
+color=
+progress=
+pager=
+@end group
+@end example
+
+For the color extension, default color and formatting
+of @code{hg status} can be modified by
+
+@example
+@group
+[color]
+status.modified = magenta bold
+status.added = green bold
+status.removed = red bold
+status.deleted = cyan bold
+status.unknown = black  bold
+status.ignored = black bold
+@end group
+@end example
+
+Sometimes a few further improvements for the pager extension are
+necessary.  The following options should not be enabled unless paging
+isn't working correctly:
+
+@example
+@group
+[pager]
+# Some options for the less pager, see less(1) for their meaning.
+pager = LESS='FSRX' less
+
+# Some commands that aren't paged by default; also enable paging
+# for them
+attend = tags, help, annotate, cat, diff, export, status, \
+         outgoing, incoming
+@end group
+@end example
+
+Enabling the described extensions should immediately lead to a difference
+when using the command line version of @nospell{hg}.  Of these options, the
+only one that enables a new command is @nospell{graphlog}.  It is recommanded
+that you use the command @code{hg glog} instead of @code{hg log} for a better
+feel what commits are being based on.
+
 @node General Guidelines
 @section General Guidelines
 
@@ -364,7 +429,7 @@
 @node Other Sources
 @section Other Sources
 Apart from C++ and Octave language (m-files), Octave's sources include
-files written in C, Fortran, M4, Perl, Unix shell, AWK, Texinfo and
+files written in C, Fortran, M4, Perl, Unix shell, AWK, Texinfo, and
 @TeX{}.  There are not many rules to follow when using these other
 languages; some of them are summarized below.  In any case, the golden
 rule is: if you modify a source file, try to follow any conventions you
--- a/doc/interpreter/contributors.in
+++ b/doc/interpreter/contributors.in
@@ -36,6 +36,7 @@
 Clinton Chee
 Albert Chin-A-Young
 Carsten Clark
+Catalin Codreanu
 J. D. Cole
 Martin Costabel
 Michael Creel
--- a/doc/interpreter/data.txi
+++ b/doc/interpreter/data.txi
@@ -27,10 +27,10 @@
 It is also possible to define new specialized data types by writing a
 small amount of C++ code.  On some systems, new data types can be loaded
 dynamically while Octave is running, so it is not necessary to recompile
-all of Octave just to add a new type.  @xref{Dynamically Linked
-Functions}, for more information about Octave's dynamic linking
-capabilities.  @ref{User-defined Data Types} describes what you must do
-to define a new data type for Octave.
+all of Octave just to add a new type.  @xref{External Code Interface}, for
+more information about Octave's dynamic linking capabilities.
+@ref{User-defined Data Types} describes what you must do to define a
+new data type for Octave.
 
 @DOCSTRING(typeinfo)
 
--- a/doc/interpreter/debug.txi
+++ b/doc/interpreter/debug.txi
@@ -43,7 +43,7 @@
 @section Entering Debug Mode
 
 There are two basic means of interrupting the execution of an Octave
-script.  These are breakpoints @pxref{Breakpoints}, discussed in the next
+script.  These are breakpoints (@pxref{Breakpoints}), discussed in the next
 section and interruption based on some condition.
 
 Octave supports three means to stop execution based on the values set in
@@ -91,32 +91,33 @@
 @example
 @group
 dbstop ("asind", 1)
-@result{} 28
+@result{} 29
 @end group
 @end example
 
 @noindent
-Note that the return value of @code{27} means that the breakpoint was
-effectively set to line 27.  The status of breakpoints in a function can
+Note that the return value of @code{29} means that the breakpoint was
+effectively set to line 29.  The status of breakpoints in a function can
 be queried with the @code{dbstatus} function.
 
 @DOCSTRING(dbstatus)
 
 @noindent
-Taking the above as an example, @code{dbstatus ("asind")} should return
-28.  The breakpoints can then be cleared with the @code{dbclear} function
+Reusing the previous example, @code{dbstatus ("asind")} will return
+29.  The breakpoints listed can then be cleared with the @code{dbclear}
+function.
 
 @DOCSTRING(dbclear)
 
 @noindent
-These functions can be used to clear all the breakpoints in a function.  For
-example:
+These functions can be used together to clear all the breakpoints in a
+particular function.  For example:
 
 @example
 dbclear ("asind", dbstatus ("asind"));
 @end example
 
-A breakpoint can be set in a subfunction.  For example if a file contains
+A breakpoint may also be set in a subfunction.  For example, if a file contains
 the functions
 
 @example
@@ -151,13 +152,13 @@
 
 @noindent
 The @code{keyboard} function is typically placed in a script at the
-point where the user desires that the execution is stopped.  It
+point where the user desires that the execution be stopped.  It
 automatically sets the running script into the debug mode.
 
 @node Debug Mode
 @section Debug Mode
 
-There are two additional support functions that allow the user to
+There are three additional support functions that allow the user to
 interrogate where in the execution of a script Octave entered the debug
 mode and to print the code in the script surrounding the point where
 Octave entered debug mode.
@@ -166,16 +167,23 @@
 
 @DOCSTRING(dbtype)
 
+@DOCSTRING(dblist)
+
 You may also use @code{isdebugmode} to determine whether the debugger is
 currently active.
 
 @DOCSTRING(isdebugmode)
 
 Debug mode also allows single line stepping through a function using
-the commands @code{dbstep}.
+the command @code{dbstep}.
 
 @DOCSTRING(dbstep)
 
+When in debug mode the @key{RETURN} will execute the last entered command.
+This is useful, for example, after hitting a breakpoint and entering
+@code{dbstep}.  After that one can advance line by line through the code
+with only a single key stroke.
+
 @node Call Stack
 @section Call Stack
 
@@ -233,8 +241,8 @@
 @node Profiler Example
 @section Profiler Example
 
-Below, we will give a short example of a profiler session.  See also
-@ref{Profiling} for the documentation of the profiler functions in
+Below, we will give a short example of a profiler session.
+@xref{Profiling}, for the documentation of the profiler functions in
 detail.  Consider the code:
 
 @example
--- a/doc/interpreter/diagperm.txi
+++ b/doc/interpreter/diagperm.txi
@@ -436,8 +436,7 @@
 @end example
 
 @noindent
-The same can also be accomplished with broadcasting
-(@pxref{Broadcasting}):
+The same can also be accomplished with broadcasting (@pxref{Broadcasting}):
 
 @example
 @group
@@ -519,6 +518,7 @@
 
 @item permutation matrix * matrix is equivalent to permuting rows
 @end itemize
+
 all of these natural mathematical truths would be invalidated by treating
 assumed zeros as numerical ones.
 
--- a/doc/interpreter/diffeq.txi
+++ b/doc/interpreter/diffeq.txi
@@ -69,6 +69,7 @@
 
 @example
 @group
+## oregonator differential equation
 function xdot = f (x, t)
 
   xdot = zeros (3,1);
@@ -109,6 +110,10 @@
 Solvers}, in Scientific Computing, R. S. Stepleman, editor, (1983) for
 more information about the inner workings of @code{lsode}.
 
+An m-file for the differential equation used above is included with the
+Octave distribution in the examples directory under the name
+@file{oregonator.m}.
+
 @node Differential-Algebraic Equations
 @section Differential-Algebraic Equations
 
--- a/doc/interpreter/doccheck/aspell-octave.en.pws
+++ b/doc/interpreter/doccheck/aspell-octave.en.pws
@@ -20,8 +20,11 @@
 anova
 Anymap
 API
+APIs
+appdata
 approximant
 arg
+args
 ARMA
 arpack
 ascii
@@ -49,6 +52,7 @@
 Backends
 backends
 bartlett
+BaseValue
 Bateman
 BDF
 bdf
@@ -82,6 +86,7 @@
 boxxyerrorbars
 bracketx
 brackety
+braindead
 breakpoint
 Brenan
 broadcastable
@@ -97,11 +102,10 @@
 CallbackObject
 callee's
 camd
+CancelString
 cauchy
 caxis
 ccolamd
-CCR
-CCS
 cd
 cdata
 CDF
@@ -116,6 +120,7 @@
 changesets
 Chaves
 chdir
+Chebyshev
 chisq
 chisquare
 chol
@@ -129,6 +134,7 @@
 classpath
 classpaths
 Clenshaw
+CLI
 clim
 cloglog
 clubsuit
@@ -136,6 +142,7 @@
 cmd
 cmember
 cntrl
+codebases
 cof
 coffset
 colamd
@@ -176,6 +183,7 @@
 cumprod
 cumsum
 cURL
+CurrentObject
 Cuthill
 cxsparse
 Cygwin
@@ -192,7 +200,6 @@
 davis
 ddd
 dddd
-dddddddddd
 deallocate
 deallocated
 deconv
@@ -206,18 +213,18 @@
 demi
 Demmel
 DeskJet
-Deskjet
 det
 diag
 diamondsuit
 dir
 disp
+DisplayName
+DisplayNames
 displayrange
 dMatrix
 dmperm
-DMS
-Dn
 Dobkin
+docstrings
 dOmega
 dotall
 dotexceptnewline
@@ -260,6 +267,7 @@
 equispaced
 erf
 erfc
+erfi
 errno
 Errorbar
 errorbar
@@ -290,7 +298,7 @@
 fftpack
 FFTs
 fftw
-FG
+Fiedler
 fieldname
 fieldnames
 filename
@@ -309,6 +317,7 @@
 forall
 foregroundcolor
 formfeed
+Forsythe
 Fortran
 fpdf
 fprintf
@@ -337,7 +346,6 @@
 geoinv
 geopdf
 geornd
-GEP
 geq
 gesdd
 gesvd
@@ -394,6 +402,7 @@
 Hessenberg
 heteroscedascity
 hggroup
+hggroups
 hh
 HH
 Higham
@@ -417,13 +426,12 @@
 Hyndman
 Hypergeometric
 hypergeometric
+IEC
 IEEE
 ifelse
-iff
 ifft
 ifftn
 ignorecase
-IIP
 ij
 Im
 imag
@@ -433,6 +441,7 @@
 indices
 infty
 init
+InitialValue
 inline
 Inline
 inpolygon
@@ -446,6 +455,7 @@
 Interpolants
 interquartile
 inv
+involutory
 ipermute
 ishandle
 ishghandle
@@ -458,17 +468,19 @@
 iter
 ith
 iy
+iz
 Jacobian
 Jacobians
 javaaddpath
 javamem
-ji
 JIT
 jpeg
 JPEG
 jpg
 jvm
 JVM's
+Kac
+Kahan
 keybindings
 keypress
 Kolmogorov
@@ -487,6 +499,7 @@
 laplace
 Larimore
 LaserJet
+Lauchli
 lceil
 ldiv
 ldivide
@@ -496,6 +509,7 @@
 leftarrow
 Leftrightarrow
 leftrightarrow
+Lehmer
 Lehoucq
 leq
 Levinson
@@ -515,6 +529,8 @@
 linespoints
 linkprop
 listdlg
+ListSize
+ListString
 literalspacing
 Liu
 LLVM
@@ -532,6 +548,7 @@
 Lookup
 lookups
 Los
+Lotkin
 Lovato
 lpx
 lr
@@ -594,7 +611,6 @@
 mmmm
 mmmyy
 mmmyyyy
-modelled
 Moler
 Montanet
 mpoles
@@ -608,12 +624,15 @@
 multi
 multibyte
 multiline
+multipage
 multipledelimsasone
 MultiSelect
 mxArray
 myclass
 myfun
 nabla
+namespace
+NAMESPACE
 NaN
 NaNs
 nargin
@@ -638,11 +657,13 @@
 nnls
 nnz
 nocompute
+nodither
 nolabel
 noncommercially
 nonconformant
 nonsmooth
 nonzeros
+NOP
 noperm
 normcdf
 normest
@@ -655,13 +676,13 @@
 notin
 nthargout
 NTSC
-nul
+ntsc
 Numpy
-Nx
 nzmax
 oct
 octaverc
 ODEPACK
+OKString
 OLS
 onCleanup
 online
@@ -680,6 +701,7 @@
 papersize
 paperunits
 parseparams
+Parter
 pbm
 PBM
 PBMplus
@@ -693,6 +715,7 @@
 pcx
 pdf
 PDF
+pentadiagonal
 periodogram
 perp
 Petzold's
@@ -719,6 +742,7 @@
 postorder
 PostScript
 Pothen
+powerset
 pre
 preconditioner
 premultiplied
@@ -729,6 +753,8 @@
 priori
 Profiler
 profiler
+prolate
+PromptString
 propto
 proven
 ps
@@ -736,11 +762,10 @@
 pseudonorm
 pseudorandom
 Pseudospectra
+pseudospectrum
 ptrace
 punct
-PWS
 Pxx
-Qci
 Qhull
 qhull
 QP
@@ -773,10 +798,10 @@
 Readline
 readline
 recursing
+Redheffer
 reentrant
 regex
 regressor
-reimported
 Reindent
 relicensing
 ren
@@ -793,6 +818,7 @@
 RET
 returnonerror
 rfloor
+rgb
 RGB
 Riccati
 Rightarrow
@@ -806,13 +832,11 @@
 Rossum
 rpath
 RPMs
-rr
 runtime
 sa
 Saad
 Sandia
 SAS
-sB
 Schafer
 schar
 Schur
@@ -821,6 +845,7 @@
 se
 sed
 seealso
+SelectionMode
 semidefinite
 Sep
 Shampine
@@ -886,6 +911,7 @@
 strncmpi
 strread
 strread's
+strsplit
 struct
 structs
 subarrays
@@ -936,6 +962,7 @@
 symamd
 symbfact
 symrcm
+Szego
 tcdf
 Tcv
 terminal's
@@ -944,6 +971,7 @@
 Texinfo
 TextAlphaBits
 textfield
+textread
 textscan
 th
 ths
@@ -972,6 +1000,7 @@
 triplot
 trnd
 Tsang
+Tukey
 tuples
 Tx
 txi
@@ -988,7 +1017,6 @@
 Ultrix
 umfpack
 uminus
-un
 Unary
 unary
 uncomment
@@ -1009,6 +1037,7 @@
 univariate
 unnormalized
 unpadded
+unpermuted
 unpivoted
 unregister
 unshare
@@ -1038,11 +1067,12 @@
 Villadsen
 voronoi
 Voronoi
-Wa
 waitbar
 waitbars
 wallis
 warndlg
+Wathen
+WAV
 wblcdf
 wblinv
 wblpdf
@@ -1066,7 +1096,6 @@
 windowstyle
 WinRand
 WIPO
-Wl
 wp
 wspace
 xb
@@ -1085,6 +1114,7 @@
 xPBTRF
 xPOTRF
 xPTSV
+xtest
 xTRTRS
 xu
 xwd
@@ -1104,7 +1134,6 @@
 yyyymmdd
 yyyymmddTHHMMSS
 Zechner
-zer
 Ziggurat
 zlib
 zlim
--- a/doc/interpreter/errors.txi
+++ b/doc/interpreter/errors.txi
@@ -189,7 +189,7 @@
 "Octave" is used for Octave's own errors.  Any other string is available
 as a namespace for user's own errors.
 
-The next example counts indexing errors. The errors are catched using the
+The next example counts indexing errors.  The errors are caught using the
 field identifier of the structure returned by the function @code{lasterror}.
 
 @example
--- a/doc/interpreter/eval.txi
+++ b/doc/interpreter/eval.txi
@@ -79,8 +79,8 @@
 functions and should not be taken too seriously.  In addition to using a
 more robust algorithm, any serious code would check the number and type
 of all the arguments, ensure that the supplied function really was a
-function, etc.  @xref{Predicates for Numeric Objects}, for example,
-for a list of predicates for numeric objects, and see @ref{Status of
+function, etc.  @xref{Predicates for Numeric Objects},
+for a list of predicates for numeric objects, and @pxref{Status of
 Variables}, for a description of the @code{exist} function.
 
 @DOCSTRING(feval)
--- a/doc/interpreter/expr.txi
+++ b/doc/interpreter/expr.txi
@@ -768,7 +768,7 @@
 
 For complex numbers, the following ordering is defined:
 @var{z1} < @var{z2}
-iff
+if and only if
 
 @example
 @group
@@ -796,7 +796,7 @@
 
 @DOCSTRING(isequal)
 
-@DOCSTRING(isequalwithequalnans)
+@DOCSTRING(isequaln)
 
 @opindex <=
 @DOCSTRING(le)
rename from doc/interpreter/dynamic.txi
rename to doc/interpreter/external.txi
--- a/doc/interpreter/dynamic.txi
+++ b/doc/interpreter/external.txi
@@ -17,50 +17,91 @@
 @c along with Octave; see the file COPYING.  If not, see
 @c <http://www.gnu.org/licenses/>.
 
-@node Dynamically Linked Functions
-@appendix Dynamically Linked Functions
+@node External Code Interface
+@appendix External Code Interface
 @cindex dynamic-linking
+@cindex Dynamically Linked Functions
+@cindex Octave API
+
+“The sum of human wisdom is not contained in any one language"
+  ---Ezra Pound
 
-Octave has the possibility of including compiled code as dynamically
-linked extensions and then using these extensions as if they were part
-of Octave itself.  Octave can call C++ code
-through its native oct-file interface or C code through its mex
-interface.  It can also indirectly call functions written in any other
-language through a simple wrapper.  The reasons to write code in a
-compiled language might be either to link to an existing piece of code
-and allow it to be used within Octave, or to allow improved performance
-for key pieces of code.
+Octave is a fantastic language for solving many problems in science and
+engineering.  However, it is not the only computer language and there
+are times when you may want to use code written in other languages.
+Good reasons for doing so include: 1) not re-inventing the wheel; existing
+function libraries which have been thoroughly tested and debugged or
+large scale simulation codebases are a good example, 2) accessing unique
+capabilities of a different language; for example the well-known regular
+expression functions of Perl (but don't do that because @code{regexp}
+already exists in Octave).
 
-Before going further, you should first determine if you really need to
-use dynamically linked functions at all.  Before proceeding with writing
-any dynamically linked function to improve performance you should
-address ask yourself
+Performance should generally @strong{not} be a reason for using compiled
+extensions.  Although compiled extensions can run faster, particularly
+if they replace a loop in Octave code, this is almost never the best path
+to take.  First, there are many techniques to speed up Octave performance while
+remaining within the language.  Second, Octave is a high-level language that
+makes it easy to perform common mathematical tasks.  Giving that up means
+shifting the focus from solving the real problem to solving a computer
+programming problem.  It means returning to low-level constructs such as
+pointers, memory management, mathematical overflow/underflow, etc.  Because
+of the low level nature, and the fact that the compiled code is executed outside
+of Octave, there is the very real possibility of crashing the interpreter and
+losing work.
+
+Before going further, you should first determine if you really need to bother
+writing code outside of Octave.
 
 @itemize @bullet
 @item
-Can I get the same functionality using the Octave scripting language only?
+Can I get the same functionality using the Octave scripting language alone?
+
+Even when a function already exists outside the language, it may be
+better to simply reproduce the behavior in an m-file rather than attempt to
+interface to the outside code.
 
 @item
-Is it thoroughly optimized Octave code?  Vectorization of Octave code,
-doesn't just make it concise, it generally significantly improves its
-performance.  Above all, if loops must be used, make sure that the
-allocation of space for variables takes place outside the loops using an
-assignment to a matrix of the right size, or zeros.
+Is the code thoroughly optimized for Octave?
+
+If performance is an issue you should always start with the in-language
+techniques for getting better performance.  Chief among these is vectorization
+(@pxref{Vectorization and Faster Code Execution}) which not only makes the
+code concise and more understandable but improves performance (10X-100X).
+If loops must be used, make sure that the allocation of space for variables
+takes place outside the loops using an assignment to a matrix of the right
+size, or zeros.
 
 @item
-Does it make as much use as possible of existing built-in library
-routines?  These are highly optimized and many do not carry the overhead
+Does the code make as much use as possible of existing built-in library
+routines?
+
+These routines are highly optimized and many do not carry the overhead
 of being interpreted.
 
 @item
-Does writing a dynamically linked function represent useful investment
+Does writing a dynamically linked function represent a useful investment
 of your time, relative to staying in Octave?
+
+It will take time to learn Octave's interface for external code and
+there will inevitably be issues with tools such as compilers.
 @end itemize
 
-Also, as oct- and mex-files are dynamically linked to Octave, they
-introduce the possibility of Octave crashing due to errors in
-the user code.  For example a segmentation violation in the user's code
-will cause Octave to abort.
+With that said, Octave offers a versatile interface for including chunks
+of compiled code as dynamically linked extensions.  These dynamically linked
+functions can be called from the interpreter in the same manner as any
+ordinary function.  The interface is bi-directional and external code can
+call Octave functions (like @code{plot}) which otherwise might be very
+difficult to develop.
+
+The interface is centered around supporting the languages C++, C, and Fortran.
+Octave itself is written in C++ and can call external C++/C code through its
+native oct-file interface.  The C language is also supported through the
+mex-file interface for compatibility with @sc{matlab}.  Fortran code is easiest
+to reach through the oct-file interface.
+
+Because many other languages provide C or C++ APIs it is relatively simple
+to build bridges between Octave and other languages.  This is also a way to
+bridge to hardware resources which often have device drivers written in C.
 
 @menu
 * Oct-Files::                   
@@ -94,12 +135,19 @@
 @node Getting Started with Oct-Files
 @subsection Getting Started with Oct-Files
 
-The basic command to build oct-files is @code{mkoctfile} and it can be
-call from within octave or from the command line.
+Oct-files are pieces of C++ code that have been compiled with the Octave
+API into a dynamically loadable object.  They take their name from the file
+which contains the object which has the extension @file{.oct}.
+
+Finding a C++ compiler, using the correct switches, adding the right include
+paths for header files, etc. is a difficult task.  Octave automates this by
+providing the @code{mkoctfile} command with which to build oct-files.  The
+command is available from within Octave or at the shell command line.
 
 @DOCSTRING(mkoctfile)
 
-Consider the short C++ example:
+Consider the following short example which introduces the basics of
+writing a C++ function that can be linked to Octave.
 
 @example
 @group
@@ -107,17 +155,14 @@
 @end group
 @end example
 
-This example although short introduces the basics of writing a C++
-function that can be dynamically linked to Octave.  The easiest way to
-make available most of the definitions that might be necessary for a C++
-oct-file in Octave is to use the @code{#include <octave/oct.h>} header.
+The first critical line is @code{#include <octave/oct.h>} which 
+makes available most of the definitions necessary for a C++ oct-file.
 Note that @file{octave/oct.h} is a C++ header and cannot be directly
-@code{#include}'ed in a C source file, nor any other language.  What
-follows is mostly C++, with a discussion of other languages in section
-@ref{Calling External Code from Oct-Files}.
+@code{#include}'ed in a C source file, nor any other language.
 
-The macro that defines the entry point into the dynamically loaded
-function is @w{@code{DEFUN_DLD}}.  This macro takes four arguments, these being
+Included by @file{oct.h} is a definition for the macro
+@w{@code{DEFUN_DLD}} which creates a dynamically loaded function.  This
+macro takes four arguments:
 
 @enumerate 1
 @item The function name as it will be seen in Octave,
@@ -127,36 +172,35 @@
 @item The number of output arguments, which can and often is omitted if
 not used, and
 
-@item The string that will be seen as the help text of the function.
+@item The string to use for the help text of the function.
 @end enumerate
 
 The return type of functions defined with @w{@code{DEFUN_DLD}} is always
 @code{octave_value_list}.
 
 There are a couple of important considerations in the choice of function
-name.  Firstly, it must be a valid Octave function name and so must be a
-sequence of letters, digits and underscores, not starting with a
-digit.  Secondly, as Octave uses the function name to define the filename
+name.  First, it must be a valid Octave function name and so must be a
+sequence of letters, digits, and underscores not starting with a
+digit.  Second, as Octave uses the function name to define the filename
 it attempts to find the function in, the function name in the
 @w{@code{DEFUN_DLD}} macro must match the filename of the oct-file.  Therefore,
-the above function should be in a file @file{helloworld.cc}, and it should be
+the above function should be in a file @file{helloworld.cc}, and would be
 compiled to an oct-file using the command
 
 @example
 mkoctfile helloworld.cc
 @end example
 
-This will create a file called @file{helloworld.oct}, that is the compiled
+This will create a file called @file{helloworld.oct} that is the compiled
 version of the function.  It should be noted that it is perfectly
 acceptable to have more than one @w{@code{DEFUN_DLD}} function in a source
 file.  However, there must either be a symbolic link to the oct-file for
 each of the functions defined in the source code with the @w{@code{DEFUN_DLD}}
-macro or the autoload (@ref{Function Files}) function should be used.
+macro or the @code{autoload} (@ref{Function Files}) function should be used.
 
-The rest of this function then shows how to find the number of input
-arguments, how to print through the octave pager, and return from the
-function.  After compiling this function as above, an example of its use
-is
+The rest of the function shows how to find the number of input arguments,
+how to print through the Octave pager, and return from the function.  After
+compiling this function as above, an example of its use is
 
 @example
 @group
@@ -165,6 +209,13 @@
 @end group
 @end example
 
+Subsequent sections show how to use specific classes from Octave's core
+internals.  Base classes like dMatrix (a matrix of double values) are
+found in the directory @file{liboctave/array}.  The definitive reference for
+how to use a particular class is the header file itself.  However, it is
+often enough just to study the examples in the manual in order to be able
+to use the class.
+
 @node Matrices and Arrays in Oct-Files
 @subsection Matrices and Arrays in Oct-Files
 
@@ -175,18 +226,17 @@
 
 @table @code
 @item Matrix
-A double precision matrix class defined in dMatrix.h,
+A double precision matrix class defined in @file{dMatrix.h},
 
 @item ComplexMatrix
-A complex matrix class defined in CMatrix.h, and
+A complex matrix class defined in @file{CMatrix.h}, and
 
 @item BoolMatrix
-A boolean matrix class defined in boolMatrix.h.
+A boolean matrix class defined in @file{boolMatrix.h}.
 @end table
 
-These are the basic two-dimensional matrix types of octave.  In
-additional there are a number of multi-dimensional array types, these
-being
+These are the basic two-dimensional matrix types of Octave.  In
+addition there are a number of multi-dimensional array types including
 
 @table @code
 @item NDArray
@@ -198,49 +248,48 @@
 @item boolNDArray
 A boolean array class defined in @file{boolNDArray.h}
 
-@item int8NDArray
+@item  int8NDArray
 @itemx int16NDArray
 @itemx int32NDArray
 @itemx int64NDArray
-8, 16, 32 and 64-bit signed array classes defined in
+8, 16, 32, and 64-bit signed array classes defined in
 @file{int8NDArray.h}, @file{int16NDArray.h}, etc.
 
-@item uint8NDArray
+@item  uint8NDArray
 @itemx uint16NDArray
 @itemx uint32NDArray
 @itemx uint64NDArray
-8, 16, 32 and 64-bit unsigned array classes defined in
+8, 16, 32, and 64-bit unsigned array classes defined in
 @file{uint8NDArray.h}, @file{uint16NDArray.h}, etc.
 @end table
 
-There are several basic means of constructing matrices of
-multi-dimensional arrays.  Considering the @code{Matrix} type as an
-example
+There are several basic ways of constructing matrices or
+multi-dimensional arrays.  Using the class @code{Matrix} as an example
+one can
 
 @itemize @bullet
 @item
-We can create an empty matrix or array with the empty constructor.  For
-example
+Create an empty matrix or array with the empty constructor.  For example:
 
 @example
 Matrix a;
 @end example
 
-This can be used on all matrix and array types
+This can be used for all matrix and array types.
 
 @item
-Define the dimensions of the matrix or array with a dim_vector.  For
-example
+Define the dimensions of the matrix or array with a dim_vector which has
+the same characteristics as the vector returned from @code{size}.  For example:
 
 @example
 @group
 dim_vector dv (2);
-dv(0) = 2; dv(1) = 2;
+dv(0) = 2; dv(1) = 3;  // 2 rows, 3 columns
 Matrix a (dv);
 @end group
 @end example
 
-This can be used on all matrix and array types
+This can be used on all matrix and array types.
 
 @item
 Define the number of rows and columns in the matrix.  For example:
@@ -249,11 +298,12 @@
 Matrix a (2, 2)
 @end example
 
-However, this constructor can only be used with the matrix types.
+However, this constructor can only be used with matrix types.
 @end itemize
 
-These types all share a number of basic methods and operators, a
-selection of which include
+These types all share a number of basic methods and operators.  Many bear
+a resemblance to functions that exist in the interpreter.  A selection of
+useful methods include
 
 @deftypefn  Method T& {operator ()} (octave_idx_type)
 @deftypefnx Method T& elem (octave_idx_type)
@@ -269,7 +319,7 @@
 circumstances the user might prefer to access the data of the array or
 matrix directly through the @nospell{fortran_vec} method discussed below.
 
-@deftypefn Method octave_idx_type nelem (void) const
+@deftypefn Method octave_idx_type numel (void) const
 The total number of elements in the matrix or array.
 @end deftypefn
 
@@ -281,6 +331,11 @@
 The dimensions of the matrix or array in value of type dim_vector.
 @end deftypefn
 
+@deftypefn Method int ndims (void) const
+The number of dimensions of the matrix or array.  Matrices are 2-D,
+but arrays can be N-dimensional.
+@end deftypefn
+
 @deftypefn Method void resize (const dim_vector&)
 A method taking either an argument of type @code{dim_vector}, or in the
 case of a matrix two arguments of type @code{octave_idx_type} defining
@@ -288,14 +343,14 @@
 @end deftypefn
 
 @deftypefn Method T* fortran_vec (void)
-This method returns a pointer to the underlying data of the matrix or a
+This method returns a pointer to the underlying data of the matrix or
 array so that it can be manipulated directly, either within Octave or by
 an external library.
 @end deftypefn
 
 Operators such an @code{+}, @code{-}, or @code{*} can be used on the
-majority of the above types.  In addition there are a number of methods
-that are of interest only for matrices such as @code{transpose},
+majority of the matrix and array types.  In addition there are a number of
+methods that are of interest only for matrices such as @code{transpose},
 @code{hermitian}, @code{solve}, etc.
 
 The typical way to extract a matrix or array from the input arguments of
@@ -307,7 +362,7 @@
 @end group
 @end example
 
-To avoid segmentation faults causing Octave to abort, this function
+To avoid segmentation faults causing Octave to abort this function
 explicitly checks that there are sufficient arguments available before
 accessing these arguments.  It then obtains two multi-dimensional arrays
 of type @code{NDArray} and adds these together.  Note that the array_value
@@ -320,22 +375,22 @@
 
 @code{A + B}, operating on two @code{NDArray}'s returns an
 @code{NDArray}, which is cast to an @code{octave_value} on the return
-from the function.  An example of the use of this demonstration function
-is
+from the function.  An example of the use of this demonstration function is
 
 @example
 @group
-addtwomatrices (ones (2, 2), ones (2, 2))
-      @result{}  2  2
-          2  2
+addtwomatrices (ones (2, 2), eye (2, 2))
+      @result{}  2  1
+          1  2
 @end group
 @end example
 
 A list of the basic @code{Matrix} and @code{Array} types, the methods to
-extract these from an @code{octave_value} and the associated header is
+extract these from an @code{octave_value}, and the associated header file is
 listed below.
 
 @multitable @columnfractions .3 .4 .3
+@headitem Type @tab Function @tab Source Code
 @item @code{RowVector} @tab @code{row_vector_value} @tab @file{dRowVector.h}
 @item @code{ComplexRowVector} @tab @code{complex_row_vector_value} @tab @file{CRowVector.h}
 @item @code{ColumnVector} @tab @code{column_vector_value} @tab @file{dColVector.h}
@@ -361,7 +416,7 @@
 @node Character Strings in Oct-Files
 @subsection Character Strings in Oct-Files
 
-In Octave a character string is just a special @code{Array} class.
+A character string in Octave is just a special @code{Array} class.
 Consider the example:
 
 @example
@@ -389,20 +444,19 @@
 
 One additional complication of strings in Octave is the difference
 between single quoted and double quoted strings.  To find out if an
-@code{octave_value} contains a single or double quoted string an example is
+@code{octave_value} contains a single or double quoted string use
+one of the predicate tests shown below.
 
 @example
 @group
-    if (args(0).is_sq_string ())
-      octave_stdout << 
-        "First argument is a singularly quoted string\n";
-    else if (args(0).is_dq_string ())
-      octave_stdout << 
-        "First argument is a doubly quoted string\n";
+if (args(0).is_sq_string ())
+  octave_stdout << "First argument is a single quoted string\n";
+else if (args(0).is_dq_string ())
+  octave_stdout << "First argument is a double quoted string\n";
 @end group
 @end example
 
-Note however, that both types of strings are represented by the
+Note, however, that both types of strings are represented by the
 @code{charNDArray} type, and so when assigning to an
 @code{octave_value}, the type of string should be specified.  For example:
 
@@ -412,19 +466,21 @@
 charNDArray c;
 @dots{}
 // Create single quoted string
-retval(1) = octave_value (ch, true, '\'');
+retval(1) = octave_value (ch);        // default constructor is sq_string
+           OR
+retval(1) = octave_value (ch, '\'');  // explicitly create sq_string
 
 // Create a double quoted string
-retval(0) = octave_value (ch, true);
+retval(0) = octave_value (ch, '"');
 @end group
 @end example
 
 @node Cell Arrays in Oct-Files
 @subsection Cell Arrays in Oct-Files
 
-Octave's cell type is equally accessible within oct-files.  A cell
-array is just an array of @code{octave_value}s, and so each element of the cell
-array can then be treated just like any other @code{octave_value}.  A simple
+Octave's cell type is also available from within oct-files.  A cell
+array is just an array of @code{octave_value}s, and thus each element of the
+cell array can be treated just like any other @code{octave_value}.  A simple
 example is
 
 @example
@@ -434,9 +490,9 @@
 @end example
 
 Note that cell arrays are used less often in standard oct-files and so
-the @file{Cell.h} header file must be explicitly included.  The rest of this
+the @file{Cell.h} header file must be explicitly included.  The rest of the
 example extracts the @code{octave_value}s one by one from the cell array and
-returns be as individual return arguments.  For example consider
+returns them as individual return arguments.  For example:
 
 @example
 @group
@@ -454,9 +510,9 @@
 @node Structures in Oct-Files
 @subsection Structures in Oct-Files
 
-A structure in Octave is map between a number of fields represented and
+A structure in Octave is a map between a number of fields represented and
 their values.  The Standard Template Library @code{map} class is used,
-with the pair consisting of a @code{std::string} and an octave
+with the pair consisting of a @code{std::string} and an Octave
 @code{Cell} variable.
 
 A simple example demonstrating the use of structures within oct-files is
@@ -475,28 +531,31 @@
 @end group
 @end example
 
-The commented code above demonstrates how to iterate over all of the
-fields of the structure, where as the following code demonstrates finding
-a particular field in a more concise manner.
-
-As can be seen the @code{contents} method of the @code{Octave_map} class
-returns a @code{Cell} which allows structure arrays to be represented.
-Therefore, to obtain the underlying @code{octave_value} we write
+The example above specifically uses the @code{octave_scalar_map} class which
+is for representing a single struct.  For structure arrays the
+@code{octave_map} class is used instead.  The commented code shows how the
+demo could be modified to handle a structure array.  In that case the
+@code{contents} method returns a @code{Cell} which may have more than one
+element.  Therefore, to obtain the underlying @code{octave_value} in
+this single-struct example we write
 
 @example
-octave_value tmp = arg0.contents (p1) (0);
+octave_value tmp = arg0.contents (arg1)(0);
 @end example
 
 @noindent
-where the trailing (0) is the () operator on the @code{Cell} object.  We
-can equally iterate of the elements of the Cell array to address the
-elements of the structure array.
+where the trailing (0) is the () operator on the @code{Cell} object.  If
+this were a true structure array with multiple elements we could iterate
+over the elements using the () operator.
+
+Structures are a relatively complex data container and there are more
+functions available in @file{oct-map.h} which make coding with them easier
+than relying on just @code{contents}.
 
 @node Sparse Matrices in Oct-Files
 @subsection Sparse Matrices in Oct-Files
 
-There are three classes of sparse objects that are of interest to the
-user.
+There are three classes of sparse objects that are of interest to the user.
 
 @table @code
 @item SparseMatrix
@@ -511,19 +570,18 @@
 
 All of these classes inherit from the @code{Sparse<T>} template class,
 and so all have similar capabilities and usage.  The @code{Sparse<T>}
-class was based on Octave @code{Array<T>} class, and so users familiar
+class was based on Octave's @code{Array<T>} class, and so users familiar
 with Octave's @code{Array} classes will be comfortable with the use of
 the sparse classes.
 
 The sparse classes will not be entirely described in this section, due
 to their similarity with the existing @code{Array} classes.  However,
 there are a few differences due the different nature of sparse objects,
-and these will be described.  Firstly, although it is fundamentally
+and these will be described.  First, although it is fundamentally
 possible to have N-dimensional sparse objects, the Octave sparse classes do
-not allow them at this time.  So all operations of the sparse classes
-must be 2-dimensional.  This means that in fact @code{SparseMatrix} is
-similar to Octave's @code{Matrix} class rather than its
-@code{NDArray} class.
+not allow them at this time; All instances of the sparse classes
+must be 2-dimensional.  This means that @code{SparseMatrix} is actually
+more similar to Octave's @code{Matrix} class than its @code{NDArray} class.
 
 @menu
 * Array and Sparse Differences::  
@@ -571,8 +629,7 @@
 @dots{}
 for (int j = 0; j < nc; j++)
   for (int i = 0; i < nr; i++)
-    std::cerr << " (" << i << "," << j << "): " << sm(i,j)
-              << std::endl;
+    std::cerr << " (" << i << "," << j << "): " << sm(i,j) << std::endl;
 @end group
 @end example
 
@@ -594,32 +651,30 @@
 const SparseMatrix tmp (sm);
 for (int j = 0; j < nc; j++)
   for (int i = 0; i < nr; i++)
-    std::cerr << " (" << i << "," << j << "): " << tmp(i,j)
-              << std::endl;
+    std::cerr << " (" << i << "," << j << "): " << tmp(i,j) << std::endl;
 @end group
 @end example
 
-Finally, as the sparse types aren't just represented as a contiguous
+Finally, as the sparse types aren't represented by a contiguous
 block of memory, the @nospell{@code{fortran_vec}} method of the @code{Array<T>}
-is not available.  It is however replaced by three separate methods
+is not available.  It is, however, replaced by three separate methods
 @code{ridx}, @code{cidx} and @code{data}, that access the raw compressed
-column format that the Octave sparse matrices are stored in.
-Additionally, these methods can be used in a manner similar to @code{elem},
-to allow the matrix to be accessed or filled.  However, in that case it is
-up to the user to respect the sparse matrix compressed column format
-discussed previous.
+column format that Octave sparse matrices are stored in.  These methods can be
+used in a manner similar to @code{elem} to allow the matrix to be accessed or
+filled.  However, in that case it is up to the user to respect the sparse
+matrix compressed column format.
 
 @node Creating Sparse Matrices in Oct-Files
 @subsubsection Creating Sparse Matrices in Oct-Files
 
-You have several alternatives for creating a sparse matrix.
-You can first create the data as three vectors representing the
-row and column indexes and the data, and from those create the matrix.
-Or alternatively, you can create a sparse matrix with the appropriate
+There are several useful alternatives for creating a sparse matrix.
+The first is to create three vectors representing the row index, column index,
+and data values, and from these create the matrix.
+The second alternative is to create a sparse matrix with the appropriate
 amount of space and then fill in the values.  Both techniques have their
 advantages and disadvantages.
 
-Here is an example of how to create a small sparse matrix with the first
+Below is an example of creating a small sparse matrix using the first
 technique
 
 @example
@@ -630,10 +685,10 @@
 ColumnVector cidx (nz);
 ColumnVector data (nz);
 
-ridx(0) = 0; ridx(1) = 0; ridx(2) = 1; ridx(3) = 2;
-cidx(0) = 0; cidx(1) = 1; cidx(2) = 3; cidx(3) = 3;
-data(0) = 1; data(1) = 2; data(2) = 3; data(3) = 4;
-
+ridx(0) = 0; cidx(0) = 0; data(0) = 1; 
+ridx(1) = 0; cidx(1) = 1; data(1) = 2; 
+ridx(2) = 1; cidx(2) = 3; data(2) = 3; 
+ridx(3) = 2; cidx(3) = 3; data(3) = 4;
 SparseMatrix sm (data, ridx, cidx, nr, nc);
 @end group
 @end example
@@ -642,21 +697,21 @@
 which creates the matrix given in section
 @ref{Storage of Sparse Matrices}.  Note that the compressed matrix
 format is not used at the time of the creation of the matrix itself,
-however it is used internally.
+but is used internally.
 
-As previously mentioned, the values of the sparse matrix are stored
-in increasing column-major ordering.  Although the data passed by the
-user does not need to respect this requirement, the pre-sorting the
-data significantly speeds up the creation of the sparse matrix.
+As discussed in the chapter on Sparse Matrices, the values of the sparse
+matrix are stored in increasing column-major ordering.  Although the data
+passed by the user need not respect this requirement, pre-sorting the
+data will significantly speed up creation of the sparse matrix.
 
-The disadvantage of this technique of creating a sparse matrix is
-that there is a brief time where two copies of the data exists.  Therefore
-for extremely memory constrained problems this might not be the right
-technique to create the sparse matrix.
+The disadvantage of this technique for creating a sparse matrix is
+that there is a brief time when two copies of the data exist.  For
+extremely memory constrained problems this may not be the best
+technique for creating a sparse matrix.
 
-The alternative is to first create the sparse matrix with the desired
-number of non-zero elements and then later fill those elements in.  The
-easiest way to do this is
+The alternative is to first create a sparse matrix with the desired
+number of non-zero elements and then later fill those elements in.
+Sample code:
 
 @example
 @group
@@ -666,17 +721,16 @@
 @end group
 @end example
 
-That creates the same matrix as previously.  Again, although it is not
+This creates the same matrix as previously.  Again, although not
 strictly necessary, it is significantly faster if the sparse matrix is
-created in this manner that the elements are added in column-major
-ordering.  The reason for this is that if the elements are inserted
-at the end of the current list of known elements then no element
-in the matrix needs to be moved to allow the new element to be
-inserted.  Only the column indexes need to be updated.
+created and the elements are added in column-major ordering.  The reason
+for this is that when elements are inserted at the end of the current list
+of known elements then no element in the matrix needs to be moved to allow
+the new element to be inserted; Only the column indexes need to be updated.
 
-There are a few further points to note about this technique of creating
-a sparse matrix.  Firstly, it is possible to create a sparse matrix
-with fewer elements than are actually inserted in the matrix.  Therefore
+There are a few further points to note about this method of creating
+a sparse matrix.  First, it is possible to create a sparse matrix
+with fewer elements than are actually inserted in the matrix.  Therefore,
 
 @example
 @group
@@ -687,57 +741,52 @@
 @end example
 
 @noindent 
-is perfectly valid.  However it is a very bad idea.  The reason is that
-as each new element is added to the sparse matrix the space allocated
-to it is increased by reallocating the memory.  This is an expensive
-operation, that will significantly slow this means of creating a sparse
-matrix.  Furthermore, it is possible to create a sparse matrix with
-too much storage, so having @var{nz} above equaling 6 is also valid.
-The disadvantage is that the matrix occupies more memory than strictly
-needed.
+is perfectly valid.  However, it is a very bad idea because as each new
+element is added to the sparse matrix the matrix needs to request more
+space and reallocate memory.  This is an expensive operation, that will
+significantly slow this means of creating a sparse matrix.  Furthermore,
+it is possible to create a sparse matrix with too much storage, so having
+@var{nz} greater than 4 is also valid.  The disadvantage is that the matrix
+occupies more memory than strictly needed.
 
-It is not always easy to know the number of non-zero elements prior
-to filling a matrix.  For this reason the additional storage for the
-sparse matrix can be removed after its creation with the
-@dfn{maybe_compress} function.  Furthermore, the maybe_compress can
-deallocate the unused storage, but it can equally remove zero elements
+It is not always possible to know the number of non-zero elements prior
+to filling a matrix.  For this reason the additional unused storage of 
+a sparse matrix can be removed after its creation with the
+@code{maybe_compress} function.  In addition, @code{maybe_compress} can
+deallocate the unused storage, but it can also remove zero elements
 from the matrix.  The removal of zero elements from the matrix is
-controlled by setting the argument of the @dfn{maybe_compress} function
-to be @samp{true}.  However, the cost of removing the zeros is high because it
-implies resorting the elements.  Therefore, if possible it is better
-is the user doesn't add the zeros in the first place.  An example of
-the use of @dfn{maybe_compress} is
+controlled by setting the argument of the @code{maybe_compress} function
+to be @code{true}.  However, the cost of removing the zeros is high because it
+implies re-sorting the elements.  If possible, it is better
+if the user does not add the unnecessary zeros in the first place.
+An example of the use of @code{maybe_compress} is
 
 @example
 @group
-  int nz = 6, nr = 3, nc = 4;
+int nz = 6, nr = 3, nc = 4;
 
-  SparseMatrix sm1 (nr, nc, nz);
-  sm1(0,0) = 1; sm1(0,1) = 2; sm1(1,3) = 3; sm1(2,3) = 4;
-  sm1.maybe_compress ();  // No zero elements were added
+SparseMatrix sm1 (nr, nc, nz);
+sm1(0,0) = 1; sm1(0,1) = 2; sm1(1,3) = 3; sm1(2,3) = 4;
+sm1.maybe_compress ();  // No zero elements were added
 
-  SparseMatrix sm2 (nr, nc, nz);
-  sm2(0,0) = 1; sm2(0,1) = 2; sm(0,2) = 0; sm(1,2) = 0;
-  sm1(1,3) = 3; sm1(2,3) = 4;
-  sm2.maybe_compress (true);  // Zero elements were added
+SparseMatrix sm2 (nr, nc, nz);
+sm2(0,0) = 1; sm2(0,1) = 2; sm(0,2) = 0; sm(1,2) = 0;
+sm1(1,3) = 3; sm1(2,3) = 4;
+sm2.maybe_compress (true);  // Zero elements were added
 @end group
 @end example
 
-The use of the @dfn{maybe_compress} function should be avoided if
-possible, as it will slow the creation of the matrices.
+The use of the @code{maybe_compress} function should be avoided if
+possible as it will slow the creation of the matrix.
 
 A third means of creating a sparse matrix is to work directly with
 the data in compressed row format.  An example of this technique might
 be
 
-@c Note the @verbatim environment is a relatively new addition to Texinfo.
-@c Therefore use the @example environment and replace @, with @@,
-@c { with @{, etc
-
 @example
 octave_value arg;
 @dots{}
-int nz = 6, nr = 3, nc = 4;   // Assume we know the max no nz
+int nz = 6, nr = 3, nc = 4;   // Assume we know the max # nz
 SparseMatrix sm (nr, nc, nz);
 Matrix m = arg.matrix_value ();
 
@@ -757,12 +806,11 @@
       @}
     sm.cidx(j+1) = ii;
  @}
-sm.maybe_compress ();  // If don't know a-priori 
-                       // the final no of nz.
+sm.maybe_compress ();  // If don't know a-priori the final # of nz.
 @end example
 
 @noindent
-which is probably the most efficient means of creating the sparse matrix.
+which is probably the most efficient means of creating a sparse matrix.
 
 Finally, it might sometimes arise that the amount of storage initially
 created is insufficient to completely store the sparse matrix.  Therefore,
@@ -772,7 +820,7 @@
 @example
 octave_value arg;
 @dots{}
-int nz = 6, nr = 3, nc = 4;   // Assume we know the max no nz
+int nz = 6, nr = 3, nc = 4;   // Assume we know the max # nz
 SparseMatrix sm (nr, nc, nz);
 Matrix m = arg.matrix_value ();
 
@@ -797,23 +845,22 @@
       @}
     sm.cidx(j+1) = ii;
  @}
-sm.maybe_mutate ();  // If don't know a-priori 
-                     // the final no of nz.
+sm.maybe_mutate ();  // If don't know a-priori the final # of nz.
 @end example
 
 Note that both increasing and decreasing the number of non-zero elements in
-a sparse matrix is expensive, as it involves memory reallocation.  Also as
-parts of the matrix, though not its entirety, exist as the old and new copy
-at the same time, additional memory is needed.  Therefore if possible this
+a sparse matrix is expensive as it involves memory reallocation.  Also as
+parts of the matrix, though not its entirety, exist as old and new copies
+at the same time, additional memory is needed.  Therefore, if possible this
 should be avoided.
 
 @node Using Sparse Matrices in Oct-Files
 @subsubsection Using Sparse Matrices in Oct-Files
 
 Most of the same operators and functions on sparse matrices that are
-available from the Octave are equally available with oct-files.
+available from the Octave command line are also available within oct-files.
 The basic means of extracting a sparse matrix from an @code{octave_value}
-and returning them as an @code{octave_value}, can be seen in the
+and returning it as an @code{octave_value}, can be seen in the
 following example.
 
 @example
@@ -831,20 +878,19 @@
 @end group
 @end example
 
-The conversion to an octave-value is handled by the sparse
+The conversion to an @code{octave_value} is handled by the sparse
 @code{octave_value} constructors, and so no special care is needed.
 
 @node Accessing Global Variables in Oct-Files
 @subsection Accessing Global Variables in Oct-Files
 
 Global variables allow variables in the global scope to be
-accessed.  Global variables can easily be accessed with oct-files using
-the support functions @code{get_global_value} and
-@code{set_global_value}.  @code{get_global_value} takes two arguments,
-the first is a string representing the variable name to obtain.  The
-second argument is a boolean argument specifying what to do in the case
-that no global variable of the desired name is found.  An example of the
-use of these two functions is
+accessed.  Global variables can be accessed within oct-files by using
+the support functions @code{get_global_value} and @code{set_global_value}.
+@code{get_global_value} takes two arguments, the first is a string representing
+the variable name to obtain.  The second argument is a boolean argument
+specifying what to do if no global variable of the desired name is found.
+An example of the use of these two functions is
 
 @example
 @EXAMPLEFILE(globaldemo.cc)
@@ -868,9 +914,9 @@
 @node Calling Octave Functions from Oct-Files
 @subsection Calling Octave Functions from Oct-Files
 
-There is often a need to be able to call another octave function from
-within an oct-file, and there are many examples of such within octave
-itself.  For example the @code{quad} function is an oct-file that
+There is often a need to be able to call another Octave function from
+within an oct-file, and there are many examples of such within Octave
+itself.  For example, the @code{quad} function is an oct-file that
 calculates the definite integral by quadrature over a user supplied
 function.
 
@@ -894,8 +940,8 @@
 @EXAMPLEFILE(funcdemo.cc)
 @end example
 
-The first argument to this demonstration is the user supplied function
-and the following arguments are all passed to the user function.
+The first argument to this demonstration is the user-supplied function
+and the remaining arguments are all passed to the user function.
 
 @example
 @group
@@ -912,40 +958,41 @@
 @end group
 @end example
 
-When the user function is passed as a string, the treatment of the
-function is different.  In some cases it is necessary to always have the
+When the user function is passed as a string the treatment of the
+function is different.  In some cases it is necessary to have the
 user supplied function as an @code{octave_function} object.  In that
-case the string argument can be used to create a temporary function like
+case the string argument can be used to create a temporary function
+as demonstrated below.
 
 @example
 @group
 std::octave fcn_name = unique_symbol_name ("__fcn__");
-std::string fname = "function y = ";
-fname.append (fcn_name);
-fname.append ("(x) y = ");
+std::string fcode = "function y = ";
+fcode.append (fcn_name);
+fcode.append ("(x) y = ");
 fcn = extract_function (args(0), "funcdemo", fcn_name,
-                        fname, "; endfunction");
+                        fcode, "; endfunction");
 @dots{}
 if (fcn_name.length ())
   clear_function (fcn_name);
 @end group
 @end example
 
-There are two important things to know in this case.  The number of input
-arguments to the user function is fixed, and in the above is a single
-argument, and secondly to avoid leaving the temporary function in the
-Octave symbol table it should be cleared after use.
+There are two important things to know in this case.  First, the number of
+input arguments to the user function is fixed, and in the above example is
+a single argument.  Second, to avoid leaving the temporary function in the
+Octave symbol table it should be cleared after use.  Also, by convention
+internal function names begin and end with the character sequence @samp{__}.
 
 @node Calling External Code from Oct-Files
 @subsection Calling External Code from Oct-Files
 
 Linking external C code to Octave is relatively simple, as the C
 functions can easily be called directly from C++.  One possible issue is
-the declarations of the external C functions might need to be explicitly
+that the declarations of the external C functions may need to be explicitly
 defined as C functions to the compiler.  If the declarations of the
-external C functions are in the header @code{foo.h}, then the manner in
-which to ensure that the C++ compiler treats these declarations as C
-code is
+external C functions are in the header @file{foo.h}, then the tactic to
+ensure that the C++ compiler treats these declarations as C code is
 
 @example
 @group
@@ -960,10 +1007,10 @@
 @end group
 @end example
 
-Calling Fortran code however can pose some difficulties.  This is due to
-differences in the manner in compilers treat the linking of Fortran code
-with C or C++ code.  Octave supplies a number of macros that allow
-consistent behavior across a number of compilers.
+Calling Fortran code, however, can pose more difficulties.  This is due to
+differences in the manner in which compilers treat the linking of Fortran code
+with C or C++ code.  Octave supplies a number of macros that allow consistent
+behavior across a number of compilers.
 
 The underlying Fortran code should use the @code{XSTOPX} function to
 replace the Fortran @code{STOP} function.  @code{XSTOPX} uses the Octave
@@ -971,15 +1018,15 @@
 explicitly.  Note that Octave supplies its own replacement @sc{blas}
 @code{XERBLA} function, which uses @code{XSTOPX}.
 
-If the underlying code calls @code{XSTOPX}, then the @w{@code{F77_XFCN}}
+If the code calls @code{XSTOPX}, then the @w{@code{F77_XFCN}}
 macro should be used to call the underlying Fortran function.  The Fortran
 exception state can then be checked with the global variable
 @code{f77_exception_encountered}.  If @code{XSTOPX} will not be called,
 then the @w{@code{F77_FCN}} macro should be used instead to call the Fortran
 code.
 
-There is no harm in using @w{@code{F77_XFCN}} in all cases, except that for
-Fortran code that is short running and executes a large number of times,
+There is no great harm in using @w{@code{F77_XFCN}} in all cases, except that
+for Fortran code that is short running and executes a large number of times,
 there is potentially an overhead in doing so.  However, if @w{@code{F77_FCN}}
 is used with code that calls @code{XSTOP}, Octave can generate a
 segmentation fault.
@@ -1000,18 +1047,18 @@
 
 This example demonstrates most of the features needed to link to an
 external Fortran function, including passing arrays and strings, as well
-as exception handling.  An example of the behavior of this function is
+as exception handling.  Both the Fortran and C++ files need to be compiled
+in order for the example to work.
 
 @example
 @group
+mkoctfile fortdemo.cc fortsub.f
 [b, s] = fortdemo (1:3)
 @result{}
   b = 1.00000   0.50000   0.33333
   s = There are   3 values in the input vector
 [b, s] = fortdemo (0:3)
-error: fortsub:divide by zero
-error: exception encountered in Fortran subroutine fortsub_
-error: fortdemo: error in Fortran
+error: fortdemo: fortsub: divide by zero
 @end group
 @end example
 
@@ -1019,7 +1066,7 @@
 @subsection Allocating Local Memory in Oct-Files
 
 Allocating memory within an oct-file might seem easy as the C++
-new/delete operators can be used.  However, in that case care must be
+new/delete operators can be used.  However, in that case great care must be
 taken to avoid memory leaks.  The preferred manner in which to allocate
 memory for use locally is to use the @w{@code{OCTAVE_LOCAL_BUFFER}} macro.
 An example of its use is
@@ -1032,27 +1079,32 @@
 that returns a pointer @code{tmp} of type @code{double *} of length
 @code{len}.
 
+In this case Octave itself will worry about reference counting and variable
+scope and will properly free memory without programmer intervention.
+
 @node Input Parameter Checking in Oct-Files
 @subsection Input Parameter Checking in Oct-Files
 
-As oct-files are compiled functions they have the possibility of causing
-Octave to abort abnormally.  It is therefore important that
-each and every function has the minimum of parameter
-checking needed to ensure that Octave behaves well.
+As oct-files are compiled functions they open up the possibility of
+crashing Octave through careless function calls or memory faults.
+It is quite important that each and every function have a sufficient level
+of parameter checking to ensure that Octave behaves well.
 
 The minimum requirement, as previously discussed, is to check the number
-of input arguments before using them to avoid referencing a non existent
-argument.  However, it some case this might not be sufficient as the
-underlying code imposes further constraints.  For example an external
+of input arguments before using them to avoid referencing a non-existent
+argument.  However, in some cases this might not be sufficient as the
+underlying code imposes further constraints.  For example, an external
 function call might be undefined if the input arguments are not
-integers, or if one of the arguments is zero.  Therefore, oct-files often
-need additional input parameter checking.
+integers, or if one of the arguments is zero, or if the input is complex
+and a real value was expected.  Therefore, oct-files often need additional
+input parameter checking.
 
-There are several functions within Octave that might be useful for the
+There are several functions within Octave that can be useful for the
 purposes of parameter checking.  These include the methods of the
-octave_value class like @code{is_real_matrix}, etc., but equally include
-more specialized functions.  Some of the more common ones are
-demonstrated in the following example.
+octave_value class like @code{is_real_matrix}, @code{is_numeric_type}, etc.
+Often, with a knowledge of the Octave m-file language, you can guess at what
+the corresponding C++ routine will.  In addition there are some more
+specialized input validation functions of which a few are demonstrated below.
 
 @example
 @EXAMPLEFILE(paramdemo.cc)
@@ -1075,10 +1127,10 @@
 @subsection Exception and Error Handling in Oct-Files
 
 Another important feature of Octave is its ability to react to the user
-typing @kbd{Control-C} even during calculations.  This ability is based on the
+typing @key{Control-C} even during calculations.  This ability is based on the
 C++ exception handler, where memory allocated by the C++ new/delete
 methods are automatically released when the exception is treated.  When
-writing an oct-file, to allow Octave to treat the user typing @kbd{Control-C},
+writing an oct-file, to allow Octave to treat the user typing @key{Control-C},
 the @w{@code{OCTAVE_QUIT}} macro is supplied.  For example:
 
 @example
@@ -1092,9 +1144,9 @@
 @end example
 
 The presence of the @w{@code{OCTAVE_QUIT}} macro in the inner loop allows
-Octave to treat the user request with the @kbd{Control-C}.  Without this macro,
+Octave to treat the user request with the @key{Control-C}.  Without this macro,
 the user must either wait for the function to return before the interrupt is
-processed, or press @kbd{Control-C} three times to force Octave to exit.
+processed, or press @key{Control-C} three times to force Octave to exit.
 
 The @w{@code{OCTAVE_QUIT}} macro does impose a very small speed penalty, and so
 for loops that are known to be small it might not make sense to include
@@ -1122,7 +1174,7 @@
 The Octave unwind_protect mechanism (@ref{The unwind_protect Statement})
 can also be used in oct-files.  In conjunction with the exception
 handling of Octave, it is important to enforce that certain code is run
-to allow variables, etc. to be restored even if an exception occurs.  An
+to allow variables, etc.@: to be restored even if an exception occurs.  An
 example of the use of this mechanism is
 
 @example
@@ -1141,7 +1193,7 @@
 @end group
 @end example
 
-The division by zero (and in fact all warnings) is disabled in the
+The warning for division by zero (and in fact all warnings) are disabled in the
 @code{unwinddemo} function.
 
 @node Documentation and Test of Oct-Files
@@ -1149,14 +1201,14 @@
 
 The documentation of an oct-file is the fourth string parameter of the
 @w{@code{DEFUN_DLD}} macro.  This string can be formatted in the same manner
-as the help strings for user functions (@ref{Documentation Tips}),
+as the help strings for user functions (@pxref{Documentation Tips}),
 however there are some issue that are particular to the formatting of
 help strings within oct-files.
 
 The major issue is that the help string will typically be longer than a
-single line of text, and so the formatting of long help strings need to
-be taken into account.  There are several manners in which to treat this
-issue, but the most common is illustrated in the following example,
+single line of text, and so the formatting of long help strings needs to
+be taken into account.  There are several possible solutions, but the most
+common is illustrated in the following example,
 
 @example
 @group
@@ -1173,32 +1225,29 @@
 @end example
 
 @noindent
-where, as can be seen, end line of text within the help string is
-terminated by @code{\n\} which is an embedded new-line in the string
-together with a C++ string continuation character.  Note that the final
-@code{\} must be the last character on the line.
+where, as can be seen, each line of text is terminated by @code{\n\}
+which is an embedded new-line in the string together with a C++ string
+continuation character.  Note that the final @code{\} must be the last
+character on the line.
 
-Octave also includes the ability to embed the test and demonstration
-code for a function within the code itself (@ref{Test and Demo Functions}).
+Octave also includes the ability to embed test and demonstration
+code for a function within the code itself (@pxref{Test and Demo Functions}).
 This can be used from within oct-files (or in fact any file) with
-certain provisos.  Firstly, the test and demo functions of Octave look
-for a @code{%!} as the first characters on a new-line to identify test
-and demonstration code.  This is equally a requirement for
-oct-files.  Furthermore the test and demonstration code must be included
-in a comment block of the compiled code to avoid it being interpreted by
-the compiler.  Finally, the Octave test and demonstration code must have
-access to the source code of the oct-file and not just the compiled code
-as the tests are stripped from the compiled code.  An example in an
-oct-file might be
+certain provisos.  First, the test and demo functions of Octave look
+for @code{%!} as the first two characters of a line to identify test
+and demonstration code.  This is a requirement for oct-files as well.
+In addition, the test and demonstration code must be wrapped in a comment
+block to avoid it being interpreted by the compiler.  Finally, the Octave
+test and demonstration code must have access to the original source code
+of the oct-file and not just the compiled code as the tests are stripped
+from the compiled code.  An example in an oct-file might be
 
 @example
 @group
 /*
-
+%!assert (sin ([1,2]), [sin(1),sin(2)])
 %!error (sin ())
 %!error (sin (1,1))
-%!assert (sin ([1,2]),[sin(1),sin(2)])
-
 */
 @end group
 @end example
@@ -1215,14 +1264,14 @@
 
 Octave includes an interface to allow legacy mex-files to be compiled
 and used with Octave.  This interface can also be used to share code
-between Octave and @sc{matlab} users.  However, as mex-files expose the
+between Octave and @sc{matlab} users.  However, as mex-files expose
 @sc{matlab}'s internal API, and the internal structure of Octave is
 different, a mex-file can never have the same performance in Octave as
-the equivalent oct-file.  In particular to support the manner in which
-mex-files access the variables passed to mex functions, there are a
-significant number of additional copies of memory when calling or
-returning from a mex function.  For this reason, new code should be
-written using the oct-file interface discussed above if possible.
+the equivalent oct-file.  In particular, to support the manner in which
+variables are passed to mex functions there are a significant number of
+additional copies of memory blocks when calling or returning from a
+mex-file function.  For this reason, it is recommended that any new code
+be written with the oct-file interface previously discussed.
 
 @menu
 * Getting Started with Mex-Files::  
@@ -1239,59 +1288,73 @@
 @subsection Getting Started with Mex-Files
 
 The basic command to build a mex-file is either @code{mkoctfile --mex}
-or @code{mex}.  The first can either be used from within Octave or from
+or @code{mex}.  The first command can be used either from within Octave or from
 the command line.  However, to avoid issues with @sc{matlab}'s own @code{mex}
 command, the use of the command @code{mex} is limited to within Octave.
+Compiled mex-files have the extension @file{.mex}.
 
 @DOCSTRING(mex)
 
 @DOCSTRING(mexext)
 
-One important difference with the use of @code{mex} between @sc{matlab} and
-Octave is that the header file "matrix.h" is implicitly included through
-the inclusion of "mex.h".  This is to avoid a conflict with the Octave
-file "Matrix.h" with operating systems and compilers that don't
-distinguish between filenames in upper and lower case
-
-Consider the short example:
+Consider the following short example:
 
 @example
 @group
-@EXAMPLEFILE(firstmexdemo.c)
+@EXAMPLEFILE(myhello.c)
 @end group
 @end example
 
-This simple example demonstrates the basics of writing a mex-file.  The
-entry point into the mex-file is defined by @code{mexFunction}.  Note
-that the function name is not explicitly included in the
+The first line @code{#include "mex.h"} makes available all of the definitions
+necessary for a mex-file.  One important difference between Octave and
+@sc{matlab} is that the header file @code{"matrix.h"} is implicitly included
+through the inclusion of @code{"mex.h"}.  This is necessary to avoid a conflict
+with the Octave file @code{"Matrix.h"} for operating systems and compilers that
+don't distinguish between filenames in upper and lower case.
+
+The entry point into the mex-file is defined by @code{mexFunction}.  The
+function takes four arguments:
+
+@enumerate 1
+@item The number of return arguments (# of left-hand side args).
+
+@item An array of pointers to return arguments.
+
+@item The number of input arguments (# of right-hand side args).
+
+@item An array of pointers to input arguments.
+@end enumerate
+
+Note that the function name definition is not explicitly included in
 @code{mexFunction} and so there can only be a single @code{mexFunction}
-entry point per-file.  Also the name of the function is determined by the
-name of the mex-file itself.  Therefore if the above function is in the
-file @file{firstmexdemo.c}, it can be compiled with
+entry point per file.  Instead, the name of the function as seen in Octave is
+determined by the name of the mex-file itself minus the extension.  Therefore,
+if the above function is in the file @file{myhello.c}, it can be compiled with
 
 @example
-mkoctfile --mex firstmexdemo.c
+mkoctfile --mex myhello.c
 @end example
 
 @noindent
-which creates a file @file{firstmexdemo.mex}.  The function can then be run
-from Octave as
+which creates a file @file{myhello.mex}.  The function can then be run from
+Octave as
 
 @example
 @group
-firstmexdemo ()
-@result{} 1.2346
+myhello (1,2,3)
+@result{} Hello, World!
+@result{} I have 3 inputs and 0 outputs
 @end group
 @end example
 
 It should be noted that the mex-file contains no help string for the
 functions it contains.  To document mex-files, there should exist an
 m-file in the same directory as the mex-file itself.  Taking the above as
-an example, we would therefore have a file @file{firstmexdemo.m} that might
+an example, we would therefore have a file @file{myhello.m} that might
 contain the text
 
 @example
-%FIRSTMEXDEMO Simple test of the functionality of a mex-file.
+%MYHELLO Simple test of the functionality of a mex-file.
 @end example
 
 In this case, the function that will be executed within Octave will be
@@ -1299,10 +1362,10 @@
 m-file.  This can also be useful to allow a sample implementation of the
 mex-file within the Octave language itself for testing purposes.
 
-Although we cannot have multiple entry points into a single mex-file,
-we can use the @code{mexFunctionName} function to determine what name
+Although there cannot be multiple entry points in a single mex-file,
+one can use the @code{mexFunctionName} function to determine what name
 the mex-file was called with.  This can be used to alter the behavior of
-the mex-file based on the function name.  For example if
+the mex-file based on the function name.  For example, if
 
 @example
 @group
@@ -1320,7 +1383,8 @@
 @end group
 @end example
 
-Then as can be seen by
+@noindent
+then as can be seen by
 
 @example
 @group
@@ -1336,34 +1400,34 @@
 the behavior of the mex-file can be altered depending on the functions
 name.
 
-Allow the user should only include @code{mex.h} in their code, Octave
+Although the user should only include @file{mex.h} in their code, Octave
 declares additional functions, typedefs, etc., available to the user to
-write mex-files in the headers @code{mexproto.h} and @code{mxarray.h}.
+write mex-files in the headers @file{mexproto.h} and @file{mxarray.h}.
 
 @node Working with Matrices and Arrays in Mex-Files
 @subsection Working with Matrices and Arrays in Mex-Files
 
-The basic mex type of all variables is @code{mxArray}.  All variables,
-such as matrices, cell arrays or structures are all stored in this basic
-type, and this type serves basically the same purpose as the
-octave_value class in oct-files.  That is it acts as a container for the
+The basic mex type of all variables is @code{mxArray}.  Any object,
+such as a matrix, cell array, or structure is stored in this basic
+type.  As such, @code{mxArray} serves basically the same purpose as the
+octave_value class in oct-files in that it acts as a container for the
 more specialized types.
 
-The @code{mxArray} structure contains at a minimum, the variable it
-represents name, its dimensions, its type and whether the variable is
-real or complex.  It can however contain a number of additional fields
+The @code{mxArray} structure contains at a minimum, the name of the
+variable it represents, its dimensions, its type, and whether the variable is
+real or complex.  It can also contain a number of additional fields
 depending on the type of the @code{mxArray}.  There are a number of
 functions to create @code{mxArray} structures, including
-@code{mxCreateCellArray}, @code{mxCreateSparse} and the generic
-@code{mxCreateNumericArray}.
+@code{mxCreateDoubleMatrix}, @code{mxCreateCellArray}, @code{mxCreateSparse},
+and the generic @code{mxCreateNumericArray}.
 
-The basic functions to access the data contained in an array is
-@code{mxGetPr}.  As the mex interface assumes that the real and imaginary
+The basic function to access the data contained in an array is
+@code{mxGetPr}.  As the mex interface assumes that real and imaginary
 parts of a complex array are stored separately, there is an equivalent
-function @code{mxGetPi} that get the imaginary part.  Both of these
-functions are for use only with double precision matrices.  There also
-exists the generic function @code{mxGetData} and @code{mxGetImagData}
-that perform the same operation on all matrix types.  For example:
+function @code{mxGetPi} that gets the imaginary part.  Both of these
+functions are only for use with double precision matrices.  The generic
+functions @code{mxGetData} and @code{mxGetImagData} perform the same operation
+on all matrix types.  For example:
 
 @example
 @group
@@ -1372,27 +1436,25 @@
 UINT32_T *pr;
 
 dims = (mwSize *) mxMalloc (2 * sizeof (mwSize));
-dims[0] = 2;
-dims[1] = 2;
+dims[0] = 2; dims[1] = 2;
 m = mxCreateNumericArray (2, dims, mxUINT32_CLASS, mxREAL);
-pr =  = (UINT32_T *) mxGetData (m);
+pr = (UINT32_T *) mxGetData (m);
 @end group
 @end example
 
 There are also the functions @code{mxSetPr}, etc., that perform the
-inverse, and set the data of an Array to use the block of memory pointed
+inverse, and set the data of an array to use the block of memory pointed
 to by the argument of @code{mxSetPr}.
 
-Note the type @code{mwSize} used above, and @code{mwIndex} are defined
+Note the type @code{mwSize} used above, and also @code{mwIndex}, are defined
 as the native precision of the indexing in Octave on the platform on
 which the mex-file is built.  This allows both 32- and 64-bit platforms
-to support mex-files.  @code{mwSize} is used to define array dimension
-and maximum number or elements, while @code{mwIndex} is used to define
+to support mex-files.  @code{mwSize} is used to define array dimensions
+and the maximum number or elements, while @code{mwIndex} is used to define
 indexing into arrays.
 
-An example that demonstration how to work with arbitrary real or complex
-double precision arrays is given by the file @file{mypow2.c} as given
-below.
+An example that demonstrates how to work with arbitrary real or complex
+double precision arrays is given by the file @file{mypow2.c} shown below.
 
 @example
 @EXAMPLEFILE(mypow2.c)
@@ -1409,12 +1471,11 @@
 @end group
 @end example
 
-
 The example above uses the functions @code{mxGetDimensions},
 @code{mxGetNumberOfElements}, and @code{mxGetNumberOfDimensions} to work
 with the dimensions of multi-dimensional arrays.  The functions
 @code{mxGetM}, and @code{mxGetN} are also available to find the number
-of rows and columns in a matrix.
+of rows and columns in a 2-D matrix.
 
 @node Character Strings in Mex-Files
 @subsection Character Strings in Mex-Files
@@ -1422,8 +1483,8 @@
 As mex-files do not make the distinction between single and double
 quoted strings within Octave, there is perhaps less complexity in the
 use of strings and character matrices in mex-files.  An example of their
-use, that parallels the demo in @file{stringdemo.cc}, is given in the
-file @file{mystring.c}, as seen below.
+use that parallels the demo in @file{stringdemo.cc} is given in the
+file @file{mystring.c}, as shown below.
 
 @example
 @EXAMPLEFILE(mystring.c)
@@ -1450,10 +1511,10 @@
 @node Cell Arrays with Mex-Files
 @subsection Cell Arrays with Mex-Files
 
-We can perform exactly the same operations in Cell arrays in mex-files
-as we can in oct-files.  An example that reduplicates the functional of
-the @file{celldemo.cc} oct-file in a mex-file is given by
-@file{mycell.c} as below
+One can perform exactly the same operations on Cell arrays in mex-files
+as in oct-files.  An example that reduplicates the function of
+the @file{celldemo.cc} oct-file in a mex-file is given by @file{mycell.c}
+as shown below.
 
 @example
 @group
@@ -1462,8 +1523,7 @@
 @end example
 
 @noindent
-which as can be seen below has exactly the same behavior as the oct-file
-version.
+The output is identical to the oct-file version as well.
 
 @example
 @group
@@ -1480,8 +1540,8 @@
 
 Note in the example the use of the @code{mxDuplicateArray} function.  This
 is needed as the @code{mxArray} pointer returned by @code{mxGetCell}
-might be deallocated.  The inverse function to @code{mxGetCell} is
-@code{mcSetCell} and is defined as
+might be deallocated.  The inverse function to @code{mxGetCell}, used for
+setting Cell values, is @code{mxSetCell} and is defined as
 
 @example
 void mxSetCell (mxArray *ptr, int idx, mxArray *val);
@@ -1500,7 +1560,7 @@
 @subsection Structures with Mex-Files
 
 The basic function to create a structure in a mex-file is
-@code{mxCreateStructMatrix}, which creates a structure array with a two
+@code{mxCreateStructMatrix} which creates a structure array with a two
 dimensional matrix, or @code{mxCreateStructArray}.
 
 @example
@@ -1514,7 +1574,7 @@
 @end group
 @end example
 
-Accessing the fields of the structure can then be performed with the
+Accessing the fields of the structure can then be performed with
 @code{mxGetField} and @code{mxSetField} or alternatively with the
 @code{mxGetFieldByNumber} and @code{mxSetFieldByNumber} functions.
 
@@ -1534,11 +1594,11 @@
 A difference between the oct-file interface to structures and the
 mex-file version is that the functions to operate on structures in
 mex-files directly include an @code{index} over the elements of the
-arrays of elements per @code{field}.  Whereas the oct-file structure
+arrays of elements per @code{field}; Whereas, the oct-file structure
 includes a Cell Array per field of the structure.
 
-An example that demonstrates the use of structures in mex-file can be
-found in the file @file{mystruct.c}, as seen below
+An example that demonstrates the use of structures in a mex-file can be
+found in the file @file{mystruct.c} shown below.
 
 @example
 @EXAMPLEFILE(mystruct.c)
@@ -1585,10 +1645,9 @@
 matrices are required to be two-dimensional.  The only difference is that
 the real and imaginary parts of the matrix are stored separately.
 
-The mex-file interface, as well as using @code{mxGetM}, @code{mxGetN},
+The mex-file interface, in addition to using @code{mxGetM}, @code{mxGetN},
 @code{mxSetM}, @code{mxSetN}, @code{mxGetPr}, @code{mxGetPi},
-@code{mxSetPr} and @code{mxSetPi}, the mex-file interface supplies the
-functions
+@code{mxSetPr}, and @code{mxSetPi}, also supplies the following functions.
 
 @example
 @group
@@ -1609,7 +1668,7 @@
 additional value than the number of columns in the sparse matrix.  The
 difference between consecutive values of the array returned by
 @code{mxGetJc} define the number of non-zero elements in each column of
-the sparse matrix.  Therefore
+the sparse matrix.  Therefore,
 
 @example
 @group
@@ -1629,7 +1688,7 @@
 only contain the non-zero values of the matrix, we also need a pointer
 to the rows of the non-zero elements, and this is given by
 @code{mxGetIr}.  A complete example of the use of sparse matrices in
-mex-files is given by the file @file{mysparse.c} as seen below
+mex-files is given by the file @file{mysparse.c} shown below.
 
 @example
 @EXAMPLEFILE(mysparse.c)
@@ -1638,9 +1697,9 @@
 @node Calling Other Functions in Mex-Files
 @subsection Calling Other Functions in Mex-Files
 
-It is also possible call other Octave functions from within a mex-file
-using @code{mexCallMATLAB}.  An example of the use of
-@code{mexCallMATLAB} can be see in the example below
+It is possible to call other Octave functions from within a mex-file
+using @code{mexCallMATLAB}.  An example of the use of @code{mexCallMATLAB}
+can be see in the example below.
 
 @example
 @EXAMPLEFILE(myfeval.c)
@@ -1671,9 +1730,9 @@
 @node Standalone Programs
 @section Standalone Programs
 
-The libraries Octave itself uses, can be utilized in standalone
+The libraries Octave itself uses can be utilized in standalone
 applications.  These applications then have access, for example, to the
-array and matrix classes as well as to all the Octave algorithms.  The
+array and matrix classes, as well as to all of the Octave algorithms.  The
 following C++ program, uses class Matrix from @file{liboctave.a} or
 @file{liboctave.so}.
 
@@ -1684,7 +1743,7 @@
 @end example
 
 @noindent
-mkoctfile can then be used to build a standalone application with a
+mkoctfile can be used to build a standalone application with a
 command like
 
 @example
@@ -1698,10 +1757,10 @@
 @end group
 @end example
 
-Note that the application @code{hello} will be dynamically linked
-against the octave libraries and any octave support libraries.  The above
+Note that the application @code{standalone} will be dynamically linked
+against the Octave libraries and any Octave support libraries.  The above
 allows the Octave math libraries to be used by an application.  It does
-not however allow the script files, oct-files or builtin functions of
+not, however, allow the script files, oct-files, or builtin functions of
 Octave to be used by the application.  To do that the Octave interpreter
 needs to be initialized first.  An example of how to do this can then be
 seen in the code
@@ -1713,7 +1772,7 @@
 @end example
 
 @noindent
-which is compiled and run as before as a standalone application with
+which, as before, is compiled and run as a standalone application with
 
 @example
 @group
--- a/doc/interpreter/func.txi
+++ b/doc/interpreter/func.txi
@@ -325,7 +325,7 @@
 
 It is possible to use the @code{nthargout} function to obtain only some
 of the return values or several at once in a cell array.
-@ref{Cell Array Objects}
+@xref{Cell Array Objects}.
 
 @DOCSTRING(nthargout)
 
@@ -402,7 +402,7 @@
 
 @DOCSTRING(nargoutchk)
 
-@anchor{doc-varargin} @anchor{doc-varargout}
+@anchor{XREFvarargin} @anchor{XREFvarargout}
 @node Variable-length Argument Lists
 @section Variable-length Argument Lists
 @cindex variable-length argument lists
@@ -1150,7 +1150,7 @@
 A function that has been defined on the command-line.
 
 @item Autoload function
-A function that is marked as autoloaded with @xref{doc-autoload}.
+A function that is marked as autoloaded with @xref{XREFautoload,,autoload}.
 
 @item A Function on the Path
 A function that can be found on the users load-path.  There can also be
--- a/doc/interpreter/geometryimages.m
+++ b/doc/interpreter/geometryimages.m
@@ -26,7 +26,7 @@
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
-    d_typ = cstrcat ("-d", typ);
+    d_typ = ["-d" typ];
   endif
 
   if (! __have_feature__ ("QHULL")
@@ -52,14 +52,14 @@
     plot (xc, yc, "g-", "LineWidth", 3);
     axis([0, 1, 0, 1]);
     legend ("Delaunay Triangulation", "Voronoi Diagram");
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "triplot"))
     rand ("state", 2)
     x = rand (20, 1);
     y = rand (20, 1);
     tri = delaunay (x, y);
     triplot (tri, x, y);
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "griddata"))
     rand("state",1);
     x=2*rand(1000,1)-1;
@@ -67,14 +67,14 @@
     z=sin(2*(x.^2+y.^2));
     [xx,yy]=meshgrid(linspace(-1,1,32));
     griddata(x,y,z,xx,yy);
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "convhull"))
     x = -3:0.05:3;
     y = abs (sin (x));
     k = convhull (x, y);
     plot (x(k),y(k),'r-',x,y,'b+');
     axis ([-3.05, 3.05, -0.05, 1.05]);
-    print (cstrcat (nm, ".", typ), d_typ) 
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "delaunay"))
     rand ("state", 1);
     x = rand (1, 10);
@@ -84,7 +84,7 @@
     Y = [ y(T(:,1)); y(T(:,2)); y(T(:,3)); y(T(:,1)) ];
     axis ([0, 1, 0, 1]);
     plot(X, Y, "b", x, y, "r*");
-    print (cstrcat (nm, ".", typ), d_typ) 
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "inpolygon"))
     randn ("state", 2);
     x = randn (100, 1);
@@ -94,7 +94,7 @@
     in = inpolygon (x, y, vx, vy);
     plot(vx, vy, x(in), y(in), "r+", x(!in), y(!in), "bo");
     axis ([-2, 2, -2, 2]);
-    print (cstrcat (nm, ".", typ), d_typ) 
+    print ([nm "." typ], d_typ);
   else
     error ("unrecognized plot requested");
   endif
@@ -144,7 +144,7 @@
     if (strcmp (typ, "eps"))
       d_typ = "-depsc2";
     else
-      d_typ = cstrcat ("-d", typ);
+      d_typ = ["-d" typ];
     endif
 
     x = y = linspace (-8, 8, 41)';
@@ -155,7 +155,7 @@
       mesh (x, y, z);
       title ("Sorry, graphics not available because octave was\\ncompiled without the QHULL library.");
     unwind_protect_cleanup
-      print (cstrcat (nm, ".", typ), d_typ);
+      print ([nm "." typ], d_typ);
       hide_output ();
     end_unwind_protect
   endif
--- a/doc/interpreter/gui.txi
+++ b/doc/interpreter/gui.txi
@@ -81,13 +81,17 @@
 @node User-Defined Preferences
 @section User-Defined Preferences
 
+@DOCSTRING(getpref)
+
+@DOCSTRING(setpref)
+
 @DOCSTRING(addpref)
 
-@DOCSTRING(getpref)
+@DOCSTRING(rmpref)
 
 @DOCSTRING(ispref)
 
-@DOCSTRING(rmpref)
+@DOCSTRING(prefdir)
 
-@DOCSTRING(setpref)
+@DOCSTRING(preferences)
 
--- a/doc/interpreter/image.txi
+++ b/doc/interpreter/image.txi
@@ -19,7 +19,7 @@
 @node Image Processing
 @chapter Image Processing
 
-Since an image basically is a matrix Octave is a very powerful
+Since an image is basically a matrix, Octave is a very powerful
 environment for processing and analyzing images.  To illustrate
 how easy it is to do image processing in Octave, the following
 example will load an image, smooth it by a 5-by-5 averaging filter,
@@ -38,20 +38,19 @@
 and @code{Dy} contains the partial spatial derivatives of the image.
 
 @menu
-* Loading and Saving Images::   
-* Displaying Images::           
-* Representing Images::         
-* Plotting on top of Images::   
-* Color Conversion::            
+* Loading and Saving Images::
+* Displaying Images::
+* Representing Images::
+* Plotting on top of Images::
+* Color Conversion::
 @end menu
 
 @node Loading and Saving Images
 @section Loading and Saving Images
 
 The first step in most image processing tasks is to load an image
-into Octave.  This is done using the @code{imread} function, which uses the
-@code{GraphicsMagick} library for reading.  This means a vast number of image
-formats is supported.  The @code{imwrite} function is the corresponding function
+into Octave which is done with the @code{imread} function.
+The @code{imwrite} function is the corresponding function
 for writing images to the disk.
 
 In summary, most image processing code will follow the structure of this code
@@ -77,6 +76,30 @@
 
 @DOCSTRING(imfinfo)
 
+By default, Octave's image IO functions (@code{imread}, @code{imwrite},
+and @code{imfinfo}) use the @code{GraphicsMagick} library for their
+operations.  This means a vast number of image formats is supported
+but considering the large amount of image formats in science and
+its commonly closed nature, it is impossible to have a library
+capable of reading them all.  Because of this, the function
+@code{imformats} keeps a configurable list of available formats,
+their extensions, and what functions should the image IO functions
+use.  This allows to expand Octave's image IO capabilities by
+creating functions aimed at acting on specific file formats.
+
+While it would be possible to call the extra functions directly,
+properly configuring Octave with @code{imformats} allows to keep a
+consistent code that is abstracted from file formats.
+
+It is important to note that a file format is not actually defined by its
+file extension and that @code{GraphicsMagick} is capable to read and write
+more file formats than the ones listed by @code{imformats}.  What this
+means is that even with an incorrect or missing extension the image may
+still be read correctly, and that even unlisted formats are not necessarily
+unsupported.
+
+@DOCSTRING(imformats)
+
 @node Displaying Images
 @section Displaying Images
 
--- a/doc/interpreter/install.txi
+++ b/doc/interpreter/install.txi
@@ -187,7 +187,7 @@
 Linear Algebra Package (@url{http://www.netlib.org/lapack}).
 
 @item PCRE
-The Perl Compatible Regular Expression library (http://www.pcre.org).
+The Perl Compatible Regular Expression library (@url{http://www.pcre.org}).
 @end table
 
 The following external package is optional but strongly recommended:
@@ -276,7 +276,7 @@
 @code{qrinsert}, @code{qrshift}, and @code{qrupdate}.
 
 @item QScintilla
-Source code highlighter and manipulator; a Qt  port of Scintilla
+Source code highlighter and manipulator; a Qt port of Scintilla
 (@url{http://www.riverbankcomputing.co.uk/software/qscintilla}).
 QScintilla is used for syntax highlighting and code completion in the
 GUI.
@@ -517,7 +517,7 @@
 known problems below to see if there is a workaround or solution for
 your problem.  If not,
 @ifclear INSTALLONLY
-see @ref{Trouble},
+@pxref{Trouble},
 @end ifclear
 @ifset INSTALLONLY
 see the file BUGS
--- a/doc/interpreter/interp.txi
+++ b/doc/interpreter/interp.txi
@@ -29,7 +29,7 @@
 
 Octave supports several methods for one-dimensional interpolation, most
 of which are described in this section.  @ref{Polynomial Interpolation}
-and @ref{Interpolation on Scattered Data} describe further methods.
+and @ref{Interpolation on Scattered Data} describe additional methods.
 
 @DOCSTRING(interp1)
 
@@ -128,9 +128,8 @@
 @end float
 @end ifnotinfo
 
-In additional the support function @code{spline} and @code{lookup} that
+In addition, the support functions @code{spline} and @code{lookup} that
 underlie the @code{interp1} function can be called directly.
-@ref{Finding Elements and Checking Conditions}
 
 @DOCSTRING(spline)
 
--- a/doc/interpreter/interpimages.m
+++ b/doc/interpreter/interpimages.m
@@ -26,7 +26,7 @@
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
-    d_typ = cstrcat ("-d", typ);
+    d_typ = ["-d", typ];
   endif
 
   if (strcmp (typ, "txt"))
@@ -40,7 +40,7 @@
     plot (ti, yp, 'g', ti, interp1(t, y, ti, 'spline'), 'b', ...
           ti, interpft (y, k), 'c', t, y, 'r+');
     legend ('sin(4t+0.3)cos(3t-0.1)','spline','interpft','data');
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "interpn"))
     x = y = z = -1:1;
     f = @(x,y,z) x.^2 - y - z.^2;
@@ -50,7 +50,7 @@
     [xxi, yyi, zzi] = ndgrid (xi, yi, zi);
     vi = interpn(x, y, z, v, xxi, yyi, zzi, 'spline');
     mesh (zi, yi, squeeze (vi(1,:,:)));
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "interpderiv1"))
     t = -2:2;
     dt = 1;
@@ -61,7 +61,7 @@
     yp = interp1(t,y,ti,'pchip');
     plot (ti, ys,'r-', ti, yp,'g-');
     legend('spline','pchip', 4);
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "interpderiv2"))
     t = -2:2;
     dt = 1;
@@ -72,7 +72,7 @@
     ddyp = diff(diff(interp1(t,y,ti,'pchip'))./dti)./dti;
     plot (ti(2:end-1),ddys,'r*', ti(2:end-1),ddyp,'g+');
     legend('spline','pchip');
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   endif
   hide_output ();  
 endfunction
--- a/doc/interpreter/intro.txi
+++ b/doc/interpreter/intro.txi
@@ -29,7 +29,7 @@
 GNU Octave is freely redistributable software.  You may redistribute 
 it and/or modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation.  The GPL is included in 
-this manual in @ref{Copying}.
+this manual, @pxref{Copying}.
 
 This manual provides comprehensive documentation on how to install, 
 run, use, and extend GNU Octave.  Additional chapters describe how 
@@ -374,7 +374,7 @@
 on the line, etc.
 
 A complete description of the command line editing capability is given
-in this manual in @ref{Command Line Editing}.
+in this manual, @pxref{Command Line Editing}.
 
 @subsection Help and Documentation
 
@@ -410,7 +410,7 @@
 text of the printed manual from within Octave normally uses a separate
 program called Info.  When you invoke Info you will be put into a menu
 driven program that contains the entire Octave manual.  Help for using
-Info is provided in this manual in @ref{Getting Help}.
+Info is provided in this manual, @pxref{Getting Help}.
 
 @node Conventions
 @section Conventions
@@ -617,7 +617,7 @@
 The function described is written in a language like C++, C, or Fortran.
 On systems that support dynamic linking of user-supplied functions, it
 may be automatically linked while Octave is running, but only if it is
-needed.  @xref{Dynamically Linked Functions}.
+needed.  @xref{External Code Interface}.
 
 @item Mapping Function
 @cindex mapping function
--- a/doc/interpreter/io.txi
+++ b/doc/interpreter/io.txi
@@ -22,7 +22,7 @@
 Octave supports several ways of reading and writing data to or from the
 prompt or a file.  The simplest functions for data Input and Output
 (I/O) are easy to use, but only provide limited control of how
-data is processed.  For more control, a set of functions modelled
+data is processed.  For more control, a set of functions modeled
 after the C standard library are also provided by Octave.
 
 @menu
@@ -149,7 +149,7 @@
 The @code{save} and @code{load} commands allow data to be written to and
 read from disk files in various formats.  The default format of files
 written by the @code{save} command can be controlled using the functions
-@code{default_save_options} and @code{save_precision}.
+@code{save_default_options} and @code{save_precision}.
 
 As an example the following code creates a 3-by-3 matrix and saves it
 to the file @samp{myfile.mat}.
@@ -180,7 +180,7 @@
 
 There are three functions that modify the behavior of @code{save}.
 
-@DOCSTRING(default_save_options)
+@DOCSTRING(save_default_options)
 
 @DOCSTRING(save_precision)
 
@@ -388,7 +388,7 @@
 This section describes how to call @code{printf} and related functions.
 
 The following functions are available for formatted output.  They are
-modelled after the C language functions of the same name, but they
+modeled after the C language functions of the same name, but they
 interpret the format template differently in order to improve the
 performance of printing vector and matrix values.
 
--- a/doc/interpreter/java.txi
+++ b/doc/interpreter/java.txi
@@ -151,7 +151,7 @@
 @c ------------------------------------------------------------------------
 @node How to distinguish between Octave and Matlab?
 @subsection How to distinguish between Octave and Matlab?
-@anchor{doc-FAQ}
+@anchor{XREFFAQ}
 @c - index -
 @cindex Octave and @sc{matlab}, how to distinguish between
 @c - index -
@@ -316,7 +316,7 @@
 In order to execute Java code Octave creates a Java Virtual Machine (JVM).
 Such a JVM allocates a fixed amount of initial memory and may expand this pool
 up to a fixed maximum memory limit.  The default values depend on the Java
-version (see @ref{doc-javamem,,javamem}).  The memory pool is shared by all
+version (@pxref{XREFjavamem,,javamem}).  The memory pool is shared by all
 Java objects running in the JVM@.  This strict memory limit is intended mainly
 to avoid that runaway applications inside web browsers or in enterprise servers
 can consume all memory and crash the system.  When the maximum memory limit is
--- a/doc/interpreter/matrix.txi
+++ b/doc/interpreter/matrix.txi
@@ -124,7 +124,7 @@
 
 @DOCSTRING(nth_element)
 
-@anchor{doc-triu}
+@anchor{XREFtriu}
 @DOCSTRING(tril)
 
 @DOCSTRING(vec)
--- a/doc/interpreter/munge-texi.pl
+++ b/doc/interpreter/munge-texi.pl
@@ -61,7 +61,7 @@
     }
 
     $func =~ s/^@/@@/;   # Texinfo uses @@ to produce '@'
-    $docstring =~ s/^$tex_delim$/\@anchor{doc-$func}/m;
+    $docstring =~ s/^$tex_delim$/\@anchor{XREF$func}/m;
     print $docstring,"\n";
 
     next TXI_LINE;
@@ -110,7 +110,7 @@
       foreach $func (split (/,/, $func_list))
       {
         $func =~ s/^@/@@/;   # Texinfo uses @@ to produce '@'
-        $repl .= "\@ref{doc-$func,,$func}, ";
+        $repl .= "\@ref{XREF$func,,$func}, ";
       }
       substr($repl,-2) = "";   # Remove last ', ' 
       $_ = "\@seealso{$repl}$rest_of_line";
--- a/doc/interpreter/numbers.txi
+++ b/doc/interpreter/numbers.txi
@@ -29,7 +29,7 @@
 (exponential) notation, or a complex number.  Note that by default numeric
 constants are represented within Octave in double-precision floating
 point format (complex constants are stored as pairs of double-precision
-floating point values).  It is however possible to represent real
+floating point values).  It is, however, possible to represent real
 integers as described in @ref{Integer Data Types}.  Here are some
 examples of real-valued numeric constants, which all have the same
 value:
@@ -359,7 +359,7 @@
 
 Empty matrices may also be used in assignment statements as a convenient
 way to delete rows or columns of matrices.
-@xref{Assignment Ops, ,Assignment Expressions}.
+@xref{Assignment Ops,,Assignment Expressions}.
 
 When Octave parses a matrix expression, it examines the elements of the
 list to determine whether they are all constants.  If they are, it
@@ -614,9 +614,10 @@
 for bit manipulation, particularly when forming masks, Octave supplies
 the function @code{bitmax}.
 
+@anchor{XREFflintmax}
 @DOCSTRING(bitmax)
 
-This is the double precision version of the functions @code{intmax},
+This is the double precision version of the function @code{intmax},
 previously discussed.
 
 Octave also includes the basic bitwise 'and', 'or' and 'exclusive or'
@@ -839,4 +840,4 @@
 
 If instead of knowing properties of variables, you wish to know which
 variables are defined and to gather other information about the
-workspace itself, see @ref{Status of Variables}.
+workspace itself, @pxref{Status of Variables}.
--- a/doc/interpreter/octave.texi
+++ b/doc/interpreter/octave.texi
@@ -180,7 +180,7 @@
 * System Utilities::            
 * Java Interface:: 
 * Packages:: 
-* Dynamically Linked Functions::
+* External Code Interface::
 * Test and Demo Functions::
 * Tips and Standards::                        
 * Contributing Guidelines::
@@ -200,6 +200,7 @@
 Preface
 
 * Acknowledgements::            
+* Citing Octave in Publications::
 * How You Can Contribute to Octave::  
 * Distribution::                
 
@@ -500,7 +501,6 @@
 * Plot Annotations::            
 * Multiple Plots on One Page::  
 * Multiple Plot Windows::       
-* Use of axis@comma{} line@comma{} and patch Functions::
 * Manipulation of Plot Windows::
 * Use of the @code{interpreter} Property::
 * Printing and Saving Plots::              
@@ -599,6 +599,7 @@
 * Broadcasting::               Broadcasting operations
 * Function Application::       Applying functions to arrays, cells, and structs
 * Accumulation::               Accumulation functions
+* JIT Compiler::               Just-In-Time Compiler for loops
 * Miscellaneous Techniques::   Other techniques for speeding up code
 * Examples::
 
@@ -762,6 +763,7 @@
 
 * FTP Objects::
 * URL Manipulation::
+* Base64 and Binary Data Transmission::
 
 Java Interface
 
@@ -790,7 +792,7 @@
 * The INDEX File::              
 * PKG_ADD and PKG_DEL Directives::  
 
-Dynamically Linked Functions
+External Code Interface
 
 * Oct-Files::                   
 * Mex-Files::                   
@@ -941,7 +943,7 @@
 @c ------------------------------------------------------------------------
 @c Appendices start here. 
 
-@include dynamic.texi
+@include external.texi
 @include testfun.texi
 @include tips.texi
 @include contrib.texi
--- a/doc/interpreter/package.txi
+++ b/doc/interpreter/package.txi
@@ -24,16 +24,16 @@
 installation of extra packages.  The `Octave-Forge' project is a
 community-maintained set of packages that can be downloaded and
 installed in Octave.  At the time of writing the `Octave-Forge' project
-can be found online at @uref{http://octave.sourceforge.net}, but
+can be found online at @url{http://octave.sourceforge.net}, but
 since the Internet is an ever-changing place this may not be true at
 the time of reading.  Therefore it is recommended to see the Octave
 website for an updated reference.
 
 @menu
-* Installing and Removing Packages::  
-* Using Packages::              
-* Administrating Packages::     
-* Creating Packages::           
+* Installing and Removing Packages::
+* Using Packages::
+* Administrating Packages::
+* Creating Packages::
 @end menu
 
 @findex pkg
@@ -112,26 +112,26 @@
 @node Using Packages
 @section Using Packages
 
-By default installed packages are available from the Octave prompt,
+By default installed packages are not available from the Octave prompt,
 but it is possible to control this using the @code{pkg load} and 
 @code{pkg unload} commands.  The functions from a package can be 
-removed from the Octave path by typing
+added to the Octave path by typing
+
+@example
+pkg load package_name
+@end example
+
+@noindent
+where @code{package_name} is the name of the package to be added
+to the path.
+
+In much the same way a package can be removed from the Octave path by
+typing
 
 @example
 pkg unload package_name
 @end example
 
-@noindent
-where @code{package_name} is the name of the package to be removed
-from the path.
-
-In much the same way a package can be added to the Octave path by
-typing
-
-@example
-pkg load package_name
-@end example
-
 @node Administrating Packages
 @section Administrating Packages
 
@@ -217,7 +217,7 @@
 This is an optional file describing old entries from the @file{NEWS} file.
 
 @cindex PKG_ADD
-@anchor{doc-PKG_ADD}
+@anchor{XREFPKG_ADD}
 @item package/PKG_ADD
 An optional file that includes commands that are run when the package
 is added to the users path.  Note that @w{@code{PKG_ADD}} directives in the
@@ -242,7 +242,7 @@
 directives.
 
 @cindex PKG_DEL
-@anchor{doc-PKG_DEL}
+@anchor{XREFPKG_DEL}
 @item package/PKG_DEL
 An optional file that includes commands that are run when the package
 is removed from the users path.  Note that @w{@code{PKG_DEL}} directives in
@@ -252,16 +252,23 @@
 directives.
 
 @item package/pre_install.m
-This is an optional script that is run prior to the installation of a
-package. 
+This is an optional function that is run prior to the installation of a
+package.  This function is called with a single argument, a struct with
+fields names after the data in the @file{DESCRIPTION}, and the paths where
+the package functions will be installed.
 
 @item package/post_install.m
-This is an optional script that is run after the installation of a
-package. 
+This is an optional function that is run after the installation of a
+package.  This function is called with a single argument, a struct with
+fields names after the data in the @file{DESCRIPTION}, and the paths where
+the package functions were installed.
 
 @item package/on_uninstall.m
-This is an optional script that is run prior to the removal of a
-package. 
+This is an optional function that is run prior to the removal of a
+package.  This function is called with a single argument, a struct with
+fields names after the data in the @file{DESCRIPTION}, the paths where
+the package functions are installed, and whether the package is currently
+loaded.
 @end table
 
 Besides the above mentioned files, a package can also contain on or
@@ -270,7 +277,7 @@
 @table @code
 @item package/inst
 An optional directory containing any files that are directly installed
-by the package.  Typically this will include any @code{m}-files. 
+by the package.  Typically this will include any @code{m}-files.
 
 @item package/src
 An optional directory containing code that must be built prior to the
@@ -299,9 +306,9 @@
 @end table
 
 @menu
-* The DESCRIPTION File::        
-* The INDEX File::              
-* PKG_ADD and PKG_DEL Directives::  
+* The DESCRIPTION File::
+* The INDEX File::
+* PKG_ADD and PKG_DEL Directives::
 @end menu
 
 @node The DESCRIPTION File
@@ -339,7 +346,7 @@
  description gets too long for one line it can continue
  on the next by adding a space to the beginning of the
  following lines.
-License: GPL version 3 or later
+License: GPLv3+
 @end group
 @end example
 
@@ -489,7 +496,7 @@
 package with @code{pkg describe} but they will be published
 in the HTML documentation online.
 Workaround descriptions can use any HTML markup, but
-keep in mind that it will be enclosed in a bold-italic environment.  
+keep in mind that it will be enclosed in a bold-italic environment.
 For the special case of:
 
 @example
--- a/doc/interpreter/plot.txi
+++ b/doc/interpreter/plot.txi
@@ -34,8 +34,8 @@
 Earlier versions of Octave provided plotting through the use of
 gnuplot.  This capability is still available.  But, a newer plotting
 capability is provided by access to OpenGL@.  Which plotting system
-is used is controlled by the @code{graphics_toolkit} function.  (See
-@ref{Graphics Toolkits}.)
+is used is controlled by the @code{graphics_toolkit} function.
+@xref{Graphics Toolkits}.
 
 The function call @code{graphics_toolkit ("fltk")} selects the
 FLTK/OpenGL system, and @code{graphics_toolkit ("gnuplot")} selects the
@@ -62,7 +62,6 @@
 * Plot Annotations::            
 * Multiple Plots on One Page::  
 * Multiple Plot Windows::       
-* Use of axis@comma{} line@comma{} and patch Functions::
 * Manipulation of Plot Windows::
 * Use of the @code{interpreter} Property::
 * Printing and Saving Plots::              
@@ -253,8 +252,8 @@
 The @code{xlim}, @code{ylim}, and @code{zlim} functions may be used to
 get or set individual axis limits.  Each has the same form.
 
-@anchor{doc-ylim}
-@anchor{doc-zlim}
+@anchor{XREFylim}
+@anchor{XREFzlim}
 @DOCSTRING(xlim)
 
 @node Two-dimensional Function Plotting
@@ -405,7 +404,7 @@
 
 For three-dimensional plots the aspect ratio can be set for data with
 @code{daspect} and for the plot box with @code{pbaspect}.  
-See @ref{Axis Configuration} for controlling the x-, y-, and z-limits for
+@xref{Axis Configuration}, for controlling the x-, y-, and z-limits for
 plotting.
 
 @DOCSTRING(daspect)
@@ -464,8 +463,8 @@
 
 See @ref{Text Properties} for the properties that you can set.
 
-@anchor{doc-ylabel}
-@anchor{doc-zlabel}
+@anchor{XREFylabel}
+@anchor{XREFzlabel}
 @DOCSTRING(xlabel)
 
 @DOCSTRING(clabel)
@@ -523,21 +522,6 @@
 
 @DOCSTRING(figure)
 
-@node Use of axis@comma{} line@comma{} and patch Functions
-@subsection Use of axis@comma{} line@comma{} and patch Functions
-
-You can create axes, line, and patch objects directly using the
-@code{axes}, @code{line}, and @code{patch} functions.  These objects
-become children of the current axes object.
-
-@DOCSTRING(axes)
-@DOCSTRING(line)
-@DOCSTRING(patch)
-
-@DOCSTRING(fill)
-
-@DOCSTRING(surface)
-
 @node Manipulation of Plot Windows
 @subsection Manipulation of Plot Windows
 
@@ -911,7 +895,7 @@
 @node Introduction to Graphics Structures
 @subsection Introduction to Graphics Structures
 @cindex introduction to graphics structures
-@anchor{doc-graphics structures}
+@anchor{XREFgraphics structures}
 
 The graphics functions use pointers, which are of class graphics_handle, in
 order to address the data structures which control graphical displays.  A
@@ -931,7 +915,7 @@
 @code{contourf}, @code{contour3}, @code{surf}, @code{mesh}, @code{surfc},
 @code{meshc}, @code{errorbar}, @code{quiver}, @code{quiver3}, @code{scatter},
 @code{scatter3}, @code{stair}, @code{stem}, @code{stem3} each return a handle
-as documented in @ref{doc-datasources,, Data Sources}.
+as documented in @ref{XREFdatasources,,Data Sources}.
 
 
 The graphics objects are arranged in a hierarchy:
@@ -947,21 +931,21 @@
 @code{line}, @code{text}, @code{patch},
 @code{surface}, and @code{image} objects.
 
-Graphics handles may be distinguished from function handles (@ref{Function
-Handles}) by means of the function @code{ishandle}.  @code{ishandle} returns
-true if its argument is a handle of a graphics object.  In addition, the figure
-object may be tested using @code{isfigure}.  @code{isfigure} returns true only
-if its argument is a handle of a figure. ishghandle() is synonymous with
-ishandle().  The @code{whos} function can be used to show the object type of
-each currently defined graphics handle.  (Note: this is not true today, but it
-is, I hope, considered an error in whos.  It may be better to have whos just
-show graphics_handle as the class, and provide a new function which, given a
+Graphics handles may be distinguished from function handles
+(@pxref{Function Handles}) by means of the function @code{ishandle}.
+@code{ishandle} returns true if its argument is a handle of a graphics object. 
+In addition, the figure object may be tested using @code{isfigure}. 
+@code{isfigure} returns true only if its argument is a handle of a figure.  The
+@code{whos} function can be used to show the object type of each currently
+defined graphics handle.  (Note: this is not true today, but it is, I hope,
+considered an error in whos.  It may be better to have whos just show
+graphics_handle as the class, and provide a new function which, given a
 graphics handle, returns its object type.  This could generalize the ishandle()
 functions and, in fact, replace them.)
 
-The @code{get} and @code{set} commands are
-used to obtain and set the values of properties of graphics objects.  In
-addition, the @code{get} command may be used to obtain property names.
+The @code{get} and @code{set} commands are used to obtain and set the values of
+properties of graphics objects.  In addition, the @code{get} command may be
+used to obtain property names.
 
 For example, the property "type" of the graphics object pointed to by the
 graphics handle h may be displayed by:
@@ -999,7 +983,7 @@
 color                 paperposition        windowbuttondownfcn
 colormap              paperpositionmode    windowbuttonmotionfcn
 createfcn             papersize            windowbuttonupfcn
-currentaxes           papertype            windowbuttonwheelfcn
+currentaxes           papertype            windowscrollwheelfcn
 currentcharacter      paperunits           windowstyle
 currentobject         parent               wvisual
 currentpoint          pointer              wvisualmode
@@ -1014,7 +998,7 @@
 @code{get (0, "")}.
 
 The uses of @code{get} and @code{set} are further explained in
-@ref{doc-get,,get}, @ref{doc-set,,set}.
+@ref{XREFget,,get}, @ref{XREFset,,set}.
 
 @DOCSTRING(isprop)
 
@@ -1022,8 +1006,8 @@
 @subsection Graphics Objects
 @cindex graphics objects
 
-The hierarchy of graphics objects was explained above.  (See 
-@ref{Introduction to Graphics Structures}.  Here the
+The hierarchy of graphics objects was explained above.
+@xref{Introduction to Graphics Structures}.  Here the
 specific objects are described, and the properties contained in
 these objects are discussed.  Keep in mind that
 graphics objects are always referenced by @dfn{handle}.
@@ -1035,7 +1019,7 @@
 @cindex root figure graphics object
 @cindex graphics object, root figure
 the top level of the hierarchy and the parent of all figure objects.
-The @code{handle} index of the root figure is 0.
+The handle index of the root figure is 0.
 
 @item figure
 @cindex figure graphics object
@@ -1075,6 +1059,23 @@
 @c @end group
 @end table
 
+@subsubsection Creating Graphics Objects
+@cindex creating graphics objects
+
+You can create axes, line, patch, and surface objects directly using the
+@code{axes}, @code{line}, @code{patch}, @code{fill}, and @code{surface}
+functions.  These objects become children of the current axes object.
+
+@DOCSTRING(axes)
+
+@DOCSTRING(line)
+
+@DOCSTRING(patch)
+
+@DOCSTRING(fill)
+
+@DOCSTRING(surface)
+
 @subsubsection Handle Functions
 @cindex handle functions
 
@@ -1096,6 +1097,8 @@
 
 @DOCSTRING(gca)
 
+@DOCSTRING(gco)
+
 The @code{get} and @code{set} functions may be used to examine and set
 properties for graphics objects.  For example,
 
@@ -1166,6 +1169,31 @@
 
 @DOCSTRING(findfigs)
 
+@cindex saving graphics objects
+
+Figures can be printed or saved in many graphics formats with @code{print} and
+@code{saveas}.  Occasionally, however, it may be useful to save the original
+Octave handle graphic directly so that further modifications can be made such
+as modifying a title or legend.  
+
+This can be accomplished with the following functions by 
+
+@example
+@group
+fig_struct = hdl2struct (gcf);
+save myplot.fig -struct fig_struct;
+@dots{}
+fig_struct = load ("myplot.fig");
+struct2hdl (fig_struct);
+@end group
+@end example
+
+@DOCSTRING(hdl2struct)
+
+@DOCSTRING(struct2hdl)
+
+@DOCSTRING(copyobj)
+
 @node Graphics Object Properties
 @subsection Graphics Object Properties
 @cindex graphics object properties
@@ -1445,7 +1473,7 @@
 these callback functions are called, the @code{"currentpoint"} property
 holds the current coordinates of the cursor.
 
-@item windowbuttonwheelfcn
+@item windowscrollwheelfcn
 
 @item windowstyle
 
@@ -1565,26 +1593,6 @@
 
 @item interruptible
 
-@item key
-Toggle display of the legend.  --- Values: "on," "off"
-Note that this property is not compatible with @sc{matlab} and may be
-removed in a future version of Octave.
-
-@item keybox
-Toggle display of a box around the
-legend.  --- Values: "on," "off"
-Note that this property is not compatible with @sc{matlab} and
-may be removed in a future version of Octave.
-
-@item keypos
-An integer from 1 to 4 specifying the position of the legend.  1
-indicates upper right corner, 2 indicates upper left, 3 indicates lower
-left, and 4 indicates lower right.  Note that this property is not
-compatible with @sc{matlab} and may be removed in a future version of
-Octave.
-
-@item keyreverse
-
 @item layer
 
 @item linestyleorder
@@ -1851,7 +1859,7 @@
 @item ldata
 The lower errorbar in the y direction to be plotted.
 
-@item linestyle
+@item  linestyle
 @itemx linewidth
 @xref{Line Styles}.
 
@@ -2831,7 +2839,7 @@
 @node Data Sources in Object Groups
 @subsubsection Data Sources in Object Groups
 @cindex data sources in object groups
-@anchor{doc-datasources}
+@anchor{XREFdatasources}
 All of the group objects contain data source parameters.  There are
 string parameters that contain an expression that is evaluated to update
 the relevant data property of the group when the @code{refreshdata}
@@ -2839,7 +2847,7 @@
 
 @DOCSTRING(refreshdata)
 
-@anchor{doc-linkdata}
+@anchor{XREFlinkdata}
 @c add the description of the linkdata function here when it is written
 @c remove the explicit anchor when you add the corresponding @DOCSTRING
 @c command
--- a/doc/interpreter/plotimages.m
+++ b/doc/interpreter/plotimages.m
@@ -26,7 +26,7 @@
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
-    d_typ = cstrcat ("-d", typ);
+    d_typ = ["-d", typ];
   endif
 
   if (strcmp(typ , "txt"))
@@ -34,11 +34,11 @@
   elseif (strcmp (nm, "plot"))
     x = -10:0.1:10;
     plot (x, sin (x));
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "hist"))
     rand ("state", 2);
     hist (randn (10000, 1), 30);
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "errorbar"))
     rand ("state", 2);
     x = 0:0.1:10;
@@ -47,32 +47,32 @@
     yu = 0.1 .* rand (size (x));
     errorbar (x, sin (x), yl, yu);
     axis ([0, 10, -1.1, 1.1]);
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "polar"))
     polar (0:0.1:10*pi, 0:0.1:10*pi);
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "mesh"))
     tx = ty = linspace (-8, 8, 41)';
     [xx, yy] = meshgrid (tx, ty);
     r = sqrt (xx .^ 2 + yy .^ 2) + eps;
     tz = sin (r) ./ r;
     mesh (tx, ty, tz);
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "plot3"))
     t = 0:0.1:10*pi;
     r = linspace (0, 1, numel (t));
     z = linspace (0, 1, numel (t));
     plot3 (r.*sin(t), r.*cos(t), z);
-    print (cstrcat (nm, ".", typ), d_typ)    
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "extended"))
     x = 0:0.01:3;
     plot(x,erf(x));
     hold on;
     plot(x,x,"r");
     axis([0, 3, 0, 1]);
-    text(0.65, 0.6175, cstrcat('\leftarrow x = {2/\surd\pi {\fontsize{16}',
-      '\int_{\fontsize{8}0}^{\fontsize{8}x}} e^{-t^2} dt} = 0.6175'))
-    print (cstrcat (nm, ".", typ), d_typ)
+    text(0.65, 0.6175, ['\leftarrow x = {2/\surd\pi {\fontsize{16}', ...
+      '\int_{\fontsize{8}0}^{\fontsize{8}x}} e^{-t^2} dt} = 0.6175']);
+    print ([nm "." typ], d_typ);
   else
     error ("unrecognized plot requested");
   endif
--- a/doc/interpreter/preface.txi
+++ b/doc/interpreter/preface.txi
@@ -64,6 +64,7 @@
 
 @menu
 * Acknowledgements::            
+* Citing Octave in Publications::
 * How You Can Contribute to Octave::  
 * Distribution::                
 @end menu
@@ -86,7 +87,7 @@
 @itemize @bullet
 @item
 The United States Department of Energy, through grant number
-DE-FG02-04ER25635.
+@nospell{DE-FG02-04ER25635}.
 
 @item
 Ashok Krishnamurthy, David Hudak, Juan Carlos Chaves, and Stanley
@@ -98,7 +99,7 @@
 
 @item
 The industrial members of the Texas-Wisconsin Modeling and Control
-Consortium (@uref{http://www.che.utexas.edu/twmcc, TWMCC}).
+Consortium (@url{http://www.che.utexas.edu/twmcc, TWMCC}).
 
 @item
 The Paul A. Elfers Endowed Chair in Chemical Engineering at the
@@ -132,7 +133,7 @@
 Noel Bell, Senior Engineer, Texaco Chemical Company, Austin Texas.
 
 @item
-John A. Turner, Group Leader, Continuum Dynamics (CCS-2), Los Alamos
+John A. Turner, Group Leader, Continuum Dynamics @nospell{(CCS-2)}, Los Alamos
 National Laboratory, for registering the @url{octave.org} domain name.
 
 @item
@@ -146,6 +147,20 @@
 This project would not have been possible without the GNU software used
 in and to produce Octave.
 
+@node Citing Octave in Publications
+@unnumberedsec Citing Octave in Publications
+@cindex Citing Octave
+@cindex Citations
+
+In view of the many contributions made by numerous developers over many years
+it is common courtesy to cite Octave in publications when it has been used 
+during the course of research or the preparation of figures.  The
+@code{citation} function can automatically generate a recommended citation
+text for Octave or any of its packages.  See the help text below on how to
+use @code{citation}.
+
+@DOCSTRING(citation)
+
 @node How You Can Contribute to Octave
 @unnumberedsec How You Can Contribute to Octave
 @cindex contributing to Octave
--- a/doc/interpreter/sparse.txi
+++ b/doc/interpreter/sparse.txi
@@ -89,13 +89,13 @@
 easy to grasp, but requires more storage than is strictly needed.
 
 The storage technique used within Octave is the compressed column
-format. It is similar to the Yale format.
+format.  It is similar to the Yale format.
 @footnote{@url{http://en.wikipedia.org/wiki/Sparse_matrix#Yale_format}}
 In this format the position of each element in a row and the data are
-stored as previously. However, if we assume that all elements in the
+stored as previously.  However, if we assume that all elements in the
 same column are stored adjacent in the computers memory, then we only
 need to store information on the number of non-zero elements in each
-column, rather than their positions. Thus assuming that the matrix has
+column, rather than their positions.  Thus assuming that the matrix has
 more non-zero elements than there are columns in the matrix, we win in
 terms of the amount of memory used.
 
@@ -307,9 +307,8 @@
 
 The above problem of memory reallocation can be avoided in
 oct-files.  However, the construction of a sparse matrix from an oct-file
-is more complex than can be discussed here, and
-you are referred to chapter @ref{Dynamically Linked Functions}, to have
-a full description of the techniques involved.
+is more complex than can be discussed here.  @xref{External Code Interface},
+for a a full description of the techniques involved.
 
 @node Information
 @subsection Finding out Information about Sparse Matrices
@@ -342,7 +341,7 @@
 
 When solving linear equations involving sparse matrices Octave
 determines the means to solve the equation based on the type of the
-matrix as discussed in @ref{Sparse Linear Algebra}.  Octave probes the
+matrix (@pxref{Sparse Linear Algebra}).  Octave probes the
 matrix type when the div (/) or ldiv (\) operator is first used with
 the matrix and then caches the type.  However the @dfn{matrix_type}
 function can be used to determine the type of the sparse matrix prior
@@ -391,7 +390,7 @@
 interconnections between nodes are represented as an adjacency
 matrix.  That is, if the i-th node in a graph is connected to the j-th
 node.  Then the ij-th node (and in the case of undirected graphs the
-ji-th node) of the sparse adjacency matrix is non-zero.  If each node
+@nospell{ji-th} node) of the sparse adjacency matrix is non-zero.  If each node
 is then associated with a set of coordinates, then the @dfn{gplot}
 command can be used to graphically display the interconnections
 between nodes.
@@ -703,7 +702,7 @@
 
 @float Figure,fig:simplechol
 @center @image{spchol,4in}
-@caption{Structure of the un-permuted Cholesky@tie{}factorization of the above matrix.}
+@caption{Structure of the unpermuted Cholesky@tie{}factorization of the above matrix.}
 @end float
 
 @float Figure,fig:simplecholperm
@@ -796,20 +795,20 @@
 a singular or near singular matrix, find a minimum norm solution using
 @sc{cxsparse}@footnote{The @sc{cholmod}, @sc{umfpack} and @sc{cxsparse} packages were
 written by Tim Davis and are available at
-http://www.cise.ufl.edu/research/sparse/}.
+@url{http://www.cise.ufl.edu/research/sparse/}}.
 @end enumerate
 
 The band density is defined as the number of non-zero values in the band
-divided by the total number of values in the full band. The banded
+divided by the total number of values in the full band.  The banded
 matrix solvers can be entirely disabled by using @dfn{spparms} to set
 @code{bandden} to 1 (i.e., @code{spparms ("bandden", 1)}).
 
 The QR@tie{}solver factorizes the problem with a Dulmage-Mendelsohn
 decomposition, to separate the problem into blocks that can be treated
 as over-determined, multiple well determined blocks, and a final
-over-determined block. For matrices with blocks of strongly connected
+over-determined block.  For matrices with blocks of strongly connected
 nodes this is a big win as LU@tie{}decomposition can be used for many
-blocks. It also significantly improves the chance of finding a solution
+blocks.  It also significantly improves the chance of finding a solution
 to over-determined problems rather than just returning a vector of
 @dfn{NaN}'s.
 
--- a/doc/interpreter/sparseimages.m
+++ b/doc/interpreter/sparseimages.m
@@ -26,7 +26,7 @@
   if (__have_feature__ ("COLAMD")
       && __have_feature__ ("CHOLMOD")
       && __have_feature__ ("UMFPACK"))
-    if (strcmp(typ,"txt"))
+    if (strcmp (typ,"txt"))
       txtimages (nm, 15, typ);
     else
       if (strcmp (nm, "gplot"))
@@ -62,14 +62,14 @@
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
-    d_typ = cstrcat ("-d", typ);
+    d_typ = ["-d" typ];
   endif
 
   A = sparse ([2,6,1,3,2,4,3,5,4,6,1,5],
               [1,1,2,2,3,3,4,4,5,5,6,6], 1, 6, 6);
   xy = [0,4,8,6,4,2;5,0,5,7,5,7]';
-  gplot (A, xy)
-  print (cstrcat (nm, ".", typ), d_typ)
+  gplot (A, xy);
+  print ([nm "." typ], d_typ);
   hide_output ();
 endfunction
 
@@ -84,16 +84,16 @@
     fputs (fid, "+---------------------------------+\n");
     fclose (fid);
   elseif (strcmp (nm, "spmatrix"))
-    printsparse(a,cstrcat("spmatrix.",typ));
+    printsparse (a, ["spmatrix." typ]);
   else
     if (__have_feature__ ("COLAMD")
         && __have_feature__ ("CHOLMOD"))
       if (strcmp (nm, "spchol"))
-        r1 = chol(a);
-        printsparse(r1,cstrcat("spchol.",typ));
+        r1 = chol (a);
+        printsparse (r1, ["spchol." typ]);
       elseif (strcmp (nm, "spcholperm"))
-        [r2,p2,q2]=chol(a);
-        printsparse(r2,cstrcat("spcholperm.",typ));
+        [r2,p2,q2] = chol (a);
+        printsparse(r2, ["spcholperm." typ]);
       endif
       ## printf("Text NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2));
     endif
@@ -105,30 +105,30 @@
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
-    d_typ = cstrcat ("-d", typ);
+    d_typ = ["-d" typ];
   endif
 
   a = 10*speye(n) + sparse(1:n,ceil([1:n]/2),1,n,n) + ...
       sparse(ceil([1:n]/2),1:n,1,n,n);
   if (strcmp (nm, "spmatrix"))
-    spy(a);
-    axis("ij")
-    print(cstrcat("spmatrix.",typ), d_typ)
+    spy (a);
+    axis ("ij");
+    print (["spmatrix." typ], d_typ);
     hide_output ();
   else
     if (__have_feature__ ("COLAMD")
         && __have_feature__ ("CHOLMOD"))
       if (strcmp (nm, "spchol"))
-        r1 = chol(a);
-        spy(r1);
-        axis("ij")
-        print(cstrcat("spchol.",typ), d_typ)
+        r1 = chol (a);
+        spy (r1);
+        axis ("ij");
+        print (["spchol." typ], d_typ);
         hide_output ();
       elseif (strcmp (nm, "spcholperm"))
-        [r2,p2,q2]=chol(a);
-        spy(r2);
-        axis("ij")
-        print(cstrcat("spcholperm.",typ), d_typ)
+        [r2,p2,q2] = chol (a);
+        spy (r2);
+        axis ("ij");
+        print (["spcholperm." typ], d_typ);
         hide_output ();
       endif
       ## printf("Image NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2));
@@ -136,42 +136,42 @@
   endif
 endfunction
 
-function printsparse(a, nm)
+function printsparse (a, nm)
   fid = fopen (nm,"wt");
   fputs (fid, "\n");
-  for i = 1:size(a,1)
-    if (rem(i,5) == 0)
+  for i = 1:rows (a)
+    if (rem (i,5) == 0)
       fprintf (fid,"         %2d - ", i);
     else
       fprintf (fid,"            | ");
     endif
-    for j = 1:size(a,2)
+    for j = 1:columns (a)
       if (a(i,j) == 0)
-        fprintf(fid,"  ")
+        fprintf (fid,"  ");
       else
-        fprintf(fid," *")
+        fprintf (fid," *");
       endif
     endfor
-    fprintf(fid,"\n")
+    fprintf (fid,"\n");
   endfor
-  fprintf(fid,"            |-");
-  for j=1:size(a,2)
-    if (rem(j,5)==0)
-      fprintf(fid,"-|");
+  fprintf (fid,"            |-");
+  for j=1:columns (a)
+    if (rem (j,5) == 0)
+      fprintf (fid,"-|");
     else
-      fprintf(fid,"--");
+      fprintf (fid,"--");
     endif
   endfor
-  fprintf(fid,"\n")
-  fprintf(fid,"              ");
-  for j=1:size(a,2)
-    if (rem(j,5)==0)
-      fprintf(fid,"%2d",j);
+  fprintf (fid,"\n");
+  fprintf (fid,"              ");
+  for j=1:columns (a)
+    if (rem (j,5) == 0)
+      fprintf (fid,"%2d",j);
     else
-      fprintf(fid,"  ");
+      fprintf (fid,"  ");
     endif
   endfor
-  fclose(fid);
+  fclose (fid);
 endfunction
 
 function femimages (nm, typ)
@@ -179,7 +179,7 @@
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
-    d_typ = cstrcat ("-d", typ);
+    d_typ = ["-d" typ];
   endif
 
   if (__have_feature__ ("COLAMD")
@@ -190,7 +190,7 @@
     node_x = ones(5,1)*[1,1.05,1.1,1.2,1.3,1.5,1.7,1.8,1.9,1.95,2];
     nodes = [node_x(:), node_y(:)];
 
-    [h,w] = size(node_x);
+    [h,w] = size (node_x);
     elems = [];
     for idx = 1:w-1
       widx = (idx-1)*h;
@@ -198,14 +198,14 @@
       elems = [elems; widx+[(2:h);h+(2:h);h+(1:h-1)]']; 
     endfor
 
-    E = size(elems,1);  #No. of elements
-    N = size(nodes,1);  #No. of elements
-    D = size(elems,2);  #dimensions+1
+    E = size (elems,1);  #No. of elements
+    N = size (nodes,1);  #No. of elements
+    D = size (elems,2);  #dimensions+1
 
     ## Plot FEM Geometry
     elemx = elems(:,[1,2,3,1])';
-    xelems = reshape( nodes(elemx, 1), 4, E);
-    yelems = reshape( nodes(elemx, 2), 4, E);
+    xelems = reshape (nodes(elemx, 1), 4, E);
+    yelems = reshape (nodes(elemx, 2), 4, E);
 
     ## Set element conductivity
     conductivity = [1*ones(1,16),2*ones(1,48),1*ones(1,16)];
@@ -221,43 +221,43 @@
     N_value = [];
 
     ## Calculate connectivity matrix
-    C = sparse((1:D*E), reshape(elems',D*E,1),1, D*E, N);
+    C = sparse ((1:D*E), reshape (elems',D*E,1),1, D*E, N);
 
     ## Calculate stiffness matrix
-    Siidx = floor([0:D*E-1]'/D)*D*ones(1,D) + ones(D*E,1)*(1:D) ;
-    Sjidx = [1:D*E]'*ones(1,D);
-    Sdata = zeros(D*E,D);
-    dfact = prod(2:(D-1));
+    Siidx = floor ([0:D*E-1]'/D)*D*ones(1,D) + ones(D*E,1)*(1:D) ;
+    Sjidx = [1:D*E]'*ones (1,D);
+    Sdata = zeros (D*E,D);
+    dfact = prod (2:(D-1));
     for j = 1:E
-      a = inv([ ones(D,1), nodes( elems(j,:), : ) ]);
+      a = inv ([ ones(D,1), nodes( elems(j,:), : ) ]);
       const = conductivity(j)*2/dfact/abs(det(a));
       Sdata(D*(j-1)+(1:D),:)= const * a(2:D,:)'*a(2:D,:);
     endfor
 
     ## Element-wise system matrix
-    SE = sparse(Siidx,Sjidx,Sdata);
+    SE = sparse (Siidx,Sjidx,Sdata);
     ## Global system matrix
     S = C'* SE *C;
 
     ## Set Dirichlet boundary
-    V = zeros(N,1);
+    V = zeros (N,1);
     V(D_nodes) = D_value;
     idx = 1:N;
     idx(D_nodes) = [];
 
     ## Set Neumann boundary
-    Q = zeros(N,1);
+    Q = zeros (N,1);
     Q(N_nodes) = N_value; # FIXME
 
     V(idx) = S(idx,idx)\( Q(idx) - S(idx,D_nodes)*V(D_nodes) );
 
-    velems = reshape( V(elemx), 4, E);
+    velems = reshape ( V(elemx), 4, E);
 
-    sz = size(xelems,2);
+    sz = size (xelems,2);
 
     plot3 (xelems, yelems, velems);
     view (10, 10);
-    print(cstrcat(nm,".",typ), d_typ)
+    print ([nm "." typ], d_typ);
     hide_output ();
   endif
 endfunction
@@ -281,7 +281,7 @@
     if (strcmp (typ, "eps"))
       d_typ = "-depsc2";
     else
-      d_typ = cstrcat ("-d", typ);
+      d_typ = ["-d" typ];
     endif
 
     x = y = linspace (-8, 8, 41)';
@@ -292,7 +292,7 @@
       mesh (x, y, z);
       title ("Sorry, graphics are unavailable because Octave was\ncompiled without a sparse matrix implementation.");
     unwind_protect_cleanup
-      print (cstrcat (nm, ".", typ), d_typ);
+      print ([nm "." typ], d_typ);
       hide_output ();
     end_unwind_protect
   endif
--- a/doc/interpreter/splineimages.m
+++ b/doc/interpreter/splineimages.m
@@ -26,7 +26,7 @@
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
-    d_typ = cstrcat ("-d", typ);
+    d_typ = ["-d" typ];
   endif
 
   if (strcmp (typ, "txt"))
@@ -47,7 +47,7 @@
     axis tight
     ylim ([-2.5 2.5])
     legend ("data", "41 breaks, 40 pieces", "11 breaks, 10 pieces")
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "splinefit2")) ## Spline orders
     ## Data (200 points)
     x = 2 * pi * rand (1, 200);
@@ -69,7 +69,7 @@
     axis tight
     ylim ([-2.5 2.5])
     legend ({"data", "order 0", "order 1", "order 2", "order 3", "order 4"})
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm, "." typ], d_typ);
   elseif (strcmp (nm, "splinefit3"))
     ## Data (100 points)
     x = 2 * pi * [0, (rand (1, 98)), 1];
@@ -86,7 +86,7 @@
     axis tight
     ylim ([-2 3])
     legend ({"data", "no constraints", "periodic"})
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "splinefit4"))
     ## Data (200 points)
     x = 2 * pi * rand (1, 200);
@@ -109,7 +109,7 @@
     axis tight
     ylim ([-1.5 1.5])
     legend({"data", "clamped", "hinged periodic"})
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "splinefit5"))
     ## Truncated data
     x = [0,  1,  2,  4,  8, 16, 24, 40, 56, 72, 80] / 80;
@@ -130,7 +130,7 @@
     legend ({"data", "spline", "breaks"})
     axis tight
     ylim ([0 0.1])
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   elseif (strcmp (nm, "splinefit6"))
     ## Data
     x = linspace (0, 2*pi, 200);
@@ -153,7 +153,7 @@
             "robust, beta = 0.75", "no robust fitting"})
     axis tight
     ylim ([-2 2])
-    print (cstrcat (nm, ".", typ), d_typ)
+    print ([nm "." typ], d_typ);
   endif
   hide_output ();  
 endfunction
--- a/doc/interpreter/stats.txi
+++ b/doc/interpreter/stats.txi
@@ -42,8 +42,8 @@
 
 It should be noted that the statistics functions don't test for data
 containing NaN, NA, or Inf.  These values need to be detected and dealt
-with explicitly.  See @ref{doc-isnan,,isnan}, @ref{doc-isna,,isna}, 
-@ref{doc-isinf,,isinf}, @ref{doc-isfinite,,isfinite}. 
+with explicitly.  See @ref{XREFisnan,,isnan}, @ref{XREFisna,,isna}, 
+@ref{XREFisinf,,isinf}, @ref{XREFisfinite,,isfinite}. 
 
 @menu
 * Descriptive Statistics::
--- a/doc/interpreter/stmt.txi
+++ b/doc/interpreter/stmt.txi
@@ -259,7 +259,7 @@
 
 @example
 @group
-switch @var{expression}
+switch (@var{expression})
   case @var{label}
     @var{command_list}
   case @var{label}
@@ -288,7 +288,7 @@
 @example
 @group
 A = 7;
-switch A
+switch (A)
   case @{ 6, 7 @}
     printf ("variable is either 6 or 7\n");
   otherwise
@@ -770,7 +770,7 @@
 @cindex @code{unwind_protect_cleanup}
 @cindex @code{end_unwind_protect}
 
-Octave supports a limited form of exception handling modelled after the
+Octave supports a limited form of exception handling modeled after the
 unwind-protect form of Lisp.  
 
 The general form of an @code{unwind_protect} block looks like this:
--- a/doc/interpreter/strings.txi
+++ b/doc/interpreter/strings.txi
@@ -96,7 +96,7 @@
 Represents a literal single-quote character, @samp{'}.
 
 @item \0
-Represents the ``nul'' character, control-@@, ASCII code 0.
+Represents the null character, control-@@, ASCII code 0.
 
 @item \a
 Represents the ``alert'' character, control-g, ASCII code 7.
@@ -158,8 +158,8 @@
 @section Character Arrays
 
 The string representation used by Octave is an array of characters, so
-internally the string "dddddddddd" is actually a row vector of length 10
-containing the value 100 in all places (100 is the ASCII code of "d").  This
+internally the string @nospell{"dddddddddd"} is actually a row vector of length
+10 containing the value 100 in all places (100 is the ASCII code of "d").  This
 lends itself to the obvious generalization to character matrices.  Using a
 matrix of characters, it is possible to represent a collection of same-length
 strings in one variable.  The convention used in Octave is that each row in a
@@ -229,12 +229,29 @@
 @node Concatenating Strings
 @subsection Concatenating Strings
 
-It has been shown above that strings can be concatenated using matrix notation
-(@pxref{Strings}, @ref{Character Arrays}).  Apart from that, there are several
-functions to concatenate string objects: @code{char},
-@code{strvcat}, @code{strcat} and @code{cstrcat}.  In addition, the general
-purpose concatenation functions can be used: see @ref{doc-cat,,cat},
-@ref{doc-horzcat,,horzcat} and @ref{doc-vertcat,,vertcat}.
+Strings can be concatenated using matrix notation
+(@pxref{Strings}, @ref{Character Arrays}) which is often the most natural
+method.  For example:
+
+@example
+@group
+fullname = [fname ".txt"];
+email = ["<" user "@@" domain ">"];
+@end group
+@end example
+
+@noindent
+In each case it is easy to see what the final string will look like.  This
+method is also the most efficient.  When using matrix concatenation the parser
+immediately begins joining the strings without having to process
+the overhead of a function call and the input validation of the associated
+function.
+
+Nevertheless, there are several other functions for concatenating string
+objects which can be useful in specific circumstances: @code{char},
+@code{strvcat}, @code{strcat}, and @code{cstrcat}.  Finally, the general
+purpose concatenation functions can be used: see @ref{XREFcat,,cat},
+@ref{XREFhorzcat,,horzcat}, and @ref{XREFvertcat,,vertcat}.
 
 @itemize @bullet
 @item All string concatenation functions except @code{cstrcat}
@@ -351,7 +368,7 @@
 integer matrices.  @code{int2str} takes the real part of complex values and
 round fractional values to integer.  A more flexible way to format numerical
 data as strings is the @code{sprintf} function (@pxref{Formatted Output},
-@ref{doc-sprintf}).
+@ref{XREFsprintf,,sprintf}).
 
 @DOCSTRING(mat2str)
 
--- a/doc/interpreter/system.txi
+++ b/doc/interpreter/system.txi
@@ -121,7 +121,7 @@
 
 @DOCSTRING(is_leap_year)
 
-@anchor{doc-toc}
+@anchor{XREFtoc}
 @DOCSTRING(tic)
 
 @DOCSTRING(pause)
@@ -177,7 +177,7 @@
 
 @DOCSTRING(umask)
 
-@anchor{doc-lstat}
+@anchor{XREFlstat}
 @DOCSTRING(stat)
 
 @DOCSTRING(S_ISBLK)
@@ -259,6 +259,7 @@
 @menu
 * FTP Objects::
 * URL Manipulation::
+* Base64 and Binary Data Transmission::
 @end menu
 
 @DOCSTRING(gethostname)
@@ -301,6 +302,17 @@
 
 @DOCSTRING(urlwrite)
 
+@node Base64 and Binary Data Transmission
+@subsection Base64 and Binary Data Transmission
+
+Some transmission channels can not accept binary data.  It is customary to
+encode binary data in Base64 for transmission and to decode the data upon
+reception.
+
+@DOCSTRING(base64_encode)
+
+@DOCSTRING(base64_decode)
+
 @node Controlling Subprocesses
 @section Controlling Subprocesses
 
--- a/doc/interpreter/tips.txi
+++ b/doc/interpreter/tips.txi
@@ -347,7 +347,7 @@
 @example
 @group
 -*- texinfo -*-
-@@deftypefn@{Function File@} @{@@var@{ret@} =@} fn (@dots{})
+@@deftypefn @{Function File@} @{@@var@{ret@} =@} fn (@dots{})
 @@cindex index term
 Help text in Texinfo format.  Code samples should be marked 
 like @@code@{sample of code@} and variables should be marked
@@ -366,7 +366,7 @@
 This string signals Octave that the following text is in Texinfo format,
 and should be the first part of any help string in Texinfo format.
 
-@item @@deftypefn@{class@} @dots{} @@end deftypefn
+@item @@deftypefn @{class@} @dots{} @@end deftypefn
 The entire help string should be enclosed within the block defined by
 deftypefn.
 
@@ -394,7 +394,7 @@
 with text terminals as well as generating high-quality printed output.
 To these ends, Texinfo has commands which control the diversion of parts
 of the document into a particular output processor.  Three formats are
-of importance: info, HTML and @TeX{}.  These are selected with
+of importance: info, HTML, and @TeX{}.  These are selected with
 
 @example
 @group
@@ -477,8 +477,8 @@
 @example
 @group
 -*- texinfo -*-
-@@deftypefn @{Function File@} @{@@var@{a@} =@} fn (@@var@{x@}, @dots{})
-@@deftypefnx@{Function File@} @{@@var@{a@} =@} fn (@@var@{y@}, @dots{})
+@@deftypefn  @{Function File@} @{@@var@{a@} =@} fn (@@var@{x@}, @dots{})
+@@deftypefnx @{Function File@} @{@@var@{a@} =@} fn (@@var@{y@}, @dots{})
 Help text in Texinfo format.
 @@end deftypefn
 @end group
--- a/doc/interpreter/var.txi
+++ b/doc/interpreter/var.txi
@@ -49,7 +49,7 @@
 A variable name is a valid expression by itself.  It represents the
 variable's current value.  Variables are given new values with
 @dfn{assignment operators} and @dfn{increment operators}.
-@xref{Assignment Ops, ,Assignment Expressions}.
+@xref{Assignment Ops,,Assignment Expressions}.
 
 There is one built-in variable with a special meaning.  The @code{ans} variable
 always contains the result of the last computation, where the output wasn't
@@ -178,7 +178,7 @@
 @cindex persistent variables
 @cindex @code{persistent} statement
 @cindex variables, persistent
-@anchor{doc-persistent}
+@anchor{XREFpersistent}
 
 A variable that has been declared @dfn{persistent} within a function
 will retain its contents in memory between subsequent calls to the
@@ -299,8 +299,8 @@
 variable will be cleared by a simple @code{clear} command as the entire
 function definition will be removed from memory.  If you do not want
 a persistent variable to be removed from memory even if the function is
-cleared, you should use the @code{mlock} function as described in
-@xref{Function Locking}.
+cleared, you should use the @code{mlock} function
+(@pxref{Function Locking}).
 
 @node Status of Variables
 @section Status of Variables
--- a/doc/interpreter/vectorize.txi
+++ b/doc/interpreter/vectorize.txi
@@ -42,6 +42,7 @@
 * Broadcasting::               Broadcasting operations
 * Function Application::       Applying functions to arrays, cells, and structs
 * Accumulation::               Accumulation functions
+* JIT Compiler::               Just-In-Time Compiler for loops
 * Miscellaneous Techniques::   Other techniques for speeding up code
 * Examples::
 @end menu
@@ -111,7 +112,7 @@
 @example
 @group
 for i = 1:n
-  if a(i) > 5
+  if (a(i) > 5)
     a(i) -= 20
   endif
 endfor
@@ -456,7 +457,7 @@
 that may have relied on matrices of different size producing an error.
 Due to how broadcasting changes semantics with older versions of Octave,
 by default Octave warns if a broadcasting operation is performed.  To
-disable this warning, refer to its ID (@pxref{doc-warning_ids}):
+disable this warning, refer to its ID (@pxref{XREFwarning_ids,,warning_ids}):
 
 @example
 warning ("off", "Octave:broadcast");
@@ -506,6 +507,39 @@
 
 @DOCSTRING(accumdim)
 
+@node JIT Compiler
+@section JIT Compiler
+
+Vectorization is the preferred technique for eliminating loops and speeding up
+code.  Nevertheless, it is not always possible to replace every loop.  In such
+situations it may be worth trying Octave's @strong{experimental} Just-In-Time
+(JIT) compiler.
+
+A JIT compiler works by analyzing the body of a loop, translating the Octave
+statements into another language, compiling the new code segment into an
+executable, and then running the executable and collecting any results.  The
+process is not simple and there is a significant amount of work to perform for
+each step.  It can still make sense, however, if the number of loop iterations
+is large.  Because Octave is an interpreted language every time through a
+loop Octave must parse the statements in the loop body before executing them.
+With a JIT compiler this is done just once when the body is translated to
+another language.
+
+The JIT compiler is a very new feature in Octave and not all valid Octave
+statements can currently be accelerated.  However, if no other technique
+is available it may be worth benchmarking the code with JIT enabled.  The
+function @code{jit_enable} is used to turn compilation on or off.  The
+function @code{jit_startcnt} sets the threshold for acceleration.  Loops
+with iteration counts above @code{jit_startcnt} will be accelerated.  The
+function @code{debug_jit} is not likely to be of use to anyone not working
+directly on the implementation of the JIT compiler.
+
+@DOCSTRING(jit_enable)
+
+@DOCSTRING(jit_startcnt)
+
+@DOCSTRING(debug_jit)
+
 @node Miscellaneous Techniques
 @section Miscellaneous Techniques
 @cindex execution speed
--- a/examples/@FIRfilter/subsref.m
+++ b/examples/@FIRfilter/subsref.m
@@ -1,5 +1,5 @@
 function out = subsref (f, x)
-  switch x.type
+  switch (x.type)
     case "()"
       n = f.polynomial;
       out = filter (n.poly, 1, x.subs{1});
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -34,14 +34,13 @@
   addtwomatrices.cc \
   celldemo.cc \
   embedded.cc \
-  firstmexdemo.c \
   fortdemo.cc \
   fortsub.f \
   funcdemo.cc \
   globaldemo.cc \
-  hello.cc \
   helloworld.cc \
   make_int.cc \
+  mex_demo.c \
   mycell.c \
   myfeval.c \
   myfevalf.f \
@@ -53,6 +52,7 @@
   mysparse.c \
   mystring.c \
   mystruct.c \
+  oct_demo.cc \
   oregonator.cc \
   oregonator.m \
   paramdemo.cc \
--- a/examples/addtwomatrices.cc
+++ b/examples/addtwomatrices.cc
@@ -3,6 +3,7 @@
 DEFUN_DLD (addtwomatrices, args, , "Add A to B")
 {
   int nargin = args.length ();
+
   if (nargin != 2)
     print_usage ();
   else
@@ -12,5 +13,6 @@
       if (! error_state)
         return octave_value (A + B);
     }
+
   return octave_value_list ();
 }
--- a/examples/celldemo.cc
+++ b/examples/celldemo.cc
@@ -10,10 +10,13 @@
     print_usage ();
   else
     {
-      Cell c = args (0).cell_value ();
+      Cell c = args(0).cell_value ();
       if (! error_state)
-        for (octave_idx_type i = 0; i < c.nelem (); i++)
-          retval(i) = c.elem (i);
+        for (octave_idx_type i = 0; i < c.numel (); i++)
+          {
+            retval(i) = c(i);          // using operator syntax
+            //retval(i) = c.elem (i);  // using method syntax
+          }
     }
 
   return retval;
--- a/examples/embedded.cc
+++ b/examples/embedded.cc
@@ -20,7 +20,6 @@
   
   octave_value_list out = feval ("gcd", in, 1);
 
-  
   if (!error_state && out.length () > 0)
     std::cout << "GCD of [" 
               << in(0).int_value () 
--- a/examples/fortdemo.cc
+++ b/examples/fortdemo.cc
@@ -9,10 +9,11 @@
          F77_CHAR_ARG_LEN_DECL);
 }
 
-DEFUN_DLD (fortdemo , args , , "Fortran Demo.")
+DEFUN_DLD (fortdemo, args, , "Fortran Demo")
 {
   octave_value_list retval;
   int nargin = args.length ();
+
   if (nargin != 1)
     print_usage ();
   else
@@ -21,7 +22,7 @@
       if (! error_state)
         {
           double *av = a.fortran_vec ();
-          octave_idx_type na = a.nelem ();
+          octave_idx_type na = a.numel ();
           OCTAVE_LOCAL_BUFFER (char, ctmp, 128);
 
           F77_XFCN (fortsub, FORTSUB, (na, av, ctmp
--- a/examples/funcdemo.cc
+++ b/examples/funcdemo.cc
@@ -3,8 +3,8 @@
 
 DEFUN_DLD (funcdemo, args, nargout, "Function Demo")
 {
+  octave_value_list retval;
   int nargin = args.length ();
-  octave_value_list retval;
 
   if (nargin < 2)
     print_usage ();
@@ -12,9 +12,8 @@
     {
       octave_value_list newargs;
       for (octave_idx_type i = nargin - 1; i > 0; i--)
-        newargs (i - 1) = args(i);
-      if (args(0).is_function_handle ()
-          || args(0).is_inline_function ())
+        newargs(i-1) = args(i);
+      if (args(0).is_function_handle () || args(0).is_inline_function ())
         {
           octave_function *fcn = args(0).function_value ();
           if (! error_state)
@@ -22,13 +21,12 @@
         }
       else if (args(0).is_string ())
         {
-          std::string fcn = args (0).string_value ();
+          std::string fcn = args(0).string_value ();
           if (! error_state)
             retval = feval (fcn, newargs, nargout);
         }
       else
-        error ("funcdemo: expected string,",
-               " inline or function handle");
+        error ("funcdemo: INPUT must be string, inline, or function handle");
     }
   return retval;
 }
--- a/examples/globaldemo.cc
+++ b/examples/globaldemo.cc
@@ -1,9 +1,9 @@
 #include <octave/oct.h>
 
-DEFUN_DLD (globaldemo, args, , "Global demo.")
+DEFUN_DLD (globaldemo, args, , "Global Demo")
 {
+  octave_value retval;
   int nargin = args.length ();
-  octave_value retval;
 
   if (nargin != 1)
     print_usage ();
--- a/examples/helloworld.cc
+++ b/examples/helloworld.cc
@@ -4,8 +4,10 @@
   "Hello World Help String")
 {
   int nargin = args.length ();
-  octave_stdout << "Hello World has " << nargin
-        << " input arguments and "
-        << nargout << " output arguments.\n";
+
+  octave_stdout << "Hello World has "
+                << nargin << " input arguments and "
+                << nargout << " output arguments.\n";
+
   return octave_value_list ();
 }
rename from examples/firstmexdemo.c
rename to examples/mex_demo.c
--- a/examples/firstmexdemo.c
+++ b/examples/mex_demo.c
@@ -1,11 +1,58 @@
+// mex_demo.c -- example of a dynamically linked function for Octave.
+
+// To use this file, your version of Octave must support dynamic
+// linking.  To find out if it does, type the command
+//
+//   octave_config_info ("ENABLE_DYNAMIC_LINKING")
+//
+// at the Octave prompt.  Support for dynamic linking is included if
+// this expression returns the string "yes".
+//
+// To compile this file, type the command
+//
+//   mkoctfile mex_demo.c
+//
+// from within Octave or from the shell prompt.  This will create a file
+// called mex_demo.mex that can be loaded by Octave.  To test the mex_demo.mex
+// file, start Octave and type the command
+//
+// [d] = mex_demo ("easy as", 1, 2, 3)
+//
+// at the Octave prompt.  Octave should respond by printing
+//
+//   Hello, world!
+//   I have 4 inputs and 1 output
+//   d =  1.2346
+
+// Additional samples of code are in the examples directory of the Octave
+// distribution.  See also the chapter External Code Interface in the
+// documentation.
+
 #include "mex.h"
 
+// Every user function should include "mex.h" which imports the basic set of
+// function prototypes necessary for dynamically linked functions.  In
+// particular, it will declare mexFunction which is used by every function
+// which will be visible to Octave.  A mexFunction is visible in Octave under
+// the name of the source code file without the extension.
+
+// The four arguments to mexFunction are:
+// 1) The number of return arguments (# of left-hand side args).
+// 2) An array of pointers to return arguments.
+// 3) The number of input arguments (# of right-hand side args).
+// 4) An array of pointers to input arguments.
+
 void
-mexFunction (int nlhs, mxArray *plhs[], int nrhs, 
-             const mxArray *prhs[])
+mexFunction (int nlhs, mxArray *plhs[],
+             int nrhs, const mxArray *prhs[])
 {
+  mexPrintf ("Hello, World!\n");
+
+  mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs);
+
   mxArray *v = mxCreateDoubleMatrix (1, 1, mxREAL);
   double *data = mxGetPr (v);
   *data = 1.23456789;
+
   plhs[0] = v;
 }
--- a/examples/mycell.c
+++ b/examples/mycell.c
@@ -1,14 +1,14 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray* plhs[], int nrhs, 
-             const mxArray* prhs[])
+mexFunction (int nlhs, mxArray* plhs[],
+             int nrhs, const mxArray* prhs[])
 {
   mwSize n;
   mwIndex i;
 
   if (nrhs != 1 || ! mxIsCell (prhs[0]))
-    mexErrMsgTxt ("expects cell");
+    mexErrMsgTxt ("ARG1 must be a cell");
 
   n = mxGetNumberOfElements (prhs[0]);
   n = (n > nlhs ? nlhs : n);
--- a/examples/myfeval.c
+++ b/examples/myfeval.c
@@ -1,24 +1,23 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray* plhs[], int nrhs, 
-             const mxArray* prhs[])
+mexFunction (int nlhs, mxArray* plhs[],
+             int nrhs, const mxArray* prhs[])
 {
   char *str;
 
   mexPrintf ("Hello, World!\n");
 
-  mexPrintf ("I have %d inputs and %d outputs\n", nrhs,
-             nlhs);
+  mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs);
 
   if (nrhs < 1 || ! mxIsString (prhs[0])) 
-    mexErrMsgTxt ("function name expected");
+    mexErrMsgTxt ("ARG1 must be a function name");
 
   str = mxArrayToString (prhs[0]);
 
   mexPrintf ("I'm going to call the function %s\n", str);
 
-  mexCallMATLAB (nlhs, plhs, nrhs-1, prhs+1, str);
+  mexCallMATLAB (nlhs, plhs, nrhs-1, (mxArray*)prhs+1, str);
 
   mxFree (str);
 }
--- a/examples/myfunc.c
+++ b/examples/myfunc.c
@@ -1,13 +1,15 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray *plhs[], int nrhs, 
-             const mxArray *prhs[])
+mexFunction (int nlhs, mxArray *plhs[],
+             int nrhs, const mxArray *prhs[])
 {
   const char *nm;
+
   nm = mexFunctionName ();
   mexPrintf ("You called function: %s\n", nm);
   if (strcmp (nm, "myfunc") == 0)
     mexPrintf ("This is the principal function\n", nm);
+
   return; 
 }
--- a/examples/myhello.c
+++ b/examples/myhello.c
@@ -1,13 +1,10 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+mexFunction (int nlhs, mxArray *plhs[],
+             int nrhs, const mxArray *prhs[])
 {
-  mxArray *v = mxCreateDoubleMatrix (1, 1, mxREAL);
+  mexPrintf ("Hello, World!\n");
 
-  double *data = mxGetPr (v);
-
-  *data = 1.23456789;
-
-  plhs[0] = v;
+  mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs);
 }
--- a/examples/mypow2.c
+++ b/examples/mypow2.c
@@ -1,21 +1,20 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray* plhs[], int nrhs, 
-             const mxArray* prhs[])
+mexFunction (int nlhs, mxArray* plhs[],
+             int nrhs, const mxArray* prhs[])
 {
+  mwSize n;
   mwIndex i;
-  mwSize n;
   double *vri, *vro;
   
   if (nrhs != 1 || ! mxIsNumeric (prhs[0]))
-    mexErrMsgTxt ("expects matrix");
+    mexErrMsgTxt ("ARG1 must be a matrix");
 
   n = mxGetNumberOfElements (prhs[0]);
-  plhs[0] = (mxArray *) mxCreateNumericArray 
-    (mxGetNumberOfDimensions (prhs[0]),
-     mxGetDimensions (prhs[0]), mxGetClassID (prhs[0]),
-     mxIsComplex (prhs[0]));
+  plhs[0] = mxCreateNumericArray 
+    (mxGetNumberOfDimensions (prhs[0]), mxGetDimensions (prhs[0]),
+     mxGetClassID (prhs[0]), mxIsComplex (prhs[0]));
   vri = mxGetPr (prhs[0]);
   vro = mxGetPr (plhs[0]);
 
@@ -27,13 +26,13 @@
 
       for (i = 0; i < n; i++)
         {
-          vro [i] = vri [i] * vri [i] - vii [i] * vii [i];
-          vio [i] = 2 * vri [i] * vii [i];
+          vro[i] = vri[i] * vri[i] - vii[i] * vii[i];
+          vio[i] = 2 * vri[i] * vii[i];
         }
     }
   else
     {
       for (i = 0; i < n; i++)
-        vro [i] = vri [i] * vri [i];
+        vro[i] = vri[i] * vri[i];
     }
 }
--- a/examples/myprop.c
+++ b/examples/myprop.c
@@ -1,7 +1,8 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
+mexFunction (int nlhs, mxArray* plhs[],
+             int nrhs, const mxArray* prhs[])
 {
   double handle;
   char property[256];
@@ -21,5 +22,3 @@
     if (mexSet (handle, property, mxDuplicateArray (prhs[2])))
       mexErrMsgTxt ("failed to set property");
 }
-  
-
--- a/examples/myset.c
+++ b/examples/myset.c
@@ -1,7 +1,8 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
+mexFunction (int nlhs, mxArray* plhs[],
+             int nrhs, const mxArray* prhs[])
 {
   char *str;
   mxArray *v;
@@ -16,7 +17,7 @@
   if (v)
     {
       mexPrintf ("%s is a global variable with the following value:\n", str);
-      mexCallMATLAB (0, 0, 1, &v, "disp");
+      mexCallMATLAB (0, NULL, 1, &v, "disp");
     }
 
   v = mexGetArray (str, "caller");
@@ -24,7 +25,7 @@
   if (v)
     {
       mexPrintf ("%s is a caller variable with the following value:\n", str);
-      mexCallMATLAB (0, 0, 1, &v, "disp");
+      mexCallMATLAB (0, NULL, 1, &v, "disp");
     }
 
   // WARNING!! Can't do this in MATLAB!  Must copy variable first.
--- a/examples/mysparse.c
+++ b/examples/mysparse.c
@@ -1,10 +1,10 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray *plhs[], int nrhs, 
-             const mxArray *prhs[])
+mexFunction (int nlhs, mxArray *plhs[],
+             int nrhs, const mxArray *prhs[])
 {
-  mwSize n, m, nz;
+  mwSize m, n, nz;
   mxArray *v;
   mwIndex i;
   double *pr, *pi;
@@ -13,16 +13,15 @@
   mwIndex *ir2, *jc2;
   
   if (nrhs != 1 || ! mxIsSparse (prhs[0]))
-    mexErrMsgTxt ("expects sparse matrix");
+    mexErrMsgTxt ("ARG1 must be a sparse matrix");
 
-  m = mxGetM (prhs [0]);
-  n = mxGetN (prhs [0]);
-  nz = mxGetNzmax (prhs [0]);
+  m = mxGetM (prhs[0]);
+  n = mxGetN (prhs[0]);
+  nz = mxGetNzmax (prhs[0]);
   
   if (mxIsComplex (prhs[0]))
     {
-      mexPrintf ("Matrix is %d-by-%d complex",
-                 " sparse matrix", m, n);
+      mexPrintf ("Matrix is %d-by-%d complex sparse matrix", m, n);
       mexPrintf (" with %d elements\n", nz);
 
       pr = mxGetPr (prhs[0]);
@@ -32,9 +31,9 @@
 
       i = n;
       while (jc[i] == jc[i-1] && i != 0) i--;
-      mexPrintf ("last non-zero element (%d, %d) =", 
-                 ir[nz-1]+ 1, i);
-      mexPrintf (" (%g, %g)\n", pr[nz-1], pi[nz-1]);
+
+      mexPrintf ("last non-zero element (%d, %d) = (%g, %g)\n",
+                 ir[nz-1]+ 1, i, pr[nz-1], pi[nz-1]);
 
       v = mxCreateSparse (m, n, nz, mxCOMPLEX);
       pr2 = mxGetPr (v);
@@ -57,8 +56,7 @@
   else if (mxIsLogical (prhs[0]))
     {
       mxLogical *pbr, *pbr2;
-      mexPrintf ("Matrix is %d-by-%d logical",
-                 " sparse matrix", m, n);
+      mexPrintf ("Matrix is %d-by-%d logical sparse matrix", m, n);
       mexPrintf (" with %d elements\n", nz);
 
       pbr = mxGetLogicals (prhs[0]);
@@ -88,8 +86,7 @@
     }
   else
     {
-      mexPrintf ("Matrix is %d-by-%d real",
-                 " sparse matrix", m, n);
+      mexPrintf ("Matrix is %d-by-%d real sparse matrix", m, n);
       mexPrintf (" with %d elements\n", nz);
 
       pr = mxGetPr (prhs[0]);
@@ -99,7 +96,7 @@
       i = n;
       while (jc[i] == jc[i-1] && i != 0) i--;
       mexPrintf ("last non-zero element (%d, %d) = %g\n",
-                ir[nz-1]+ 1, i, pr[nz-1]);
+                 ir[nz-1]+ 1, i, pr[nz-1]);
 
       v = mxCreateSparse (m, n, nz, mxREAL);
       pr2 = mxGetPr (v);
--- a/examples/mystring.c
+++ b/examples/mystring.c
@@ -2,25 +2,24 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray *plhs[], int nrhs, 
-             const mxArray *prhs[])
+mexFunction (int nlhs, mxArray *plhs[],
+             int nrhs, const mxArray *prhs[])
 {
+  mwSize m, n;
   mwIndex i, j;
-  mwSize m, n;
   mxChar *pi, *po;
 
   if (nrhs != 1 || ! mxIsChar (prhs[0]) || 
       mxGetNumberOfDimensions (prhs[0]) > 2)
-    mexErrMsgTxt ("expecting char matrix");
+    mexErrMsgTxt ("ARG1 must be a char matrix");
 
   m = mxGetM (prhs[0]);
   n = mxGetN (prhs[0]);
   pi = mxGetChars (prhs[0]);
-  plhs[0] = mxCreateNumericMatrix (m, n, mxCHAR_CLASS, 
-                                   mxREAL);
+  plhs[0] = mxCreateNumericMatrix (m, n, mxCHAR_CLASS, mxREAL);
   po = mxGetChars (plhs[0]);
 
   for (j = 0; j < n; j++)
     for (i = 0; i < m; i++)
-      po [j*m + m - 1 - i] = pi [j*m + i];
+      po[j*m + m - 1 - i] = pi[j*m + i];
 }
--- a/examples/mystruct.c
+++ b/examples/mystruct.c
@@ -1,8 +1,8 @@
 #include "mex.h"
 
 void
-mexFunction (int nlhs, mxArray* plhs[], int nrhs, 
-             const mxArray* prhs[])
+mexFunction (int nlhs, mxArray* plhs[],
+             int nrhs, const mxArray* prhs[])
 {
   int i;
   mwIndex j;
@@ -18,7 +18,7 @@
         mexPrintf ("field %s(%d) = ", 
                    mxGetFieldNameByNumber (prhs[0], i), j);
         v = mxGetFieldByNumber (prhs[0], j, i);
-        mexCallMATLAB (0, 0, 1, &v, "disp");
+        mexCallMATLAB (0, NULL, 1, &v, "disp");
       }
 
   v = mxCreateStructMatrix (2, 2, 2, keys);
rename from examples/hello.cc
rename to examples/oct_demo.cc
--- a/examples/hello.cc
+++ b/examples/oct_demo.cc
@@ -1,4 +1,4 @@
-// hello.cc -- example of a dynamically linked function for Octave.
+// oct_demo.cc -- example of a dynamically linked function for Octave.
 
 // To use this file, your version of Octave must support dynamic
 // linking.  To find out if it does, type the command
@@ -6,18 +6,17 @@
 //   octave_config_info ("ENABLE_DYNAMIC_LINKING")
 //
 // at the Octave prompt.  Support for dynamic linking is included if
-// this expression returns the string "true".
+// this expression returns the string "yes".
 //
 // To compile this file, type the command
 //
-//   mkoctfile hello.cc
+//   mkoctfile oct_demo.cc
 //
-// at the shell prompt.  The script mkoctfile should have been
-// installed along with Octave.  Running it will create a file called
-// hello.oct that can be loaded by Octave.  To test the hello.oct
-// file, start Octave and type the command
+// from within Octave or from the shell prompt.  This will create a file
+// called oct_demo.oct that can be loaded by Octave.  To test the
+// oct_demo.oct file, start Octave and type the command
 //
-//   hello ("easy as", 1, 2, 3)
+//   oct_demo ("easy as", 1, 2, 3)
 //
 // at the Octave prompt.  Octave should respond by printing
 //
@@ -28,47 +27,34 @@
 //   3
 //   ans = 3
 
-// Additional examples are available in the files in the src directory
-// of the Octave distribution that use the macro DEFUN_DLD_BUILTIN.
-// Currently, this includes the files
-//
-//   balance.cc  fft.cc      ifft.cc     minmax.cc   sort.cc
-//   chol.cc     fft2.cc     ifft2.cc    pinv.cc     svd.cc
-//   colloc.cc   filter.cc   inv.cc      qr.cc       syl.cc
-//   dassl.cc    find.cc     log.cc      quad.cc
-//   det.cc      fsolve.cc   lsode.cc    qzval.cc
-//   eig.cc      givens.cc   lu.cc       rand.cc
-//   expm.cc     hess.cc     minmax.cc   schur.cc
-//
-// The difference between DEFUN_DLD and DEFUN_DLD_BUILTIN is that
-// DEFUN_DLD_BUILTIN can define a built-in function that is not
-// dynamically loaded if the operating system does not support dynamic
-// linking.  To define your own dynamically linked functions you
-// should use DEFUN_DLD.
-
-#include <octave/config.h>
+// Additional samples of real dynamically loaded functions are available in
+// the files of the libinterp/dldfcn directory of the Octave distribution.
+// See also the chapter External Code Interface in the documentation.
 
 #include <iostream>
 
-#include <octave/defun-dld.h>
-#include <octave/error.h>
-#include <octave/oct-obj.h>
-#include <octave/pager.h>
-#include <octave/symtab.h>
-#include <octave/variables.h>
+#include <octave/oct.h>
 
-// DEFUN_DLD and the macros that it depends on are defined in the
-// files defun-dld.h, defun.h, and defun-int.h.
+// Every user function should include <octave/oct.h> which imports the
+// basic set of Octave header files required.  In particular this will define
+// the DEFUN_DLD macro (defun-dld.h) which is used for every user function
+// that is visible to Octave.
 
-// Note that the third parameter (nargout) is not used, so it is
-// omitted from the list of arguments to DEFUN_DLD in order to avoid
-// the warning from gcc about an unused function parameter.
+// The four arguments to the DEFUN_DLD macro are:
+// 1) The function name as seen in Octave.
+// 2) The variable to hold any inputs (of type octave_value_list)
+// 3) The number of output arguments
+// 4) A string to use as help text if 'help <function_name>' is entered.
+//
+// Note below that the third parameter (nargout) of DEFUN_DLD is not used,
+// so it is omitted from the list of arguments in order to avoid a warning
+// from gcc about an unused function parameter.
 
-DEFUN_DLD (hello, args, ,
-  "[...] = hello (...)\n\
+DEFUN_DLD (oct_demo, args, ,
+  "[...] = oct_demo (...)\n\
 \n\
-Print greeting followed by the values of all the arguments passed.\n\
-Returns all arguments in reverse order.")
+Print a greeting followed by the values of all the arguments passed.\n\
+Return all arguments in reverse order.")
 {
   // The list of values to return.  See the declaration in oct-obj.h
 
@@ -78,14 +64,14 @@
 
   octave_stdout << "Hello, world!\n";
 
-  // The arguments to this function are available in args.
+  // The inputs to this function are available in args.
 
   int nargin = args.length ();
 
-  // The octave_value_list class is a zero-based array of octave_value
-  // objects.  The declaration for the octave_value class is in the
-  // file ov.h.  The print() method will send its output to
-  // octave_stdout, so it will also end up going through the pager.
+  // The octave_value_list class is a zero-based array of octave_value objects.
+  // The declaration for the octave_value class is in the file ov.h.
+  // The print() method will send its output to octave_stdout,
+  // so it will also end up going through the pager.
 
   for (int i = 0; i < nargin; i++)
     {
--- a/examples/paramdemo.cc
+++ b/examples/paramdemo.cc
@@ -1,15 +1,14 @@
 #include <octave/oct.h>
 
-DEFUN_DLD (paramdemo, args, nargout,
-           "Parameter Check Demo.")
+DEFUN_DLD (paramdemo, args, nargout, "Parameter Check Demo")
 {
+  octave_value retval;
   int nargin = args.length ();
-  octave_value retval;
 
   if (nargin != 1)
     print_usage ();
   else if (nargout != 0)
-    error ("paramdemo: function has no output arguments");
+    error ("paramdemo: OUTPUT argument required");
   else
     {
       NDArray m = args(0).array_value ();
@@ -21,14 +20,11 @@
       if (m.any_element_is_inf_or_nan ())
         octave_stdout << "  includes Inf or NaN values\n";
       if (m.any_element_not_one_or_zero ())
-        octave_stdout <<
-          "  includes other values than 1 and 0\n";
+        octave_stdout << "  includes other values than 1 and 0\n";
       if (m.all_elements_are_int_or_inf_or_nan ())
-        octave_stdout <<
-          "  includes only int, Inf or NaN values\n";
+        octave_stdout << "  includes only int, Inf or NaN values\n";
       if (m.all_integers (min_val, max_val))
-        octave_stdout <<
-          "  includes only integers in [-10,10]\n";
+        octave_stdout << "  includes only integers in [-10,10]\n";
     }
   return retval;
 }
--- a/examples/standalone.cc
+++ b/examples/standalone.cc
@@ -5,15 +5,15 @@
 main (void)
 {
   std::cout << "Hello Octave world!\n";
+
   int n = 2;
   Matrix a_matrix = Matrix (n, n);
+
   for (octave_idx_type i = 0; i < n; i++)
-    {
-      for (octave_idx_type j = 0; j < n; j++)
-        {
-          a_matrix (i, j) = (i + 1) * 10 + (j + 1);
-        }
-    }
+    for (octave_idx_type j = 0; j < n; j++)
+      a_matrix(i,j) = (i + 1) * 10 + (j + 1);
+
   std::cout << a_matrix;
+
   return 0;
 }
--- a/examples/stringdemo.cc
+++ b/examples/stringdemo.cc
@@ -2,8 +2,8 @@
 
 DEFUN_DLD (stringdemo, args, , "String Demo")
 {
+  octave_value_list retval;
   int nargin = args.length ();
-  octave_value_list retval;
 
   if (nargin != 1)
     print_usage ();
@@ -13,20 +13,16 @@
 
       if (! error_state)
         {
-          if (args(0).is_sq_string ())
-            retval(1) = octave_value (ch, true);
-          else
-            retval(1) = octave_value (ch, true, '\'');
+          retval(1) = octave_value (ch, '\'');  // Single Quote String
 
           octave_idx_type nr = ch.rows ();
           for (octave_idx_type i = 0; i < nr / 2; i++)
             {
               std::string tmp = ch.row_as_string (i);
-              ch.insert (ch.row_as_string (nr-i-1).c_str (),
-                         i, 0);
+              ch.insert (ch.row_as_string (nr-i-1).c_str (), i, 0);
               ch.insert (tmp.c_str (), nr-i-1, 0);
             }
-          retval(0) = octave_value (ch, true);
+          retval(0) = octave_value (ch, '"');  // Double Quote String
         }
     }
   return retval;
--- a/examples/structdemo.cc
+++ b/examples/structdemo.cc
@@ -1,14 +1,15 @@
 #include <octave/oct.h>
 #include <octave/ov-struct.h>
 
-DEFUN_DLD (structdemo, args, , "Struct demo.")
+DEFUN_DLD (structdemo, args, , "Struct Demo")
 {
+  octave_value retval;
   int nargin = args.length ();
-  octave_value retval;
 
   if (args.length () == 2)
     {
       octave_scalar_map arg0 = args(0).scalar_map_value ();
+      //octave_map arg0 = args(0).map_value ();
 
       if (! error_state)
         {
@@ -17,6 +18,7 @@
           if (! error_state)
             {
               octave_value tmp = arg0.contents (arg1);
+              //octave_value tmp = arg0.contents (arg1)(0);
 
               if (tmp.is_defined ())
                 {
@@ -27,18 +29,17 @@
                   retval = octave_value (st);
                 }
               else
-                error ("sruct does not contain field named '%s'\n",
+                error ("structdemo: struct does not have a field named '%s'\n",
                        arg1.c_str ());
             }
           else
-            error ("expecting character string as second argument");
+            error ("structdemo: ARG2 must be a character string");
         }
       else
-        error ("expecting struct as first argument");
+        error ("structdemo: ARG1 must be a struct");
     }
   else
     print_usage ();
 
   return retval;
 }
-
--- a/examples/unwinddemo.cc
+++ b/examples/unwinddemo.cc
@@ -2,15 +2,16 @@
 #include <octave/unwind-prot.h>
 
 void
-err_hand (const char *fmt, ...)
+my_err_handler (const char *fmt, ...)
 {
   // Do nothing!!
 }
 
 DEFUN_DLD (unwinddemo, args, nargout, "Unwind Demo")
 {
+  octave_value retval;
   int nargin = args.length ();
-  octave_value retval;
+
   if (nargin < 2)
     print_usage ();
   else
@@ -20,11 +21,13 @@
 
       if (! error_state)
         {
-          unwind_protect::begin_frame ("Funwinddemo");
-          unwind_protect_ptr (current_liboctave_warning_handler);
-          set_liboctave_warning_handler (err_hand);
+          // Declare unwind_protect frame which lasts as long as
+          // the variable frame has scope.
+          unwind_protect frame;
+          frame.protect_var (current_liboctave_warning_handler);
+
+          set_liboctave_warning_handler (my_err_handler);
           retval = octave_value (quotient (a, b));
-          unwind_protect::run_frame ("Funwinddemo");
         }
     }
   return retval;
--- a/libgui/Makefile.am
+++ b/libgui/Makefile.am
@@ -31,6 +31,7 @@
   languages/de_DE.ts \
   languages/en_US.ts \
   languages/es_ES.ts \
+  languages/fr_FR.ts \
   languages/nl_NL.ts \
   languages/pt_BR.ts \
   languages/ru_RU.ts \
--- a/libgui/languages/be_BY.ts
+++ b/libgui/languages/be_BY.ts
@@ -2,53 +2,98 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="be_BY">
 <context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>documentation_dock_widget</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
         <source>Documentation</source>
         <translation type="unfinished">Дакументацыя</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>file_editor</name>
     <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+38"/>
+        <location line="+117"/>
         <source>Could not open file %1 for read:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+43"/>
+        <location line="+49"/>
         <source>File not saved! A file with the selected name
 %1
 is already open in the editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
+        <location line="+28"/>
         <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+205"/>
         <source>&amp;%1 %2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+130"/>
+        <location line="+159"/>
         <source>&amp;New File</source>
         <translation type="unfinished">&amp;Новы файл</translation>
     </message>
@@ -68,6 +113,11 @@
         <translation type="unfinished">Захаваць файл &amp;як</translation>
     </message>
     <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location line="+3"/>
         <source>&amp;Undo</source>
         <translation type="unfinished">&amp;Адрабіць</translation>
@@ -93,22 +143,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Next Bookmark</source>
         <translation type="unfinished">&amp;Наступная закладка</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Pre&amp;vious Bookmark</source>
         <translation type="unfinished">Па&amp;пярэдняя закладка</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Toggle &amp;Bookmark</source>
         <translation type="unfinished">&amp;Паставіць/прыбраць закладку</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Remove All Bookmarks</source>
         <translation type="unfinished"></translation>
     </message>
@@ -133,17 +183,37 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-94"/>
         <source>&amp;Find and Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -153,22 +223,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+51"/>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+63"/>
         <source>&amp;File</source>
         <translation type="unfinished">&amp;Файл</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+8"/>
+        <location line="+35"/>
         <source>&amp;Edit</source>
         <translation type="unfinished">&amp;Змяніць</translation>
     </message>
     <message>
-        <location line="+19"/>
+        <location line="+21"/>
         <source>&amp;Debug</source>
         <translation type="unfinished"></translation>
     </message>
@@ -181,72 +251,271 @@
 <context>
     <name>file_editor_tab</name>
     <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+102"/>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-192"/>
         <source>Could not open file %1 for write:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+63"/>
+        <location line="+170"/>
         <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>files_dock_widget</name>
     <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Бягучы каталог</translation>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Файлавы аглядальнік</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation type="unfinished">Агляд файлаў.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sre you want to delete
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+11"/>
-        <source>Move up one directory.</source>
-        <translation type="unfinished">Пасунуцца да ўзроўню вышэй.</translation>
+        <source>Can not delete a directory that is not empty</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
-        <translation type="unfinished">Увядзіце шлях ці назву файла.</translation>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
-        <translation type="unfinished">Двойчы пстрык па файле адкрые яго.</translation>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>find_dialog</name>
     <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
         <source>Find &amp;what:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -276,7 +545,12 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
         <source>&amp;Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -291,7 +565,7 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
+        <location line="+13"/>
         <source>&amp;Whole words</source>
         <translation type="unfinished"></translation>
     </message>
@@ -310,11 +584,202 @@
         <source>Search se&amp;lection</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Idle.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+100"/>
+        <source>Searching...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>history_dock_widget</name>
     <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation type="unfinished">Агляд і пошук па гісторыі загадаў.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
         <source>Doubleclick a command to transfer it to the terminal.</source>
         <translation type="unfinished">Двойчы пстрык па загадзе перадасць яго ў тэрмінал.</translation>
     </message>
@@ -329,7 +794,7 @@
         <translation type="unfinished">Гісторыя загадаў</translation>
     </message>
     <message>
-        <location line="+42"/>
+        <location line="+20"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
@@ -338,250 +803,103 @@
         <source>Evaluate</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lexer_octave_gui</name>
     <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation type="unfinished">Па змоўчванні</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation type="unfinished">Каментар</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation type="unfinished">Загад</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation type="unfinished">Нумар</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation type="unfinished">Ключаслова</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation type="unfinished">Радок у аднакоссі</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation type="unfinished">Аператар</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation type="unfinished">Ідэнтыфікатар</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
-        <translation type="unfinished">Радок у двукоссі</translation>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>main_window</name>
     <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation type="unfinished">Захаваць прастору зменных</translation>
-    </message>
-    <message>
-        <location line="+11"/>
+        <location filename="../src/main-window.cc" line="+155"/>
         <source>Load Workspace</source>
         <translation type="unfinished">Загрузіць прастору зменных</translation>
     </message>
     <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
+        <location line="+355"/>
+        <location line="+769"/>
         <source>About Octave</source>
         <translation type="unfinished">Пра Octave</translation>
     </message>
     <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation type="unfinished">Прагляд зменных бягучай прасторы.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation type="unfinished">Агляд і пошук па гісторыі загадаў.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation type="unfinished">Агляд файлаў.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+39"/>
+        <location line="-338"/>
         <source>&amp;File</source>
         <translation type="unfinished">&amp;Файл</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+52"/>
         <source>New</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
+        <location line="+4"/>
         <source>Script</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Function</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+2"/>
-        <source>Class</source>
+        <source>Function</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Figure</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="-55"/>
         <source>Open...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
+        <location line="+18"/>
         <source>Preferences...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+4"/>
         <source>Exit</source>
         <translation type="unfinished">Выйсці</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+51"/>
         <source>&amp;Edit</source>
         <translation type="unfinished">&amp;Змяніць</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+5"/>
         <source>Undo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <source>Cut</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+7"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+5"/>
         <source>Paste</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Paste To Workspace...</source>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Select All</source>
+        <location line="-602"/>
+        <source>Set working directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Delete</source>
+        <location line="+686"/>
+        <source>Find Files...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Find Files...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
         <source>Clear Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -591,143 +909,228 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+4"/>
         <source>Continue</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+13"/>
+        <location line="+8"/>
         <source>Exit Debug Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Файлавы аглядальнік</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
-        <source>Load workspace</source>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+4"/>
+        <source>One directory up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+192"/>
         <source>&amp;Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+6"/>
         <source>Show Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
+        <location line="+3"/>
         <source>Show Command History</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+6"/>
         <source>Show Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Documentation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+5"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Command History</source>
         <translation type="unfinished">Гісторыя загадаў</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Бягучы каталог</translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+6"/>
         <source>Workspace</source>
         <translation type="unfinished">Прастора зменных</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Editor</source>
         <translation type="unfinished">Рэдактар</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
+        <location line="+108"/>
         <source>Documentation</source>
         <translation type="unfinished">Дакументацыя</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Report Bug</source>
+        <translation type="unfinished">Паведаміць пра хібу</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
+    <message>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+29"/>
+        <source>Unock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Report Bug</source>
-        <translation type="unfinished">Паведаміць пра хібу</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Visit Agora</source>
+        <source>Change Directory or Add Directory to Load Path</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Visit Octave Forge</source>
+        <source>Change Directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -735,223 +1138,331 @@
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
         <translation type="unfinished">Настаўленні</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+97"/>
         <source>Octave logo only</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location line="+10"/>
+        <source>Letter icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Graphic  icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation type="unfinished">Рэдактар</translation>
+    </message>
+    <message>
         <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Letter icons</source>
+        <source>Show white space</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Auto indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Match keywords</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
+        <source>Case sensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
-        <translation type="unfinished">Рэдактар</translation>
+        <location line="+10"/>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+46"/>
         <source>Font</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
+        <location line="-745"/>
         <source>Show line numbers</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+27"/>
         <source>Highlight current line</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+262"/>
         <source>Code completion</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-282"/>
         <source>Show complete path in window title</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation type="unfinished">Вызначыць ўласны рэдактар:</translation>
-    </message>
-    <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+548"/>
         <source>emacs</source>
         <translation type="unfinished">emacs</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
+        <location line="+67"/>
         <source>Terminal</source>
         <translation type="unfinished">Тэрмінал</translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
+        <location line="+15"/>
         <source>Cursor type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+23"/>
         <source>Cursor blinking</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+102"/>
+        <source>Font size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>File Browser</source>
         <translation type="unfinished">Файлавы аглядальнік</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation type="unfinished">Паказваць назвы файлаў</translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file size</source>
         <translation type="unfinished">Паказваць памеры файлаў</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file type</source>
         <translation type="unfinished">Паказваць тыпы файлаў</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show date of last modification</source>
         <translation type="unfinished">Паказваць дату апошняга змянення</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show hidden files</source>
         <translation type="unfinished">Паказваць схаваныя файлы</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
         <source>Alternating row colors</source>
         <translation type="unfinished">Колеры радкоў чаргуюцца</translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation type="unfinished">Прастора зменных</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
         <translation type="unfinished">Сетка</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
+        <location line="+45"/>
         <source>Use proxy server</source>
         <translation type="unfinished">Выкарыстоўваць проксі-сервер</translation>
     </message>
     <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+10"/>
         <source>Proxy Type:</source>
         <translation type="unfinished">Тып проксі:</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
+        <location line="-33"/>
         <source>HttpProxy</source>
         <translation type="unfinished">HttpProxy</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-1108"/>
+        <source>Icon set for dock widgets</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1099"/>
         <source>Socks5Proxy</source>
         <translation type="unfinished">Socks5Proxy</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
+        <location line="-16"/>
         <source>Hostname:</source>
         <translation type="unfinished">Назва хоста:</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+54"/>
         <source>Port:</source>
         <translation type="unfinished">Порт:</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-27"/>
         <source>Username:</source>
         <translation type="unfinished">Імя карыстальніка:</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+37"/>
         <source>Password:</source>
         <translation type="unfinished">Пароль:</translation>
     </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-137"/>
+        <source>Difference to the defalt size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>b</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>i</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -959,7 +1470,7 @@
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
         <translation type="unfinished"></translation>
     </message>
@@ -973,13 +1484,11 @@
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -988,10 +1497,6 @@
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1000,34 +1505,26 @@
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1035,32 +1532,72 @@
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
         <translation type="unfinished">Ідэнтыфікатар</translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Class</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Dimension</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Value</source>
         <translation type="unfinished">Значэнне</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
         <translation type="unfinished">Прастора зменных</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation type="unfinished">Прагляд зменных бягучай прасторы.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 </TS>
--- a/libgui/languages/de_DE.ts
+++ b/libgui/languages/de_DE.ts
@@ -2,1065 +2,1676 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="de_DE">
 <context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation>Alles auswählen</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation>Automatisch</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation>Funktion</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation>Global</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation>Verborgen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation>Ererbt</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation>Beständig</translation>
+    </message>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.cc" line="+64"/>
+        <source>foreground</source>
+        <translation>Vordergrund</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>background</source>
+        <translation>Hintergrund</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>selection</source>
+        <translation>Auswahl</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>cursor</source>
+        <translation>Cursor</translation>
+    </message>
+</context>
+<context>
+    <name>QTerminal</name>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.h" line="+116"/>
+        <source>Copy</source>
+        <translation>Kopieren</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Paste</source>
+        <translation>Einfügen</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Clear All</source>
+        <translation>Alles löschen</translation>
+    </message>
+</context>
+<context>
+    <name>QWinTerminalImpl</name>
+    <message>
+        <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1451"/>
+        <source>copied selection to clipboard</source>
+        <translation>Auswahl in die Zwischenablage kopiert</translation>
+    </message>
+</context>
+<context>
     <name>documentation_dock_widget</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
         <source>Documentation</source>
-        <translation type="unfinished">Dokumentation</translation>
+        <translation>Dokumentation</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation>Siehe Dokumentation für Hilfe.</translation>
     </message>
 </context>
 <context>
     <name>file_editor</name>
     <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
         <source>Octave Editor</source>
-        <translation type="unfinished"></translation>
+        <translation>Octave Editor</translation>
     </message>
     <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
-        <translation type="unfinished"></translation>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Octave Dateien (*.m);;Alle Dateien (*)</translation>
     </message>
     <message>
-        <location line="+38"/>
+        <location line="+117"/>
         <source>Could not open file %1 for read:
 %2.</source>
-        <translation type="unfinished"></translation>
+        <translation>Kann die Datei &lt;b&gt;%1&lt;/b&gt; nicht zum Lesen öffnen:
+%2.</translation>
     </message>
     <message>
-        <location line="+43"/>
+        <location line="+49"/>
         <source>File not saved! A file with the selected name
 %1
 is already open in the editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+26"/>
-        <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
-        <translation type="unfinished"></translation>
+        <translation>Die Datei wurde nicht gespeichert! Eine Datei mit dem gewählten Namen
+&lt;b&gt;%1&lt;b&gt;
+ist im Editor bereits geöffnet</translation>
     </message>
     <message>
-        <location line="+141"/>
-        <source>&amp;%1 %2</source>
-        <translation type="unfinished"></translation>
+        <location line="+28"/>
+        <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
+        <translation>Der zugehörige Editor-Reiter ist nicht mehr vorhanden und wurde wahrscheinlich geschlossen.</translation>
     </message>
     <message>
-        <location line="+130"/>
+        <location line="+205"/>
+        <source>&amp;%1 %2</source>
+        <translation>&amp;%1 %2</translation>
+    </message>
+    <message>
+        <location line="+159"/>
         <source>&amp;New File</source>
-        <translation type="unfinished">&amp;Neue Datei</translation>
+        <translation>&amp;Neue Datei</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Open File</source>
-        <translation type="unfinished">&amp;Öffne Datei</translation>
+        <translation>Datei &amp;Öffnen</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Save File</source>
-        <translation type="unfinished">&amp;Sichere Datei</translation>
+        <translation>Datei &amp;speichern</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Save File &amp;As</source>
-        <translation type="unfinished">Sichere Datei &amp;als</translation>
+        <translation>Datei speichern &amp;als</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation>Drucken</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Undo</source>
-        <translation type="unfinished">&amp;Rückgängig</translation>
+        <translation>&amp;Rückgängig</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Redo</source>
-        <translation type="unfinished">&amp;Wiederholen</translation>
+        <translation>&amp;Wiederholen</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Copy</source>
-        <translation type="unfinished">&amp;Kopieren</translation>
+        <translation>&amp;Kopieren</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Cu&amp;t</source>
-        <translation type="unfinished">&amp;Ausschneiden</translation>
+        <translation>&amp;Ausschneiden</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Paste</source>
-        <translation type="unfinished"></translation>
+        <translation>Einfügen</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Next Bookmark</source>
-        <translation type="unfinished">&amp;Nächstes Bookmark</translation>
+        <translation>&amp;Nächstes Lesezeichen</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Pre&amp;vious Bookmark</source>
-        <translation type="unfinished">&amp;Voriges Bookmark</translation>
+        <translation>&amp;Voriges Lesezeichen</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Toggle &amp;Bookmark</source>
-        <translation type="unfinished">&amp;Bookmark setzen</translation>
+        <translation>&amp;Lesezeichen setzen</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Remove All Bookmarks</source>
-        <translation type="unfinished"></translation>
+        <translation>Alle Lesezeichen &amp;entfernen</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>&amp;Next breakpoint</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Nächster Haltepunkt</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Pre&amp;vious breakpoint</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Vorheriger Haltepunkt</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Toggle &amp;breakpoint</source>
-        <translation type="unfinished"></translation>
+        <translation>Haltepunkte &amp;umschalten</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Remove All breakpoints</source>
-        <translation type="unfinished"></translation>
+        <translation>Alle Haltepunkte &amp;entfernen</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
+        <translation>&amp;Kommentieren</translation>
     </message>
     <message>
         <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation>Kommentar &amp;entfernen</translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation>&amp;Zuletzt bearbeitete Dateien</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation>S&amp;chließen</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation>Alle schließen</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation>Andere Dokumente schließen</translation>
+    </message>
+    <message>
+        <location line="-94"/>
         <source>&amp;Find and Replace</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Suchen und Ersetzen</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Save File And Run</source>
-        <translation type="unfinished"></translation>
+        <translation>Datei speichern und ausrühren</translation>
     </message>
     <message>
-        <location line="+51"/>
-        <source>&amp;File</source>
-        <translation type="unfinished">&amp;Datei</translation>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation>&amp;Gehe zu Zeile</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation type="unfinished"></translation>
+        <location line="+63"/>
+        <source>&amp;File</source>
+        <translation>&amp;Datei</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+35"/>
         <source>&amp;Edit</source>
-        <translation type="unfinished">&amp;Editieren</translation>
+        <translation>&amp;Editieren</translation>
     </message>
     <message>
-        <location line="+19"/>
+        <location line="+21"/>
         <source>&amp;Debug</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Debuggen</translation>
     </message>
     <message>
         <location line="+9"/>
         <source>&amp;Run</source>
-        <translation type="unfinished">&amp;Ausführen</translation>
+        <translation>&amp;Ausführen</translation>
     </message>
 </context>
 <context>
     <name>file_editor_tab</name>
     <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation>Gehe zu Zeile</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation>Zeilennummer</translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation>&lt;unbenannt&gt;</translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation>Änderungen speichern oder verwerfen?</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation>Änderungen speichern, verwerfen oder Schließen abbrechen?</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
         <source>Octave Editor</source>
-        <translation type="unfinished"></translation>
+        <translation>Octave Editor</translation>
     </message>
     <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
-        <translation type="unfinished"></translation>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation>Die Datei
+%1
+soll geschlossen werden, wurde aber verändert.
+%2</translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Octave Dateien (*.m);;All Files (*)</translation>
     </message>
     <message>
-        <location line="+102"/>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation>Datei wurde nicht gespeichert! Der gewählte Dateiname
+%1
+ist derselbe wie der aktuelle Dateiname</translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation>Achtung: Der Inhalt des Editors wurde verändert!</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation>Die Datei
+%1
+wurde gelöscht oder umbenannt. Soll die Datei jetzt gespeichert werden?%2</translation>
+    </message>
+    <message>
+        <location line="-192"/>
         <source>Could not open file %1 for write:
 %2.</source>
-        <translation type="unfinished"></translation>
+        <translation>Die Datei %1  konnte nicht zum Schrieben geöffnet werden:
+%2.</translation>
     </message>
     <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+63"/>
+        <location line="+170"/>
         <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation type="unfinished"></translation>
+        <translation>Die Datei %1 wurde von einer anderen Anwendung verändert. Soll der neue Inhalt geladen werden?</translation>
     </message>
 </context>
 <context>
     <name>files_dock_widget</name>
     <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Aktuelles Verzeichnis</translation>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation>Dateibrowser</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation>Dateien durchsuchen.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation>Pfad oder Dateinamen eingeben</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation>Ordern darüber anwählen</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation>Aktuelles Octave Verzeichnis anzeigen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation>Zu aktuellem Octave Verezichnis gehen</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation>Octave Verzeichnis setzen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation>Setze Octave Verzeichnis zu aktuellem Browser Verzeichnis</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation>Aktionen mit aktuellem Verzeichnis</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation>Wechlse zum Heimatverzeichnis</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation>Verzeichnis suchen</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation>Dateien suchen ...</translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation>Neue Datei</translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation>Neues Verzeichnis</translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation>Datei mit Doppelklick öffnen</translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation>Öffnen</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation>Mit Standardanwendung öffnen</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation>Kopiere Auswahl in die Zwischenablage</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation>Ausführen</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation>Daten laden</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation>Aktuelles Verzeichnis setzen</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation>Umbenennen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation>Löschen</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation>Datei/Verzeichnis umbenennen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation>Datei/Verzeichnis umbenennen:</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation>
+zu: </translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation>Datei/Verzeichnis löschen</translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sure you want to delete
+</source>
+        <translation>Folgende/s Datei/Verzeichnis wirklich löschen
+</translation>
     </message>
     <message>
         <location line="+11"/>
-        <source>Move up one directory.</source>
-        <translation type="unfinished">Ein Verzeichnis höher wechseln.</translation>
+        <source>Can not delete a directory that is not empty</source>
+        <translation>Verzeichnis ist nicht leer und kann daher nicht gelöscht werden</translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation>Setze aktuelles Browser Verzeichnis</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation>Neue Datei</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
-        <translation type="unfinished">Geben Sie einen Pfad oder Dateinamen ein.</translation>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation>Neue Datei in</translation>
     </message>
     <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
-        <translation type="unfinished">Führen Sie einen Doppelklick aus, um eine Datei zu öffnen.</translation>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation>Neues Verzeichnis</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation>Neues Verzeichnis in</translation>
     </message>
 </context>
 <context>
     <name>find_dialog</name>
     <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
         <source>Find &amp;what:</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Suche:</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Re&amp;place with:</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Ersetze durch:</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Match &amp;case</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Groß-/Kleinschreibung beachten</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Search from &amp;start</source>
-        <translation type="unfinished"></translation>
+        <translation>Suche vom &amp;Beginn</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>&amp;Wrap while searching</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Umbruch beim Suchen</translation>
     </message>
     <message>
         <location line="+2"/>
         <source>&amp;Find Next</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Nächsten suchen</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation>&amp;Vorherigen suchen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
         <source>&amp;Replace</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Ersetze</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Replace &amp;All</source>
-        <translation type="unfinished"></translation>
+        <translation>Ersetze &amp;alle</translation>
     </message>
     <message>
         <location line="+2"/>
         <source>&amp;More</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Mehr</translation>
     </message>
     <message>
-        <location line="+11"/>
+        <location line="+13"/>
         <source>&amp;Whole words</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Ganze Wörter</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Regular E&amp;xpressions</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Reguläre Ausdrücke</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Search &amp;backward</source>
-        <translation type="unfinished"></translation>
+        <translation>Rück&amp;wärts suchen</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Search se&amp;lection</source>
-        <translation type="unfinished"></translation>
+        <translation>In Auswah&amp;l suchen</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation>Vom Ende suchen</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation>Suche vom Beginn</translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation>Ergebins der Ersetzungen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation>%1 Vorkommnisse ersetzt</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation>Suchergebnis</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation>Keine weiteren Vorkommnisse gefunden</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation>Suche Dateien</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation>Name:</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation>EIngabe eines Ausdrucks für den Dateinamen</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation>Beginne in:</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation>Verzeichnis, in dem die Suche beginnt</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation>Suche ...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation>Suche Startverzeichnis</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation>Unterverzeichnisse durchsuchen</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation>Rekursive Dateisuche durch Unterverzeichnisse</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation>Verzeichnisse einbeziehen</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation>Auch Verzeichnisse berücksichitgen, die die Suchanfrage erfüllen</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation>Groß-/Kleinschreibung ignorieren</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation>Groß-/Kleinschriebung bei der Dateisuche ignorieren</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation>In Datei vorkommender Text:</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation>Suche Dateien mit übereinstimmendem Text</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation>Zu suchender Text</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation>Groß-/Kleinschreibung beachten</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation>Groß-/Kleinschreibung beim Text beachten</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation>Suchergebnisse</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Idle.</source>
+        <translation>Leerlauf.</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation>Suche</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation>Beginne die Dateisuche</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation>Beenden</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation>Suche beenden</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation>Dateiname und Verzeichnis</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation>Dateiinhalt</translation>
+    </message>
+    <message>
+        <location line="+99"/>
+        <source>Searching...</source>
+        <translation>Suche ...</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation>Suchverzeichnis setzen</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation>Dateiname</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation>Verzeichnis</translation>
     </message>
 </context>
 <context>
     <name>history_dock_widget</name>
     <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation>Durchsuchen Sie die Befehlshistorie.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
         <source>Doubleclick a command to transfer it to the terminal.</source>
-        <translation type="unfinished">Führen Sie einen Doppelklick aus, um den Befehl in das Terminal zu übertragen.</translation>
+        <translation>Doppelklick, um den Befehl in das Terminal zu übertragen.</translation>
     </message>
     <message>
         <location line="+6"/>
         <source>Enter text to filter the command history.</source>
-        <translation type="unfinished">Geben Sie Text ein, um die Befehlshistorie zu filtern.</translation>
+        <translation>Texteingabe zur Filterung der Befehlshistorie.</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Command History</source>
-        <translation type="unfinished">Befehlshistorie</translation>
+        <translation>Befehlshistorie</translation>
     </message>
     <message>
-        <location line="+42"/>
+        <location line="+20"/>
         <source>Copy</source>
-        <translation type="unfinished"></translation>
+        <translation>Kopieren</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Evaluate</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>lexer_octave_gui</name>
-    <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation type="unfinished">Standard</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation type="unfinished">Kommentar</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation type="unfinished">Befehl</translation>
+        <translation>Ausführen</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation type="unfinished">Zahl</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation type="unfinished">Schlüsselwort</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation type="unfinished">Zeichenkette in einfachen Hochkommata</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation type="unfinished">Operator</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation type="unfinished">Bezeichner</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
-        <translation type="unfinished">Zeichenkette in doppelten Hochkommata</translation>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translation>Skript erzeugen</translation>
     </message>
 </context>
 <context>
     <name>main_window</name>
     <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation type="unfinished">Speichere Arbeitsumgebung</translation>
-    </message>
-    <message>
-        <location line="+11"/>
+        <location filename="../src/main-window.cc" line="+155"/>
         <source>Load Workspace</source>
-        <translation type="unfinished">Lade Arbeitsumgebung</translation>
+        <translation>Lade Arbeitsumgebung</translation>
     </message>
     <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
+        <location line="+355"/>
+        <location line="+769"/>
         <source>About Octave</source>
-        <translation type="unfinished">Über Octave</translation>
-    </message>
-    <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation type="unfinished">Sehen Sie die Variablen ein, die sich in der aktiven Arbeitsumgebung befinden.</translation>
+        <translation>Über Octave</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation type="unfinished">Durchsuchen Sie die Befehlshistorie.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation type="unfinished">Durchsuchen Sie Ihre Dateien.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation type="unfinished"></translation>
+        <location line="-338"/>
+        <source>&amp;File</source>
+        <translation>&amp;Datei</translation>
     </message>
     <message>
-        <location line="+39"/>
-        <source>&amp;File</source>
-        <translation type="unfinished">&amp;Datei</translation>
+        <location line="+52"/>
+        <source>New</source>
+        <translation>Neu</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>New</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
+        <location line="+4"/>
         <source>Script</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Function</source>
-        <translation type="unfinished"></translation>
+        <translation>Skript</translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Class</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Figure</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Open...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Preferences...</source>
-        <translation type="unfinished"></translation>
+        <source>Function</source>
+        <translation>Funktion</translation>
     </message>
     <message>
         <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation type="unfinished"></translation>
+        <source>Figure</source>
+        <translation>Abbildung</translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation type="unfinished"></translation>
+        <location line="-55"/>
+        <source>Open...</source>
+        <translation>Öffnen...</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation type="unfinished"></translation>
+        <location line="+18"/>
+        <source>Preferences...</source>
+        <translation>Einstellungen...</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Exit</source>
-        <translation type="unfinished">Beenden</translation>
+        <translation>Beenden</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+51"/>
         <source>&amp;Edit</source>
-        <translation type="unfinished">&amp;Editieren</translation>
+        <translation>&amp;Editieren</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+5"/>
         <source>Undo</source>
-        <translation type="unfinished"></translation>
+        <translation>Rückgängig</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
+        <location line="+7"/>
+        <source>Copy</source>
+        <translation>Kopieren</translation>
     </message>
     <message>
         <location line="+5"/>
-        <source>Cut</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Copy</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
         <source>Paste</source>
-        <translation type="unfinished"></translation>
+        <translation>Einfügen</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Paste To Workspace...</source>
-        <translation type="unfinished"></translation>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
+        <translation>Arbeitsumgebung speichern als</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Select All</source>
-        <translation type="unfinished"></translation>
+        <location line="-602"/>
+        <source>Set working directory</source>
+        <translation>Arbeitsverzeichnis setzen</translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
+        <location line="+686"/>
+        <source>Find Files...</source>
+        <translation>Suche Dateien...</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Find Files...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
         <source>Clear Command Window</source>
-        <translation type="unfinished"></translation>
+        <translation>Befehlsfenster löschen</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Clear Command History</source>
-        <translation type="unfinished"></translation>
+        <translation>Befehlshistorie löschen</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
-        <translation type="unfinished"></translation>
+        <translation>Arbeitsumgebung löschen</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
-        <translation type="unfinished"></translation>
+        <translation>De&amp;bug</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
-        <translation type="unfinished"></translation>
+        <translation>EInzelschritt</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
-        <translation type="unfinished"></translation>
+        <translation>Einzelschritt hinein</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
-        <translation type="unfinished"></translation>
+        <translation>Einzelschritt heraus</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Continue</source>
+        <translation>Fortführen</translation>
     </message>
     <message>
         <location line="+8"/>
-        <source>Continue</source>
-        <translation type="unfinished"></translation>
+        <source>Exit Debug Mode</source>
+        <translation>Debug Modus verlassen</translation>
+    </message>
+    <message>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation>Dateibrowser anzeigen</translation>
     </message>
     <message>
-        <location line="+13"/>
-        <source>Exit Debug Mode</source>
-        <translation type="unfinished"></translation>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation>Dateibrowser</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
+        <translation>Fensterlayout auf Grundeinstellung zurücksetzen</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
-        <translation type="unfinished"></translation>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation>Auf der Festplatte</translation>
     </message>
     <message>
-        <location line="+1"/>
-        <source>Load workspace</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation>Im Internet</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation>Neues Verzeichnis eingeben</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
+        <translation>Aktuelles Verzeichnis:</translation>
     </message>
     <message>
         <location line="+4"/>
-        <source>&amp;Window</source>
-        <translation type="unfinished"></translation>
+        <source>One directory up</source>
+        <translation>Ein Verzeichnis höher</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation>Verzeichnis suchen</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Show Command Window</source>
-        <translation type="unfinished"></translation>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation>Arbeitsumgebung laden</translation>
+    </message>
+    <message>
+        <location line="+192"/>
+        <source>&amp;Window</source>
+        <translation>&amp;Fenster</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Show Command History</source>
-        <translation type="unfinished"></translation>
+        <source>Show Command Window</source>
+        <translation>Befehlsfenster anzeigen</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Show Command History</source>
+        <translation>Befehlshistorie anzeigen</translation>
     </message>
     <message>
         <location line="+6"/>
         <source>Show Workspace</source>
-        <translation type="unfinished"></translation>
+        <translation>Arbeitsumgebung anzeigen</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Editor</source>
+        <translation>Editor anzeigen</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Documentation</source>
+        <translation>Dokumentation anzeigen</translation>
     </message>
     <message>
         <location line="+5"/>
-        <source>Show Editor</source>
-        <translation type="unfinished"></translation>
+        <source>Command Window</source>
+        <translation>Befehlsfenster</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Command History</source>
+        <translation>Befehlshistorie</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Workspace</source>
+        <translation>Arbeitsumgebung</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Documentation</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Editor</source>
+        <translation>Editor</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+108"/>
+        <source>Documentation</source>
+        <translation>Dokumentation</translation>
+    </message>
+    <message>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation>&amp;Hilfe</translation>
     </message>
     <message>
         <location line="+7"/>
-        <source>Command Window</source>
-        <translation type="unfinished">Konsolenfenster</translation>
+        <source>Report Bug</source>
+        <translation>Fehler melden</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Command History</source>
-        <translation type="unfinished">Befehlshistorie</translation>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation>Agora Webseite</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Aktuelles Verzeichnis</translation>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation>Octave Forge Webseite</translation>
     </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
     <message>
-        <location line="+4"/>
-        <source>Workspace</source>
-        <translation type="unfinished">Arbeitsumgebung</translation>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <location line="+120"/>
+        <source>Undock widget</source>
+        <translation>Fenster lösen</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Editor</source>
-        <translation type="unfinished">Editor</translation>
+        <location line="-111"/>
+        <source>Hide widget</source>
+        <translation>Fenster verbergen</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Documentation</source>
-        <translation type="unfinished">Dokumentation</translation>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation>Fenster andocken</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation>Hilfe zu</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation>Die Datei %1 exisitiert nicht im Suchpfad. Um die editierte Funktion zu debuggen, muss entweder in das Verzeichnis %2 gewechselt werden oder dieses Verzeichnis dem Suchpfad hinzugefügt werden.</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
+        <translation>Die Datei %1 wird von einer gleichnamigen Datei im Suchpfad überdeckt. Um die editierte Funktion zu debuggen, in das Verzeichnis %2 gewechselt werden.</translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Report Bug</source>
-        <translation type="unfinished">Fehler melden</translation>
+        <source>Change Directory or Add Directory to Load Path</source>
+        <translation>Verzeichnis wechseln oder zum Suchpfad hinzufügen</translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Visit Agora</source>
-        <translation type="unfinished"></translation>
+        <source>Change Directory</source>
+        <translation>Verzeichnis wechseln</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Visit Octave Forge</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation>Verzeichnis zum Suchpfad hinzufügen</translation>
     </message>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>Abbrechen</translation>
     </message>
 </context>
 <context>
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
-        <translation type="unfinished">Einstellungen</translation>
+        <translation>Einstellungen</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Octave logo only</source>
-        <translation type="unfinished"></translation>
+        <translation>Allgemein</translation>
     </message>
     <message>
-        <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Letter icons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
-        <translation type="unfinished">Editor</translation>
+        <location line="+97"/>
+        <source>Octave logo only</source>
+        <translation>Nur Octave Logo</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font</source>
-        <translation type="unfinished"></translation>
+        <source>Letter icons</source>
+        <translation>Icons mit Buchstaben</translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation type="unfinished"></translation>
+        <location line="+46"/>
+        <source>Editor</source>
+        <translation>Editor</translation>
+    </message>
+    <message>
+        <location line="+16"/>
+        <source>Show white space</source>
+        <translation>Leerzeichen</translation>
     </message>
     <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <source>Show line numbers</source>
-        <translation type="unfinished"></translation>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation>Keine Leezeichen der Einrückung anzeigen</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Highlight current line</source>
-        <translation type="unfinished"></translation>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation>Farbe</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Code completion</source>
-        <translation type="unfinished"></translation>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation>Einrücken um</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show complete path in window title</source>
-        <translation type="unfinished"></translation>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation>Tabulator rückt ein</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation type="unfinished"></translation>
+        <source>Auto indentation</source>
+        <translation>Auto Einrückung</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation>Tabulatorweite</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation>Einrückregeln anzeigen</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation>Rücktaste entfernt Einrückung</translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation>Anzahl der Zeichen bis Vorschlagliste angezeigt wird</translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation type="unfinished">Benutzerdefinierten Editor verwenden:</translation>
+        <location line="+71"/>
+        <source>Match keywords</source>
+        <translation>Schlüsselwörter berücksichtigen</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Case sensitive</source>
+        <translation>Groß-/Kleinschreibung beachten</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>emacs</source>
-        <translation type="unfinished">emacs</translation>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation>Wort durch Vorschalg ersetzen</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation>Wörter im Dokument berücksichtigen</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation>Editor Dateien der letzten Sitzung wiederherstellen</translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
+        <translation>Externen Editor verwenden</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
-        <source>Terminal</source>
-        <translation type="unfinished">Terminal</translation>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation>Befehl (%f=Datei, %l=Zeiel):</translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation>Editor Stile</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Schriftart, -größe (als Differenz zur Standardgröße), -format (fett, kursiv, unterstrichen),  Vorder- und Hintergrundfarbe festlegen (für die Hintergrundfarbe stellt die Farbe Pink (255,0,255) einen Platzhalter für die Standardhintergrundfarbe dar)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
-        <source>Cursor type:</source>
-        <translation type="unfinished"></translation>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation>Vordergrundfarbe verwenden</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation>Farben des Befehlsfensters</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Font</source>
+        <translation>Schriftart</translation>
+    </message>
+    <message>
+        <location line="-744"/>
+        <source>Show line numbers</source>
+        <translation>Zeilennummern anzeigen</translation>
     </message>
     <message>
         <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Cursor blinking</source>
-        <translation type="unfinished"></translation>
+        <source>Highlight current line</source>
+        <translation>Aktuelle Zeile hervorheben</translation>
+    </message>
+    <message>
+        <location line="+262"/>
+        <source>Code completion</source>
+        <translation>Vervollständigung</translation>
+    </message>
+    <message>
+        <location line="-282"/>
+        <source>Show complete path in window title</source>
+        <translation>Kompletten Pfad im Reiter anzeigen</translation>
+    </message>
+    <message>
+        <location line="-72"/>
+        <source>Graphic icons</source>
+        <translation>Grafische Icons</translation>
+    </message>
+    <message>
+        <location line="+620"/>
+        <source>emacs</source>
+        <translation>emacs</translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+67"/>
+        <source>Terminal</source>
+        <translation>Befehlsfenster</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>Cursor type:</source>
+        <translation>Cursortyp:</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Cursor blinking</source>
+        <translation>Blinkender Cursor</translation>
+    </message>
+    <message>
+        <location line="+101"/>
+        <source>Font size</source>
+        <translation>Schriftgröße</translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>File Browser</source>
-        <translation type="unfinished">Dateibrowser</translation>
+        <translation>Dateibrowser</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation type="unfinished">Dateinamen anzeigen</translation>
+        <source>Show file size</source>
+        <translation>Dateigröße anzeigen</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show file size</source>
-        <translation type="unfinished">Dateigröße anzeigen</translation>
+        <source>Show file type</source>
+        <translation>Dateityp anzeigen</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show file type</source>
-        <translation type="unfinished">Dateityp anzeigen</translation>
+        <source>Show date of last modification</source>
+        <translation>Datum der letzten Änderung anzeigen</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show date of last modification</source>
-        <translation type="unfinished">Datum der letzten Änderung anzeigen</translation>
+        <source>Show hidden files</source>
+        <translation>Versteckte Dateien anzeigen</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show hidden files</source>
-        <translation type="unfinished">Versteckte Dateien anzeigen</translation>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation>Verzeichnisse von Octave und des Dateibrowsers synchronisieren</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Alternating row colors</source>
-        <translation type="unfinished">Alternierende Farben verwenden</translation>
+        <translation>Alternierende Farben verwenden</translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation>Arbeitsumgebung</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation>Farben der Speicherklassen festlegen</translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
-        <translation type="unfinished"></translation>
+        <translation>Netzwerk</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Use proxy server</source>
+        <translation>Proxy-Server verwenden</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Proxy Type:</source>
+        <translation>Proxy Typ:</translation>
+    </message>
+    <message>
+        <location line="-33"/>
+        <source>HttpProxy</source>
+        <translation>HTTP Proxy</translation>
+    </message>
+    <message>
+        <location line="-1107"/>
+        <source>Icon set for dock widgets</source>
+        <translation>Icons der Unterfenster</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation>Sprache (Neustart erforderlich)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation>Icongröße</translation>
+    </message>
+    <message>
+        <location line="+1098"/>
+        <source>Socks5Proxy</source>
+        <translation>Socks5Proxy</translation>
+    </message>
+    <message>
+        <location line="-16"/>
+        <source>Hostname:</source>
+        <translation>Hostname:</translation>
+    </message>
+    <message>
+        <location line="+54"/>
+        <source>Port:</source>
+        <translation>Port:</translation>
+    </message>
+    <message>
+        <location line="-27"/>
+        <source>Username:</source>
+        <translation>Nutzername:</translation>
+    </message>
+    <message>
+        <location line="+37"/>
+        <source>Password:</source>
+        <translation>Passwort:</translation>
+    </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation>Systemeinstellung</translation>
+    </message>
+    <message>
+        <location line="-268"/>
+        <source>IBeam Cursor</source>
+        <translation>IBeam-Cursor</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Block Cursor</source>
+        <translation>Blockcursor</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Underline Cursor</source>
+        <translation>Unterstrichener Cursor</translation>
+    </message>
+    <message>
+        <location line="+129"/>
+        <source>Difference to the default size</source>
+        <translation>Differenz zur Stnadgröße</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
-        <source>Use proxy server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Proxy Type:</source>
-        <translation type="unfinished"></translation>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation>Hintergrundfarbe, Pink (255,0,255) für Standard</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
-        <source>HttpProxy</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Socks5Proxy</source>
-        <translation type="unfinished"></translation>
+        <location line="+2"/>
+        <source>b</source>
+        <translation>f</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
-        <source>Hostname:</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>i</source>
+        <translation>k</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Port:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Username:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Password:</source>
-        <translation type="unfinished">Passwort:</translation>
+        <location line="+1"/>
+        <source>u</source>
+        <translation>u</translation>
     </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
-        <translation type="unfinished">Konsolenfenster</translation>
+        <translation>Befehlsfenster</translation>
     </message>
 </context>
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
-        <translation type="unfinished"></translation>
+        <translation>Suchbegriff eingeben und mit &apos;Enter&apos; die Scuhe starten</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Global search</source>
-        <translation type="unfinished"></translation>
+        <translation>Globale Suche</translation>
     </message>
 </context>
 <context>
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
-        <translation type="unfinished"></translation>
+        <translation>Willkommen zu GNU Octave</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
-        <translation type="unfinished"></translation>
+        <translation>Es scheint, dass Sie Octave-GUI das erste Mal auf diesem Computer ausführen, da die Konfigurationsdatei 
+~/.config/octave/qt-settings
+nicht gefunden wurde. Die Default-Konfiguration wird beim Fortfahren an diese Stelle kopiert. Wenn bestehende Einstellungen verwendet werden sollen, muss dieser Dialog geschlossen und  die vorhandene Datei an die oben angegebene Stelle kopiert werden. Eine vorhandene Konfigurationsdatei wird beim nächsten Start automatisch erkannt.
+
+Nach dem Programmstart können die Einstellungen im Menü &quot;Datei/Einstellungen&quot; angepasst werden.</translation>
     </message>
     <message>
         <location line="+41"/>
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
-        <translation type="unfinished"></translation>
+        <translation>Weiter</translation>
     </message>
     <message>
         <location line="-124"/>
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
-        <translation type="unfinished"></translation>
+        <translation>Zurück</translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
-        <translation type="unfinished"></translation>
+        <translation>Willkommen zu Octave!</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
-        <translation type="unfinished"></translation>
+        <translation>Dieses ist die Entwicklungsversion von Octave mit der ersten offiziellen GUI.</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
-        <translation type="unfinished"></translation>
+        <translation>Die GUI von Octave wird offenbar das erste mal auf diesem Computer ausgeführt. Dieser Assistent erstellt beim Klick auf &apos;Beenden&apos; eine Standarkonfiguration und startet Octve-GUI.  </translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
-        <translation type="unfinished"></translation>
+        <translation>Beenden</translation>
     </message>
 </context>
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
-        <translation type="unfinished">Bezeichner</translation>
+        <translation>Bezeichner</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Class</source>
+        <translation>Klasse</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Class</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Dimension</source>
+        <translation>Dimension</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Dimension</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Value</source>
+        <translation>Wert</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Value</source>
-        <translation type="unfinished">Wert</translation>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation>Speicherklasse</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation>Rechtsklick zum Kopeiren, Umbenennen oder Anzeigen</translation>
     </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
-        <translation type="unfinished">Arbeitsumgebung</translation>
+        <translation>Arbeitsumgebung</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation>Sehen Sie die Variablen ein, die sich in der aktiven Arbeitsumgebung befinden.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation>Kopieren</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation>Umbenennen</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation>Nur Varaiblen auf höchster Ebene können umbenannt werden.</translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation>Einsehen der Varaiblen der aktiven Arbeitsumgebung.&lt;br&gt;</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation>Farben der Speicherklassen:</translation>
     </message>
 </context>
 </TS>
--- a/libgui/languages/en_US.ts
+++ b/libgui/languages/en_US.ts
@@ -2,53 +2,98 @@
 <!DOCTYPE TS>
 <TS version="2.0">
 <context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>documentation_dock_widget</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
         <source>Documentation</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>file_editor</name>
     <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+38"/>
+        <location line="+117"/>
         <source>Could not open file %1 for read:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+43"/>
+        <location line="+49"/>
         <source>File not saved! A file with the selected name
 %1
 is already open in the editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
+        <location line="+28"/>
         <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+205"/>
         <source>&amp;%1 %2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+130"/>
+        <location line="+159"/>
         <source>&amp;New File</source>
         <translation type="unfinished"></translation>
     </message>
@@ -68,6 +113,11 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location line="+3"/>
         <source>&amp;Undo</source>
         <translation type="unfinished"></translation>
@@ -93,22 +143,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Next Bookmark</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Pre&amp;vious Bookmark</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Toggle &amp;Bookmark</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Remove All Bookmarks</source>
         <translation type="unfinished"></translation>
     </message>
@@ -133,17 +183,37 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-94"/>
         <source>&amp;Find and Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -153,22 +223,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+51"/>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+63"/>
         <source>&amp;File</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+8"/>
+        <location line="+35"/>
         <source>&amp;Edit</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+19"/>
+        <location line="+21"/>
         <source>&amp;Debug</source>
         <translation type="unfinished"></translation>
     </message>
@@ -181,72 +251,271 @@
 <context>
     <name>file_editor_tab</name>
     <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+102"/>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-192"/>
         <source>Could not open file %1 for write:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+63"/>
+        <location line="+170"/>
         <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>files_dock_widget</name>
     <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sre you want to delete
+</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+11"/>
-        <source>Move up one directory.</source>
+        <source>Can not delete a directory that is not empty</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
+        <location line="+0"/>
+        <source>Create file in
+</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>find_dialog</name>
     <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
         <source>Find &amp;what:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -276,7 +545,12 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
         <source>&amp;Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -291,7 +565,7 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
+        <location line="+13"/>
         <source>&amp;Whole words</source>
         <translation type="unfinished"></translation>
     </message>
@@ -310,11 +584,202 @@
         <source>Search se&amp;lection</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Idle.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+100"/>
+        <source>Searching...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>history_dock_widget</name>
     <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+23"/>
         <source>Doubleclick a command to transfer it to the terminal.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -329,7 +794,7 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+42"/>
+        <location line="+20"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
@@ -338,250 +803,103 @@
         <source>Evaluate</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lexer_octave_gui</name>
     <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
+        <location line="+1"/>
+        <source>Create script</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>main_window</name>
     <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+11"/>
+        <location filename="../src/main-window.cc" line="+155"/>
         <source>Load Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
+        <location line="+355"/>
+        <location line="+769"/>
         <source>About Octave</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+39"/>
+        <location line="-338"/>
         <source>&amp;File</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+52"/>
         <source>New</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
+        <location line="+4"/>
         <source>Script</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Function</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+2"/>
-        <source>Class</source>
+        <source>Function</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Figure</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="-55"/>
         <source>Open...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
+        <location line="+18"/>
         <source>Preferences...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+4"/>
         <source>Exit</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+51"/>
         <source>&amp;Edit</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+5"/>
         <source>Undo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <source>Cut</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+7"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+5"/>
         <source>Paste</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Paste To Workspace...</source>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Select All</source>
+        <location line="-602"/>
+        <source>Set working directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Delete</source>
+        <location line="+686"/>
+        <source>Find Files...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Find Files...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
         <source>Clear Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -591,143 +909,228 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+4"/>
         <source>Continue</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+13"/>
+        <location line="+8"/>
         <source>Exit Debug Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
-        <source>Load workspace</source>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+4"/>
+        <source>One directory up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+192"/>
         <source>&amp;Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+6"/>
         <source>Show Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
+        <location line="+3"/>
         <source>Show Command History</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+6"/>
         <source>Show Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Documentation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+5"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Command History</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+6"/>
         <source>Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
+        <location line="+108"/>
         <source>Documentation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Report Bug</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
+    <message>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+29"/>
+        <source>Unock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Report Bug</source>
+        <source>Change Directory or Add Directory to Load Path</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Visit Agora</source>
+        <source>Change Directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Visit Octave Forge</source>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
+        <location line="+1"/>
+        <source>Cancel</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -735,223 +1138,331 @@
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+97"/>
         <source>Octave logo only</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location line="+10"/>
+        <source>Letter icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Graphic  icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Letter icons</source>
+        <source>Show white space</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Auto indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Match keywords</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
+        <source>Case sensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+46"/>
         <source>Font</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
+        <location line="-745"/>
         <source>Show line numbers</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+27"/>
         <source>Highlight current line</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+262"/>
         <source>Code completion</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-282"/>
         <source>Show complete path in window title</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+548"/>
         <source>emacs</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
+        <location line="+67"/>
         <source>Terminal</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
+        <location line="+15"/>
         <source>Cursor type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+23"/>
         <source>Cursor blinking</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+102"/>
+        <source>Font size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>File Browser</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file size</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file type</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show date of last modification</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show hidden files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
         <source>Alternating row colors</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
+        <location line="+45"/>
         <source>Use proxy server</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+10"/>
         <source>Proxy Type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
+        <location line="-33"/>
         <source>HttpProxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-1108"/>
+        <source>Icon set for dock widgets</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1099"/>
         <source>Socks5Proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
+        <location line="-16"/>
         <source>Hostname:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+54"/>
         <source>Port:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-27"/>
         <source>Username:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+37"/>
         <source>Password:</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-137"/>
+        <source>Difference to the defalt size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>b</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>i</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -959,7 +1470,7 @@
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
         <translation type="unfinished"></translation>
     </message>
@@ -973,13 +1484,11 @@
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -988,10 +1497,6 @@
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1000,34 +1505,26 @@
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1035,32 +1532,72 @@
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Class</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Dimension</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Value</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 </TS>
--- a/libgui/languages/es_ES.ts
+++ b/libgui/languages/es_ES.ts
@@ -1,1066 +1,1610 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="es_MX">
+<TS version="2.0" language="es">
+<context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation>Seleccionar todo</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation>automático</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation>función</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation>global</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation>oculto</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation>heredado</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation>persistente</translation>
+    </message>
+</context>
 <context>
     <name>documentation_dock_widget</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
         <source>Documentation</source>
-        <translation type="unfinished">Documentación</translation>
+        <translation>Documentación</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation>Consultar documentación para obtener ayuda.</translation>
     </message>
 </context>
 <context>
     <name>file_editor</name>
     <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
         <source>Octave Editor</source>
-        <translation type="unfinished"></translation>
+        <translation>Editor de Octave</translation>
     </message>
     <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
-        <translation type="unfinished"></translation>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Archivos de Octave (*.m);;Todos los archivos (*)</translation>
     </message>
     <message>
-        <location line="+38"/>
+        <location line="+117"/>
         <source>Could not open file %1 for read:
 %2.</source>
-        <translation type="unfinished"></translation>
+        <translation>No se ha podido abrir el archivo %1 para su lectura:\n%2.</translation>
     </message>
     <message>
-        <location line="+43"/>
+        <location line="+49"/>
         <source>File not saved! A file with the selected name
 %1
 is already open in the editor</source>
-        <translation type="unfinished"></translation>
+        <translation>¡Archivo no guardado! Un archivo con el nombre seleccionado\n%1\n ya se encuentra abierto en el editor </translation>
     </message>
     <message>
-        <location line="+26"/>
+        <location line="+28"/>
         <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
-        <translation type="unfinished"></translation>
+        <translation>La pestaña para la edición del archivo ha desaparecido.  Es probable que se haya cerrado por algún medio.</translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+205"/>
         <source>&amp;%1 %2</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;%1 %2</translation>
     </message>
     <message>
-        <location line="+130"/>
+        <location line="+159"/>
         <source>&amp;New File</source>
-        <translation type="unfinished">Archivo &amp;nuevo</translation>
+        <translation>Archivo &amp;nuevo</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Open File</source>
-        <translation type="unfinished">&amp;Abrir archivo</translation>
+        <translation>&amp;Abrir archivo</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Save File</source>
-        <translation type="unfinished">&amp;Guardar archivo</translation>
+        <translation>&amp;Guardar archivo</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Save File &amp;As</source>
-        <translation type="unfinished">Guardar archivo &amp;como</translation>
+        <translation>Guardar archivo &amp;como</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation>Imprimir</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Undo</source>
-        <translation type="unfinished">&amp;Deshacer</translation>
+        <translation>&amp;Deshacer</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Redo</source>
-        <translation type="unfinished">&amp;Rehacer</translation>
+        <translation>&amp;Rehacer</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Copy</source>
-        <translation type="unfinished">&amp;Copiar</translation>
+        <translation>&amp;Copiar</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Cu&amp;t</source>
-        <translation type="unfinished">Cor&amp;tar</translation>
+        <translation>Cor&amp;tar</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Paste</source>
-        <translation type="unfinished"></translation>
+        <translation>Pegar</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Next Bookmark</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Marcador siguiente</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Pre&amp;vious Bookmark</source>
-        <translation type="unfinished"></translation>
+        <translation>Marcador &amp;anterior</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Toggle &amp;Bookmark</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Alternar marcadores</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Remove All Bookmarks</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Eliminar todos los marcadores</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>&amp;Next breakpoint</source>
-        <translation type="unfinished"></translation>
+        <translation>Punto de interrupción &amp;siguiente </translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Pre&amp;vious breakpoint</source>
-        <translation type="unfinished"></translation>
+        <translation>Punto de interrupción &amp;anterior</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Toggle &amp;breakpoint</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Alternar puntos de interrupción</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Remove All breakpoints</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Remover todos los puntos de interrupción</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
+        <translation>&amp;Comentar</translation>
     </message>
     <message>
         <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation>&amp;Eliminar comentario</translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation>Archivos &amp;recientes</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation>C&amp;errar</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation>Cerrar todo</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation>Cerrar otros archivos</translation>
+    </message>
+    <message>
+        <location line="-94"/>
         <source>&amp;Find and Replace</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Buscar y reemplazar</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Save File And Run</source>
-        <translation type="unfinished"></translation>
+        <translation>Guardar archivo y ejecutar</translation>
     </message>
     <message>
-        <location line="+51"/>
-        <source>&amp;File</source>
-        <translation type="unfinished">&amp;Archivo</translation>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation>&amp;Ir a línea</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation type="unfinished"></translation>
+        <location line="+63"/>
+        <source>&amp;File</source>
+        <translation>&amp;Archivo</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+35"/>
         <source>&amp;Edit</source>
-        <translation type="unfinished">&amp;Editar</translation>
+        <translation>&amp;Editar</translation>
     </message>
     <message>
-        <location line="+19"/>
+        <location line="+21"/>
         <source>&amp;Debug</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Depurar</translation>
     </message>
     <message>
         <location line="+9"/>
         <source>&amp;Run</source>
-        <translation type="unfinished">&amp;Ejecutar</translation>
+        <translation>&amp;Ejecutar</translation>
     </message>
 </context>
 <context>
     <name>file_editor_tab</name>
     <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation>Ir a línea</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation>Número de línea</translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation>&lt;sin nombre&gt;</translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation>¿Desea guardar o descartar los cambios?</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation>¿Desea cancelar el cierre, guardar o descartar los cambios?</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
         <source>Octave Editor</source>
-        <translation type="unfinished"></translation>
+        <translation>Editor de Octave</translation>
     </message>
     <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
-        <translation type="unfinished"></translation>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation>El archivo\n%1\n está a punto de ser cerrado pero ha sido modificado.\n%2</translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Archivos de Octave(*.m);;Todos los archivos(*)</translation>
     </message>
     <message>
-        <location line="+102"/>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation>¡Archivo no guardado! El nombre del archivo seleccionado\n%1\n es el mismo que el nombre del archivo actual</translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation>\n\n Advertencia: ¡El contenido del editor ha sido modificado!</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation>Al parecer el archivo\n%1\n ha sido eliminado o renombrado.¿Desea guardarlo ahora?%2</translation>
+    </message>
+    <message>
+        <location line="-192"/>
         <source>Could not open file %1 for write:
 %2.</source>
-        <translation type="unfinished"></translation>
+        <translation>No se ha podido abrir el archivo %1 para escritura:\n%2.</translation>
     </message>
     <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+63"/>
+        <location line="+170"/>
         <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation type="unfinished"></translation>
+        <translation>Al parecer el archivo \&apos;%1\&apos; ha sido modificado por otra aplicación. ¿Desea recargarlo?</translation>
     </message>
 </context>
 <context>
     <name>files_dock_widget</name>
     <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
-        <translation type="unfinished"></translation>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation>Explorador de archivos</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation>Explore sus archivos.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation>Introduzca la dirección o el nombre del archivo </translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation>Subir un directorio</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation>Mostrar el directorio de Octave</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation>Ir al directorio actual de Octave</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation>Fijar el directorio de Octave</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation>Fijar directorio de Octave como directorio actual del explorador</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation>Acciones en el directorio actual</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation>Mostrar el directorio de inicio </translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation>Buscar directorio</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation>Buscar archivos ...</translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation>Archivo nuevo</translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation>Directorio nuevo</translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation>Haga.doble clic sobre un archivo para abrirlo</translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation>Abrir</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation>Abrir en aplicación predeterminada</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation>Copiar selección al portapapeles </translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation>Ejecutar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation>Cargar datos</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation>Fijar directorio actual</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation>Renombrar</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation>Eliminar</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation>Renombrar archivo/directorio</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation>Renombrar archivo/directorio:</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation>\n a: </translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation>Eliminar archivo/directorio</translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sure you want to delete
+</source>
+        <translation>¿Está seguro que desea eliminar\n</translation>
     </message>
     <message>
         <location line="+11"/>
-        <source>Move up one directory.</source>
-        <translation type="unfinished">Subir un directorio.</translation>
+        <source>Can not delete a directory that is not empty</source>
+        <translation>No se puede eliminar un directorio que no esté vacio</translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation>Fijar directorio de explorador de archivos</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation>Crear archivo</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
-        <translation type="unfinished">Introduzca dirección o nombre de archivo.</translation>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation>Crear archivo en</translation>
     </message>
     <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
-        <translation type="unfinished">Haga doble clic para abir archivo.</translation>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation>Crear directorio</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation>Crear carpeta en</translation>
     </message>
 </context>
 <context>
     <name>find_dialog</name>
     <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
         <source>Find &amp;what:</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Buscar:</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Re&amp;place with:</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Reemplazar con:</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Match &amp;case</source>
-        <translation type="unfinished"></translation>
+        <translation>Distinguir &amp;mayúsculas/minúsculas</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Search from &amp;start</source>
-        <translation type="unfinished"></translation>
+        <translation>Buscar desde el &amp;inicio</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>&amp;Wrap while searching</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Marcar mientras se busca</translation>
     </message>
     <message>
         <location line="+2"/>
         <source>&amp;Find Next</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Buscar siguiente</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation>Buscar &amp;anterior</translation>
+    </message>
+    <message>
+        <location line="+1"/>
         <source>&amp;Replace</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Reemplazar</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Replace &amp;All</source>
-        <translation type="unfinished"></translation>
+        <translation>Reemplazar &amp;todo</translation>
     </message>
     <message>
         <location line="+2"/>
         <source>&amp;More</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Más</translation>
     </message>
     <message>
-        <location line="+11"/>
+        <location line="+13"/>
         <source>&amp;Whole words</source>
-        <translation type="unfinished"></translation>
+        <translation>Palabras &amp;completas</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Regular E&amp;xpressions</source>
-        <translation type="unfinished"></translation>
+        <translation>E&amp;xpresiones regulares</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Search &amp;backward</source>
-        <translation type="unfinished"></translation>
+        <translation>Buscar hacia &amp;atrás</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Search se&amp;lection</source>
-        <translation type="unfinished"></translation>
+        <translation>Buscar se&amp;lección</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation>Buscar desde el final</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation>Buscar desde el inicio</translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation>Reemplazar resultado</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation>%1 instancias reemplazadas  </translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation>Resultado de la búsqueda</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation>No se han encontrado más coincidencias  </translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation>Buscar archivos</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation>Nombrado:</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation>Introducir la expresión del nombre de archivo</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation>Iniciar en:</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation>Introducir directorio de inicio</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation>Explorar...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation>Explorar para seleccionar el directorio de inicio</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation>Explorar directorios recursivamente </translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation>Buscar recursivamente archivos que coincidan en los directorios</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation>Incluir directorios</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation>Incluir directorios que coicidan en los resultados de la búsqueda </translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation>Distinguir mayúsculas/minúsculas en nombre  </translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation>Establecer distinción entre mayúsculas y minúsculas en el nombre  </translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation>Contiene el texto:</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation>La búsqueda debe coincidir con el texto</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation>Texto a coincidir </translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation>Distinguir mayúsculas/minúsculas en texto </translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation>Establecer distinción entre mayúsculas y minúsculas en el texto</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation>Resultados de la búsqueda</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Idle.</source>
+        <translation>Inactivo.</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation>Buscar</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation>Empezar búsqueda de archivos coincidentes</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation>Detener</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation>Detener búsqueda</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation>Nombre de archivo/ubicación</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation>Contenido del archivo</translation>
+    </message>
+    <message>
+        <location line="+100"/>
+        <source>Searching...</source>
+        <translation>Buscando...</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation>Fijar directorio de búsqueda</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation>Nombre de archivo</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation>Directorio</translation>
     </message>
 </context>
 <context>
     <name>history_dock_widget</name>
     <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation>Explorar y buscar en el historial de comandos.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
         <source>Doubleclick a command to transfer it to the terminal.</source>
-        <translation type="unfinished">Haga doble clic para transferir el comando a la terminal.</translation>
+        <translation>Haga doble clic para transferir el comando a la terminal.</translation>
     </message>
     <message>
         <location line="+6"/>
         <source>Enter text to filter the command history.</source>
-        <translation type="unfinished">Introduzca texto para filtrar el historial de comandos.</translation>
+        <translation>Introduzca texto para filtrar el historial de comandos.</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Command History</source>
-        <translation type="unfinished">Historial de comandos</translation>
+        <translation>Historial de comandos</translation>
     </message>
     <message>
-        <location line="+42"/>
+        <location line="+20"/>
         <source>Copy</source>
-        <translation type="unfinished"></translation>
+        <translation>Copiar</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Evaluate</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>lexer_octave_gui</name>
-    <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation type="unfinished">Valores predeterminados</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation type="unfinished">Comentario</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation type="unfinished">Comando</translation>
+        <translation>Evaluar</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation type="unfinished">Número</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation type="unfinished">Contraseña</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation type="unfinished">Cadena entre comillas simples</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation type="unfinished">Operador</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation type="unfinished">Identificador</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
-        <translation type="unfinished">Cadena entre comillas dobles</translation>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translatorcomment>Ha sido utilizada la traducción &quot;guión&quot; de script: http://es.wikipedia.org/wiki/Script#Traducci.C3.B3n</translatorcomment>
+        <translation>Crear un guión</translation>
     </message>
 </context>
 <context>
     <name>main_window</name>
     <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation type="unfinished">Guardar espacio de trabajo</translation>
-    </message>
-    <message>
-        <location line="+11"/>
+        <location filename="../src/main-window.cc" line="+155"/>
         <source>Load Workspace</source>
-        <translation type="unfinished">Cargar espacio de trabajo</translation>
+        <translation>Cargar espacio de trabajo</translation>
     </message>
     <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
+        <location line="+355"/>
+        <location line="+769"/>
         <source>About Octave</source>
-        <translation type="unfinished">Acerca de Octave</translation>
-    </message>
-    <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation type="unfinished">Ver variables en el espacio de trabajo activo.</translation>
+        <translation>Acerca de Octave</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation type="unfinished">Navegar y buscar en el historial de comandos.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation type="unfinished">Explorar sus archivos.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation type="unfinished"></translation>
+        <location line="-338"/>
+        <source>&amp;File</source>
+        <translation>&amp;Archivo</translation>
     </message>
     <message>
-        <location line="+39"/>
-        <source>&amp;File</source>
-        <translation type="unfinished">&amp;Archivo</translation>
+        <location line="+52"/>
+        <source>New</source>
+        <translation>Nuevo</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>New</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
+        <location line="+4"/>
         <source>Script</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Function</source>
-        <translation type="unfinished"></translation>
+        <translatorcomment>Guión/&quot;Script&quot;</translatorcomment>
+        <translation>Guión</translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Class</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Figure</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Open...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Preferences...</source>
-        <translation type="unfinished"></translation>
+        <source>Function</source>
+        <translation>Función</translation>
     </message>
     <message>
         <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation type="unfinished"></translation>
+        <source>Figure</source>
+        <translation>Figura</translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation type="unfinished"></translation>
+        <location line="-55"/>
+        <source>Open...</source>
+        <translation>Abrir...</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation type="unfinished"></translation>
+        <location line="+18"/>
+        <source>Preferences...</source>
+        <translation>Preferencias...</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Exit</source>
-        <translation type="unfinished">Salir</translation>
+        <translation>Salir</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+51"/>
         <source>&amp;Edit</source>
-        <translation type="unfinished">&amp;Editar</translation>
+        <translation>&amp;Editar</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+5"/>
         <source>Undo</source>
-        <translation type="unfinished"></translation>
+        <translation>Deshacer</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
+        <location line="+7"/>
+        <source>Copy</source>
+        <translation>Copiar</translation>
     </message>
     <message>
         <location line="+5"/>
-        <source>Cut</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Copy</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
         <source>Paste</source>
-        <translation type="unfinished"></translation>
+        <translation>Pegar</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Paste To Workspace...</source>
-        <translation type="unfinished"></translation>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
+        <translation>Guardar espacio de trabajo como</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Select All</source>
-        <translation type="unfinished"></translation>
+        <location line="-602"/>
+        <source>Set working directory</source>
+        <translation>Fijar directorio de trabajo</translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
+        <location line="+686"/>
+        <source>Find Files...</source>
+        <translation>Buscar archivos...</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Find Files...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
         <source>Clear Command Window</source>
-        <translation type="unfinished"></translation>
+        <translation>Limpiar ventana de comandos</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Clear Command History</source>
-        <translation type="unfinished"></translation>
+        <translation>Limpiar historial de comandos</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
-        <translation type="unfinished"></translation>
+        <translation>Limpiar espacio de trabajo</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
-        <translation type="unfinished"></translation>
+        <translation>&amp;Depurar</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
-        <translation type="unfinished"></translation>
+        <translation>Siguiente instrucción </translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
-        <translation type="unfinished"></translation>
+        <translation>Entrar en una función</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
-        <translation type="unfinished"></translation>
+        <translation>Salir de una función</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Continue</source>
+        <translation>Continuar</translation>
     </message>
     <message>
         <location line="+8"/>
-        <source>Continue</source>
-        <translation type="unfinished"></translation>
+        <source>Exit Debug Mode</source>
+        <translation>Salir del modo de depuración</translation>
+    </message>
+    <message>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation>Mostrar explorador de archivos</translation>
     </message>
     <message>
-        <location line="+13"/>
-        <source>Exit Debug Mode</source>
-        <translation type="unfinished"></translation>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation>Explorador de archivos</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
+        <translation>Reestablecer esquema de ventana predeterminado</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
-        <translation type="unfinished"></translation>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation>En disco</translation>
     </message>
     <message>
-        <location line="+1"/>
-        <source>Load workspace</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation>En línea</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation>Introducir nombre de directorio</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
+        <translation>Directorio actual:</translation>
     </message>
     <message>
         <location line="+4"/>
-        <source>&amp;Window</source>
-        <translation type="unfinished"></translation>
+        <source>One directory up</source>
+        <translation>Directorio superior</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation>Explorar directorios</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Show Command Window</source>
-        <translation type="unfinished"></translation>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation>Cargar espacio de trabajo</translation>
+    </message>
+    <message>
+        <location line="+192"/>
+        <source>&amp;Window</source>
+        <translation>&amp;Ventana</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Show Command History</source>
-        <translation type="unfinished"></translation>
+        <source>Show Command Window</source>
+        <translation>Mostrar ventana de comandos</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Show Command History</source>
+        <translation>Mostrar historial de comandos</translation>
     </message>
     <message>
         <location line="+6"/>
         <source>Show Workspace</source>
-        <translation type="unfinished"></translation>
+        <translation>Mostrar espacio de trabajo</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Editor</source>
+        <translation>Mostrar editor</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Documentation</source>
+        <translation>Mostrar documentación</translation>
     </message>
     <message>
         <location line="+5"/>
-        <source>Show Editor</source>
-        <translation type="unfinished"></translation>
+        <source>Command Window</source>
+        <translation>Ventana de comandos</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Command History</source>
+        <translation>Historial de comandos</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Workspace</source>
+        <translation>Espacio de trabajo</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Documentation</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Editor</source>
+        <translation>Editor</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+108"/>
+        <source>Documentation</source>
+        <translation>Documentación</translation>
+    </message>
+    <message>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation>&amp;Ayuda</translation>
     </message>
     <message>
         <location line="+7"/>
-        <source>Command Window</source>
-        <translation type="unfinished"></translation>
+        <source>Report Bug</source>
+        <translation>Informar de fallo</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Command History</source>
-        <translation type="unfinished">Historial de comandos</translation>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation>Visitar Agora</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation type="unfinished"></translation>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation>Visitar Octave Forge</translation>
     </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
     <message>
-        <location line="+4"/>
-        <source>Workspace</source>
-        <translation type="unfinished">Espacio de trabajo</translation>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
+        <translatorcomment>Uso &quot;widget&quot; por ser el término usual: http://es.wikipedia.org/wiki/Widget</translatorcomment>
+        <translation>Desacoplar widget</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Editor</source>
-        <translation type="unfinished">Editor</translation>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translatorcomment>Uso &quot;widget&quot; por ser el término usual: http://es.wikipedia.org/wiki/Widget</translatorcomment>
+        <translation>Ocultar widget</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Documentation</source>
-        <translation type="unfinished">Documentación</translation>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translatorcomment>Uso &quot;widget&quot; por ser el término usual: http://es.wikipedia.org/wiki/Widget</translatorcomment>
+        <translation>Acoplar widget</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation>Ayuda</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translatorcomment>Uso la traducción &quot;ruta&quot; para &quot;path&quot;: http://es.wikipedia.org/wiki/Ruta_(informática)</translatorcomment>
+        <translation>El archivo %1 no existe en la ruta de carga.  Para depurar la función que acualmente edita, tiene que cambiar ya sea el directorio %2 o agregar ese directorio a la ruta de carga.</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
+        <translation>El archivo %1 es afectado por un archivo con el mismo nombre en la ruta de carga.  Para depurar la función que edita, cambie al directorio%2. </translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Report Bug</source>
-        <translation type="unfinished">Reportar error de software/Bug</translation>
+        <source>Change Directory or Add Directory to Load Path</source>
+        <translation>Cambiar directorio o agregar directorio a la ruta de carga</translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Visit Agora</source>
-        <translation type="unfinished"></translation>
+        <source>Change Directory</source>
+        <translation>Cambiar directorio</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Visit Octave Forge</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translatorcomment>Uso la traducción &quot;ruta&quot; para &quot;path&quot;: http://es.wikipedia.org/wiki/Ruta_(informática)</translatorcomment>
+        <translation>Agregar directorio a la ruta de carga</translation>
     </message>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>Cancelar</translation>
     </message>
 </context>
 <context>
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
-        <translation type="unfinished">Configuración</translation>
+        <translation>Configuración</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Octave logo only</source>
-        <translation type="unfinished"></translation>
+        <translation>General</translation>
     </message>
     <message>
-        <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Letter icons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
-        <translation type="unfinished">Editor</translation>
+        <location line="+97"/>
+        <source>Octave logo only</source>
+        <translation>Sólo logo de Octave</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font</source>
-        <translation type="unfinished"></translation>
+        <source>Letter icons</source>
+        <translation>Íconos de letras</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Graphic icons</source>
+        <translation>Íconos gráficos</translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation type="unfinished"></translation>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation>Editor</translation>
+    </message>
+    <message>
+        <location line="+16"/>
+        <source>Show white space</source>
+        <translation>Mostrar espacios en blanco</translation>
     </message>
     <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <source>Show line numbers</source>
-        <translation type="unfinished"></translation>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation>No mostrar espacios en blanco de sangría</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Highlight current line</source>
-        <translation type="unfinished"></translation>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation>Color</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Code completion</source>
-        <translation type="unfinished"></translation>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation>Ancho de sangría</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show complete path in window title</source>
-        <translation type="unfinished"></translation>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation>Sangrar con tabulación</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation type="unfinished"></translation>
+        <source>Auto indentation</source>
+        <translation>Sangría automática</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation>Tamaño de tabulador </translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation>Mostrar guías de sangría</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation>Tecla de retroceso quita sangría</translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation>Caracteres mostrados antes de la lista de sugerencias</translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation type="unfinished">Usar editor de archivos personalizados:</translation>
+        <location line="+71"/>
+        <source>Match keywords</source>
+        <translation>Coincidir en palabras clave</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Case sensitive</source>
+        <translation>Distinguir mayúsculas/minúsculas</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>emacs</source>
-        <translation type="unfinished">emacs</translation>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation>Sustituir palabra con sugerencia</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation>Coincidir palabras en documento</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation>Restaurar las pestañas del editor de la sesión anterior en el arranque </translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
+        <translation>Utilizar editor de archivos personalizado</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
-        <source>Terminal</source>
-        <translation type="unfinished">Terminal</translation>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation>Línea de comando (%f=archivo,%l=línea):</translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation>Estilos del editor</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Seleciona tipo de fuente, Tamaño de fuente (a diferencia del tamaño predeterminado), decoración de la fuente (negrita, cursiva, subrayada), color del texto y color del fondo  (para este último, el color rosa (255,0,255) es el color predeterminado)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
-        <source>Cursor type:</source>
-        <translation type="unfinished"></translation>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation>Utilizar color de primer plano </translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation>Colores de la terminal</translation>
+    </message>
+    <message>
+        <location line="+46"/>
+        <source>Font</source>
+        <translation>Tipo de fuente</translation>
+    </message>
+    <message>
+        <location line="-745"/>
+        <source>Show line numbers</source>
+        <translation>Mostrar numeros de línea</translation>
     </message>
     <message>
         <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Cursor blinking</source>
-        <translation type="unfinished"></translation>
+        <source>Highlight current line</source>
+        <translation>Resaltar línea actual</translation>
+    </message>
+    <message>
+        <location line="+262"/>
+        <source>Code completion</source>
+        <translation>Autocompletar código</translation>
+    </message>
+    <message>
+        <location line="-282"/>
+        <source>Show complete path in window title</source>
+        <translation>Mostrar ruta completa en el título de la ventana</translation>
+    </message>
+    <message>
+        <location line="+548"/>
+        <source>emacs</source>
+        <translation>emacs</translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+67"/>
+        <source>Terminal</source>
+        <translation>Terminal</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>Cursor type:</source>
+        <translation>Tipo de cursor: </translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Cursor blinking</source>
+        <translation>Cursor parpadeante</translation>
+    </message>
+    <message>
+        <location line="+102"/>
+        <source>Font size</source>
+        <translation>Tamaño de fuente</translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>File Browser</source>
-        <translation type="unfinished">Explorador de archivos</translation>
+        <translation>Explorador de archivos</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation type="unfinished">Mostrar nombres de archivos</translation>
+        <source>Show file size</source>
+        <translation>Mostrar tamaño de archivo</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show file size</source>
-        <translation type="unfinished">Mostrar tamaño de archivo</translation>
+        <source>Show file type</source>
+        <translation>Mostrar tipo de archivo</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show file type</source>
-        <translation type="unfinished">Mostrar tipo de archivo</translation>
+        <source>Show date of last modification</source>
+        <translation>Mostrar fecha de la última modificación</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show date of last modification</source>
-        <translation type="unfinished">Mostrar fecha de la última modificación</translation>
+        <source>Show hidden files</source>
+        <translation>Mostrar archivos ocultos</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show hidden files</source>
-        <translation type="unfinished">Mostrar archivos ocultos</translation>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation>Sincronizar el directorio de Octave con el explorador de archivos</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Alternating row colors</source>
-        <translation type="unfinished">Colores alternos de filas</translation>
+        <translation>Alternar colores de filas</translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation>Espacio de trabajo</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation>Colores para las clases de almacenamiento</translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
-        <translation type="unfinished"></translation>
+        <translation>Red</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Use proxy server</source>
+        <translation>Utilizar servidor &quot;proxy&quot;</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Proxy Type:</source>
+        <translation>Tipo de proxy:</translation>
+    </message>
+    <message>
+        <location line="-33"/>
+        <source>HttpProxy</source>
+        <translation>HttpProxy</translation>
+    </message>
+    <message>
+        <location line="-1108"/>
+        <source>Icon set for dock widgets</source>
+        <translation>Íconos para widget acoplados</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation>Lenguaje (reinicio requerido)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation>Tamaño de ícono</translation>
+    </message>
+    <message>
+        <location line="+1099"/>
+        <source>Socks5Proxy</source>
+        <translation>&quot;Socks5Proxy&quot;</translation>
+    </message>
+    <message>
+        <location line="-16"/>
+        <source>Hostname:</source>
+        <translation>Nombre del host:</translation>
+    </message>
+    <message>
+        <location line="+54"/>
+        <source>Port:</source>
+        <translation>Puerto:</translation>
+    </message>
+    <message>
+        <location line="-27"/>
+        <source>Username:</source>
+        <translation>Nombre de usuario:</translation>
+    </message>
+    <message>
+        <location line="+37"/>
+        <source>Password:</source>
+        <translation>Contraseña:</translation>
+    </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation>Configuración del sistema</translation>
+    </message>
+    <message>
+        <location line="-137"/>
+        <source>Difference to the default size</source>
+        <translation>Diferencia con el tamaño predeterminado</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
-        <source>Use proxy server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Proxy Type:</source>
-        <translation type="unfinished"></translation>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation>Color de fondo, rosa (255,0,255) significa predeterminado</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
-        <source>HttpProxy</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Socks5Proxy</source>
-        <translation type="unfinished"></translation>
+        <location line="+2"/>
+        <source>b</source>
+        <translation>b</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
-        <source>Hostname:</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>i</source>
+        <translation>i</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Port:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Username:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Password:</source>
-        <translation type="unfinished">Contraseña:</translation>
+        <location line="+1"/>
+        <source>u</source>
+        <translation>u</translation>
     </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
-        <translation type="unfinished"></translation>
+        <translation>Ventana de comandos</translation>
     </message>
 </context>
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
-        <translation type="unfinished"></translation>
+        <translation>Escriba aquí y pulse la tecla de &apos;Retorno&apos; para buscar</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Global search</source>
-        <translation type="unfinished"></translation>
+        <translation>Búsqueda global</translation>
     </message>
 </context>
 <context>
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
-        <translation type="unfinished"></translation>
+        <translation>Bienvenido a GNU Octave</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
-        <translation type="unfinished"></translation>
+        <translation> Al parecer ha iniciado Octave GUI por primera vez en su 
+  computadora/ordenador, ya que no se ha encontrado un archivo 
+  de configuración en &apos;~/.octave-gui&apos;. Este asistente lo guiará con los ajustes esenciales que 
+  debe hacer antes de empezar a usar Octave GUI. Si desea transferir su configuración hecha con anterioridad 
+  solamente cierre este diálogo y copie el archivo de configuración en su carpeta de inicio. La presencia de dicho archivo de configuración será detectada automáticamente y evitará esta ventana de asistencia.  
+  IMPORTANTE: Este asistente no es completamente funcional aún. Simplemente haga clic de inicio a fin y el asistente creará un archivo de configuración estándar. </translation>
     </message>
     <message>
         <location line="+41"/>
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
-        <translation type="unfinished"></translation>
+        <translation>Siguiente</translation>
     </message>
     <message>
         <location line="-124"/>
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
-        <translation type="unfinished"></translation>
+        <translation>Anterior</translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
-        <translation type="unfinished"></translation>
+        <translation>¡Bienvenido a Octave!</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
-        <translation type="unfinished"></translation>
+        <translation>Esta es la versión en desarrollo de Octave con su primer GUI oficial.</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
-        <translation type="unfinished"></translation>
+        <translation>Parece que ejecuta Octave GUI por primera vez en esta computadora/ordenador. Este asistente le ayudará a configurar la instalación del programa. Presione &quot;Terminar&quot; para escribir un archivo de configuración e iniciar Octave GUI. </translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
-        <translation type="unfinished"></translation>
+        <translation>Terminar</translation>
     </message>
 </context>
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
-        <translation type="unfinished">Nombre</translation>
+        <translation>Nombre</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Class</source>
+        <translation>Clase</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Class</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Dimension</source>
+        <translation>Dimensión</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Dimension</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Value</source>
+        <translation>Valor</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Value</source>
-        <translation type="unfinished">Valor</translation>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation>Clase de almacenamiento</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation>Clic derecho para copiar, renombrar o mostrar</translation>
     </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
-        <translation type="unfinished">Espacio de trabajo</translation>
+        <translation>Espacio de trabajo</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation>Ver variables en el espacio de trabajo activo.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation>Copiar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation>Renombrar</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation>Sólo símbolos de alto nivel pueden ser renombrados.</translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation>Ver variables del espacio de trabajo activo.&lt;br&gt;</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation>Colores para cada clase de almacenamiento:</translation>
     </message>
 </context>
 </TS>
new file mode 100644
--- /dev/null
+++ b/libgui/languages/fr_FR.ts
@@ -0,0 +1,1677 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation>Tout sélectionner</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation>automatique</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation>fonction</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation>global</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation>caché</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation>hérité</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation>persistant</translation>
+    </message>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.cc" line="+64"/>
+        <source>foreground</source>
+        <translation>avant plan</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>background</source>
+        <translation>arrière plan</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>selection</source>
+        <translation>sélection</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>cursor</source>
+        <translation>curseur</translation>
+    </message>
+</context>
+<context>
+    <name>QTerminal</name>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.h" line="+116"/>
+        <source>Copy</source>
+        <translation>Copier</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Paste</source>
+        <translation>Coller</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Clear All</source>
+        <translation>Tout Effacer</translation>
+    </message>
+</context>
+<context>
+    <name>QWinTerminalImpl</name>
+    <message>
+        <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1451"/>
+        <source>copied selection to clipboard</source>
+        <translation>sélection copiée vers le presse-papier</translation>
+    </message>
+</context>
+<context>
+    <name>documentation_dock_widget</name>
+    <message>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
+        <source>Documentation</source>
+        <translation>Documentation</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation>Regardez la documentation pour plus d&apos;aide.</translation>
+    </message>
+</context>
+<context>
+    <name>file_editor</name>
+    <message>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
+        <source>Octave Editor</source>
+        <translation>Éditeur d&apos;Octave</translation>
+    </message>
+    <message>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Fichiers d&apos;Octave (*.m);;Tous les fichiers (*)</translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Could not open file %1 for read:
+%2.</source>
+        <translation>Impossible d&apos;ouvrir le fichier %1 pour lecture :
+%2.</translation>
+    </message>
+    <message>
+        <location line="+49"/>
+        <source>File not saved! A file with the selected name
+%1
+is already open in the editor</source>
+        <translation>Fichier non-enregistré! Un fichier ayant le nom sélectionné
+%1
+est déjà ouvert dans l&apos;éditeur</translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
+        <translation>L&apos;onglet éditeur de fichier associé a disparu. Il a probablement été fermé par un moyen quelconque.</translation>
+    </message>
+    <message>
+        <location line="+205"/>
+        <source>&amp;%1 %2</source>
+        <translation>&amp;%1 %2</translation>
+    </message>
+    <message>
+        <location line="+159"/>
+        <source>&amp;New File</source>
+        <translation>&amp;Nouveau</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Open File</source>
+        <translation>&amp;Ouvrir</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Save File</source>
+        <translation>&amp;Enregistrer</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Save File &amp;As</source>
+        <translation>Enregistrer &amp;sous</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation>Imprimer</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Undo</source>
+        <translation>&amp;Annuler</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Redo</source>
+        <translation>&amp;Rétablir</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Copy</source>
+        <translation>&amp;Copier</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Cu&amp;t</source>
+        <translation>Co&amp;uper</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Paste</source>
+        <translation>Coller</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Next Bookmark</source>
+        <translation>Marque page &amp;suivant</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Pre&amp;vious Bookmark</source>
+        <translation>Marque page &amp;précédent</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Toggle &amp;Bookmark</source>
+        <translation>Basculer &amp;marque page</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Remove All Bookmarks</source>
+        <translation>&amp;Supprimer tout marque page</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>&amp;Next breakpoint</source>
+        <translation>Point d&apos;arrêt &amp;suivant</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Pre&amp;vious breakpoint</source>
+        <translation>Point d&apos;arrêt &amp;précédent</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Toggle &amp;breakpoint</source>
+        <translation>&amp;Basculer point d&apos;arrêt</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Remove All breakpoints</source>
+        <translation>&amp;Enlever tout point d&apos;arrêt</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
+        <translation>&amp;Commenter</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation>&amp;Décommenter</translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation>Fichiers &amp;récents</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation>&amp;Fermer</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation>Tout fermer</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation>Fermer les autres fichiers</translation>
+    </message>
+    <message>
+        <location line="-94"/>
+        <source>&amp;Find and Replace</source>
+        <translation>&amp;Rechercher et remplacer</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Save File And Run</source>
+        <translation>Enregistrer et exécuter</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation>&amp;Aller à la ligne</translation>
+    </message>
+    <message>
+        <location line="+63"/>
+        <source>&amp;File</source>
+        <translation>&amp;Fichier</translation>
+    </message>
+    <message>
+        <location line="+35"/>
+        <source>&amp;Edit</source>
+        <translation>&amp;Editer</translation>
+    </message>
+    <message>
+        <location line="+21"/>
+        <source>&amp;Debug</source>
+        <translation>&amp;Déboguer</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>&amp;Run</source>
+        <translation>&amp;Exécuter</translation>
+    </message>
+</context>
+<context>
+    <name>file_editor_tab</name>
+    <message>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation>Aller à la ligne</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation>Numéro de ligne</translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation>&lt;sans nom&gt;</translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation>Voulez-vous enregistrer ou supprimer les modifications ?</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation>Voulez-vous annuler la fermeture, enregistrer ou supprimer les modifications ?</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
+        <source>Octave Editor</source>
+        <translation>Éditeur d&apos;Octave</translation>
+    </message>
+    <message>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation>Le fichier
+%1
+est en cours de fermeture mais il a été modifié.
+%2</translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Fichiers d&apos;Octave (*.m);;Tous les fichiers (*)</translation>
+    </message>
+    <message>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation>Le fichier n&apos;a pas été enregistré. Le nom du fichier
+%1
+est le même que le nom du fichier courant</translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation>
+
+Avertissement: Le contenu dans l&apos;éditeur est modifié!</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation>Il semblerait que le fichier
+%1
+a été supprimé ou rénommé. Voulez-vous l&apos;enregistrer maintenant ?%2</translation>
+    </message>
+    <message>
+        <location line="-192"/>
+        <source>Could not open file %1 for write:
+%2.</source>
+        <translation>Impossible d&apos;ouvrir le fichier %1 pour écrire :
+%2.</translation>
+    </message>
+    <message>
+        <location line="+170"/>
+        <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
+        <translation>Il semblerait que &apos;%1&apos; a été modifié par une autre application. Voulez-vous le récharger ?</translation>
+    </message>
+</context>
+<context>
+    <name>files_dock_widget</name>
+    <message>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation>Explorateur de fichiers</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation>Explorer vos fichiers.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation>Entrez le chemin ou le nom du fichier</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation>Remonter d&apos;un répertoire</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation>Revenir au répertoire d&apos;Octave</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation>Aller au répertoire courant d&apos;Octave</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation>Définir le répertoire d&apos;Octave</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation>Définir le répertoire du navigateur comme répertoire d&apos;Octave</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation>Actions sur le répertoire courant</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation>Aller au répertoire personnel</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation>Rechercher dans le répertoire</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation>Rechercher des fichiers...</translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation>Nouveau fichier</translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation>Nouveau répertoire</translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation>Double cliquez sur un fichier pour l&apos;ouvrir</translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation>Ouvrir</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation>Ouvrir dans l&apos;application par défaut</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation>Copier la sélection vers le presse-papiers</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation>Exécuter</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation>Charger les données</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation>Définir le répertoire courant</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation>Rénommer</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation>Supprimer</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation>Rénommer fichier/répertoire</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation>Rénommer fichier/répertoire:
+</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation>
+ en : </translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation>Supprimer fichier/répertoire</translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sure you want to delete
+</source>
+        <translation>Etes-vous sûr de vouloir supprimer
+</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Can not delete a directory that is not empty</source>
+        <translation>Impossible de supprimer un répertoire qui n&apos;est pas vide</translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation>Définir le répertoire de l&apos;explorateur de fichiers</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation>Créer un fichier</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation>Créer un fichier dans
+</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation>Créer un répertoire</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation>Créer un répertoire dans
+</translation>
+    </message>
+</context>
+<context>
+    <name>find_dialog</name>
+    <message>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
+        <source>Find &amp;what:</source>
+        <translation>Rechercher &amp;quoi :</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Re&amp;place with:</source>
+        <translation>Rem&amp;placer par :</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Match &amp;case</source>
+        <translation>Respecter &amp;la casse</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search from &amp;start</source>
+        <translation>Rechercher depuis &amp;le début</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>&amp;Wrap while searching</source>
+        <translation>&amp;Reprendre la recherche au début du fichier</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;Find Next</source>
+        <translation>Rechercher le &amp;suivant</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation>Rechercher le &amp;précédent</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>&amp;Replace</source>
+        <translation>&amp;Remplacer</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Replace &amp;All</source>
+        <translation>&amp;Tout remplacer</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;More</source>
+        <translation>&amp;Plus d&apos;options</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>&amp;Whole words</source>
+        <translation>&amp;Mots entiers</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Regular E&amp;xpressions</source>
+        <translation>E&amp;xpressions régulières</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search &amp;backward</source>
+        <translation>Recherche vers l&apos;&amp;arrière</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search se&amp;lection</source>
+        <translation>Recherche dans la sé&amp;lection</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation>Rechercher depuis la fin</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation>Rechercher depuis le début</translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation>Résultats du remplacement</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation>%1 instances remplacées</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation>Résultats de la recherche</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation>Plus aucune correspondance trouvée</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation>Rechercher des fichiers</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation>Nommé:</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation>Entrer le nom du fichier ou une expression</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation>Demarrer dans :</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation>Répetoire de démarrage</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation>Naviguer...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation>Choisir le répertoire de démarrage</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation>Parcourir récursivement les sous-répertoires</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation>Rechercher les fichiers recursivement dans les sous-répertoires</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation>Inclure les répertoires</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation>Inclure les répertoires concordants dans des résultats de la recherche</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation>Nom insensible à la casse</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation>Les noms concordant sont insensible à la casse</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation>Contenant le texte :</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation>La recherche doit contenir le texte</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation>Texte à rechercher</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation>Texte insensible à la casse</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation>Le texte recherché est insensible à la casse</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation>Résultats de la recherche</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Idle.</source>
+        <translation>Inoccupé.</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation>Rechercher</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation>Démarrer la recherche des fichiers concordants</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation>Arrêter</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation>Arrêter la recherche</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation>Nom/Chemin de fichier</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation>Contenu du fichier</translation>
+    </message>
+    <message>
+        <location line="+99"/>
+        <source>Searching...</source>
+        <translation>Recherche en cours...</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation>Définir le répertoire de recherche</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation>Nom du fichier</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation>Répertoire</translation>
+    </message>
+</context>
+<context>
+    <name>history_dock_widget</name>
+    <message>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation>Naviguer et rechercher l&apos;historique des commandes.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Doubleclick a command to transfer it to the terminal.</source>
+        <translation>Double cliquez sur une commande pour la transférer vers le terminal.</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Enter text to filter the command history.</source>
+        <translation>Entrez du texte pour filtrer l&apos;historique des commandes.</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Command History</source>
+        <translation>Historique des commandes</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Copy</source>
+        <translation>Copier</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Evaluate</source>
+        <translation>Évaluer</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translation>Créer un fichier de script</translation>
+    </message>
+</context>
+<context>
+    <name>main_window</name>
+    <message>
+        <location filename="../src/main-window.cc" line="+155"/>
+        <source>Load Workspace</source>
+        <translation>Charger l&apos;espace de travail</translation>
+    </message>
+    <message>
+        <location line="+355"/>
+        <location line="+769"/>
+        <source>About Octave</source>
+        <translation>À propos d&apos;Octave</translation>
+    </message>
+    <message>
+        <location line="-338"/>
+        <source>&amp;File</source>
+        <translation>&amp;Fichier</translation>
+    </message>
+    <message>
+        <location line="+52"/>
+        <source>New</source>
+        <translation>Nouveau</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Script</source>
+        <translation>Fichier de script</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Function</source>
+        <translation>Fonction</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Figure</source>
+        <translation>Figure</translation>
+    </message>
+    <message>
+        <location line="-55"/>
+        <source>Open...</source>
+        <translation>Ouvrir...</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Preferences...</source>
+        <translation>Préférences...</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Exit</source>
+        <translation>Quitter</translation>
+    </message>
+    <message>
+        <location line="+51"/>
+        <source>&amp;Edit</source>
+        <translation>&amp;Editer</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Undo</source>
+        <translation>Annuler</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Copy</source>
+        <translation>Copier</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Paste</source>
+        <translation>Coller</translation>
+    </message>
+    <message>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
+        <translation>Enregistrer l&apos;espace de travail sous</translation>
+    </message>
+    <message>
+        <location line="-602"/>
+        <source>Set working directory</source>
+        <translation>Définir le répertoire de travail</translation>
+    </message>
+    <message>
+        <location line="+686"/>
+        <source>Find Files...</source>
+        <translation>Rechercher des fichiers...</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Clear Command Window</source>
+        <translation>Nettoyer la fenêtre de commande</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Clear Command History</source>
+        <translation>Nettoyer l&apos;historique des commandes</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Clear Workspace</source>
+        <translation>Nettoyer l&apos;espace de travail</translation>
+    </message>
+    <message>
+        <location line="+36"/>
+        <source>De&amp;bug</source>
+        <translation>Dé&amp;boguer</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Step</source>
+        <translation>Avancer d&apos;un pas</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Step in</source>
+        <translation>Avancer d&apos;un pas avec entrée</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Step out</source>
+        <translation>Exécuter jusqu&apos;à l&apos;instruction de retour</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Continue</source>
+        <translation>Continuer</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Exit Debug Mode</source>
+        <translation>Sortir du mode débogage</translation>
+    </message>
+    <message>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation>Afficher l&apos;explorateur de fichiers</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation>Explorateur de fichiers</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
+        <translation>Rétablir la disposition par défaut des fenêtres</translation>
+    </message>
+    <message>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation>Installé localement</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation>En ligne</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation>Entrez le nom du répertoire</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
+        <translation>Répertoire courant : </translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>One directory up</source>
+        <translation>Monter au répertoire parent</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation>Naviguer dans les répertoires</translation>
+    </message>
+    <message>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation>Charger l&apos;espace de travail</translation>
+    </message>
+    <message>
+        <location line="+192"/>
+        <source>&amp;Window</source>
+        <translation>&amp;Fenêtre</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Show Command Window</source>
+        <translation>Afficher la fenêtre de commande</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Command History</source>
+        <translation>Afficher l&apos;historique des commandes</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Show Workspace</source>
+        <translation>Afficher l&apos;espace de travail</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Editor</source>
+        <translation>Afficher l&apos;éditeur</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Documentation</source>
+        <translation>Afficher la documentation</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Command Window</source>
+        <translation>Fenêtre de commande</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Command History</source>
+        <translation>Historique des commandes</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Workspace</source>
+        <translation>Espace de travail</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Editor</source>
+        <translation>Éditeur</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+108"/>
+        <source>Documentation</source>
+        <translation>Documentation</translation>
+    </message>
+    <message>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation>&amp;Aide</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Report Bug</source>
+        <translation>Signaler un bogue</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation>Visiter Agora</translation>
+    </message>
+    <message>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation>Visiter Octave Forge</translation>
+    </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
+    <message>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
+        <translation>Détacher le widget</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translation>Cacher le widget</translation>
+    </message>
+    <message>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation>Attacher le widget</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation>aide</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation>Le fichier %1 n&apos;existe pas dans les chemins accessibles. Pour déboguer la fonction que vous éditez, vous devez soit modifier le répertoire pour %2 ou ajouter le répertoire aux chemins accessibles.</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
+        <translation>Le fichier %1 est occulté par un fichier du même nom dans les chemins accessibles. Pour déboguer la fonction que vous éditez, vous devez modifier le répertoire pour %2.</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Change Directory or Add Directory to Load Path</source>
+        <translation>Changer de répertoire ou ajouter le répertoire aux chemins accessibles</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Change Directory</source>
+        <translation>Changer le répertoire</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation>Ajouter le répertoire aux chemins accessibles</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>Annuler</translation>
+    </message>
+</context>
+<context>
+    <name>settings_dialog</name>
+    <message>
+        <location filename="../src/settings-dialog.ui" line="+29"/>
+        <source>Settings</source>
+        <translation>Configuration</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>General</source>
+        <translation>Général</translation>
+    </message>
+    <message>
+        <location line="+97"/>
+        <source>Octave logo only</source>
+        <translation>Logo d&apos;Octave seulement</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Letter icons</source>
+        <translation>Icones textuelles</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Graphic icons</source>
+        <translation>Icones graphiques</translation>
+    </message>
+    <message>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation>Éditeur</translation>
+    </message>
+    <message>
+        <location line="+16"/>
+        <source>Show white space</source>
+        <translation>Montrer les espaces</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation>Ne pas montrer les espaces utilisés pour l&apos;indentation</translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation>Couleur</translation>
+    </message>
+    <message>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation>Largeur de l&apos;indentation</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation>Indentation par tabulation</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Auto indentation</source>
+        <translation>Indentation automatique</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation>Largeur de tabulation</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation>Afficher les guides d&apos;indentation</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation>Backspace supprime l&apos;indentation</translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation>Nombre de caracteres avant d&apos;afficher la liste de suggestions</translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Match keywords</source>
+        <translation>Inclure les mots clés</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Case sensitive</source>
+        <translation>Sensible à la casse</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation>Remplacer le mot par la suggestion</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation>Inclure les mots du document</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation>Restaurer les onglets de la session précédente</translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
+        <translation>Utiliser un éditeur externe</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation>Ligne de commande (%f=fichier, %l=ligne) :</translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation>Affichage</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choisir la police, la taille (différence avec à la taille par défaut), le style (gras, italique, souligné), la couleur du texte et du fond (pour ce dernier, la couleur rose [255,0,255] designe la couleur par défaut)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+    <message>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation>Utiliser la couleur du texte</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation>Couleurs de la fenetre de commandes</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Font</source>
+        <translation>Police</translation>
+    </message>
+    <message>
+        <location line="-744"/>
+        <source>Show line numbers</source>
+        <translation>Afficher les numéros des lignes</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Highlight current line</source>
+        <translation>Surligner la ligne courante</translation>
+    </message>
+    <message>
+        <location line="+262"/>
+        <source>Code completion</source>
+        <translation>Suggestions de saisie</translation>
+    </message>
+    <message>
+        <location line="-282"/>
+        <source>Show complete path in window title</source>
+        <translation>Afficher le chemin complet dans le titre de la fenetre</translation>
+    </message>
+    <message>
+        <location line="+548"/>
+        <source>emacs</source>
+        <translation>emacs</translation>
+    </message>
+    <message>
+        <location line="+67"/>
+        <source>Terminal</source>
+        <translation>Terminal</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>Cursor type:</source>
+        <translation>Type de curseur :</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Cursor blinking</source>
+        <translation>Curseur clignotant</translation>
+    </message>
+    <message>
+        <location line="+101"/>
+        <source>Font size</source>
+        <translation>Taille de police</translation>
+    </message>
+    <message>
+        <location line="+35"/>
+        <source>File Browser</source>
+        <translation>Explorateur de fichiers</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Show file size</source>
+        <translation>Afficher la taille des fichiers</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show file type</source>
+        <translation>Afficher le type des fichiers</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show date of last modification</source>
+        <translation>Afficher la date de la dernière modification</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show hidden files</source>
+        <translation>Afficher les fichiers cachés</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation>Synchronizer le répertoire de travail avec le navigateur de fichiers</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Alternating row colors</source>
+        <translation>Alterner les couleurs des lignes</translation>
+    </message>
+    <message>
+        <location line="+21"/>
+        <source>Workspace</source>
+        <translation>Espace de travail</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation>Couleurs des variables</translation>
+    </message>
+    <message>
+        <location line="+35"/>
+        <source>Network</source>
+        <translation>Réseau</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Use proxy server</source>
+        <translation>Utiliser un serveur proxy</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Proxy Type:</source>
+        <translation>Type de proxy :</translation>
+    </message>
+    <message>
+        <location line="-33"/>
+        <source>HttpProxy</source>
+        <translation>Proxy HTTP</translation>
+    </message>
+    <message>
+        <location line="-1107"/>
+        <source>Icon set for dock widgets</source>
+        <translation>Jeu d&apos;icones pour les widgets</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation>Langue (nécessite un redémarrage)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation>Taille des icones</translation>
+    </message>
+    <message>
+        <location line="+1098"/>
+        <source>Socks5Proxy</source>
+        <translation>Proxy Socks5</translation>
+    </message>
+    <message>
+        <location line="-16"/>
+        <source>Hostname:</source>
+        <translation>Nom de l&apos;hote :</translation>
+    </message>
+    <message>
+        <location line="+54"/>
+        <source>Port:</source>
+        <translation>Port :</translation>
+    </message>
+    <message>
+        <location line="-27"/>
+        <source>Username:</source>
+        <translation>Nom d&apos;utilisateur :</translation>
+    </message>
+    <message>
+        <location line="+37"/>
+        <source>Password:</source>
+        <translation>Mot de passe :</translation>
+    </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation>Reglages système</translation>
+    </message>
+    <message>
+        <location line="-268"/>
+        <source>IBeam Cursor</source>
+        <translation>Curseur Trait Vertical</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Block Cursor</source>
+        <translation>Curseur Block</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Underline Cursor</source>
+        <translation>Curseur Tiret Bas</translation>
+    </message>
+    <message>
+        <location line="+129"/>
+        <source>Difference to the default size</source>
+        <translation>Différence avec la taille par défaut</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation>Couleur de fond, rose [255,0,255] designe la valeur par défaut</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>b</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>i</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <translation></translation>
+    </message>
+</context>
+<context>
+    <name>terminal_dock_widget</name>
+    <message>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
+        <source>Command Window</source>
+        <translation>Fenêtre de commandes</translation>
+    </message>
+</context>
+<context>
+    <name>webinfo</name>
+    <message>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
+        <source>Type here and press &apos;Return&apos; to search</source>
+        <translation>Entrez le texte ici et appuyez sur &apos;Entrée&apos; pour lancer la recherche</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Global search</source>
+        <translation>Recherche globale</translation>
+    </message>
+</context>
+<context>
+    <name>welcome_wizard</name>
+    <message>
+        <location filename="../src/welcome-wizard.ui" line="+26"/>
+        <source>Welcome to GNU Octave</source>
+        <translation>Bienvenu dans GNU Octave</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
+        <translation>Il semble que vous avez lancé Octave GUI pour la première fois sur cet ordinateur puisque aucun fichier de configuration &apos;~/.octave-gui&apos; n&apos;a été trouvé. Cet assistant va vous guider pour faire les réglages nécessaires avant de pouvoir utiliser Octave GUI. Si vous voulez transferer des réglages que vous avez déjà faits, fermez ce dialogue et copiez le fichier de configuration dans votre répertoire personnel. La présence de ce fichier sera détectée automatiquement et cet assistant ne s&apos;affichera plus. IMPORTANT : Cet assistant n&apos;est pas encore complètement fonctionnel. Passez les pages jusqu&apos;à la fin et il créera un fichier de configuration standard.</translation>
+    </message>
+    <message>
+        <location line="+41"/>
+        <location line="+50"/>
+        <location line="+52"/>
+        <location line="+52"/>
+        <source>Next</source>
+        <translation>Suivant</translation>
+    </message>
+    <message>
+        <location line="-124"/>
+        <location line="+52"/>
+        <location line="+52"/>
+        <location line="+87"/>
+        <source>Previous</source>
+        <translation>Précédent</translation>
+    </message>
+    <message>
+        <location line="-45"/>
+        <source>Welcome to Octave!</source>
+        <translation>Bienvenu dans Octave!</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>This is the development version of Octave with the first official GUI.</source>
+        <translation>Ceci est la version de développement de Octave avec le premier GUI officiel.</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
+        <translation>Il semble que vous exécutez Octave GUI pour la premiere fois sur cet ordinateur. Cet assistant va vous aider à configurer ce logiciel. Appuyez sur &apos;Fin&apos; pour créer le fichier de configuration et lancer Octave GUI.</translation>
+    </message>
+    <message>
+        <location line="+48"/>
+        <source>Finish</source>
+        <translation>Fin</translation>
+    </message>
+</context>
+<context>
+    <name>workspace_model</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="-42"/>
+        <source>Name</source>
+        <translation>Nom</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Class</source>
+        <translation>Classe</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Dimension</source>
+        <translation>Dimensions</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Value</source>
+        <translation>Valeur</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation>Type de stockage</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation>Cliquez droit pour copier, renommer ou afficher</translation>
+    </message>
+</context>
+<context>
+    <name>workspace_view</name>
+    <message>
+        <location filename="../src/workspace-view.cc" line="+47"/>
+        <source>Workspace</source>
+        <translation>Espace de travail</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation>Liste des variables dans l&apos;espace de travail.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation>Copier</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation>Renommer</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation>Seules les variables de plus haut niveau peuvent être renommées.</translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation>Voir les variables dans l&apos;espace de travail.&lt;br&gt;</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation>Couleurs pour le type de stockage :</translation>
+    </message>
+</context>
+</TS>
--- a/libgui/languages/nl_NL.ts
+++ b/libgui/languages/nl_NL.ts
@@ -2,56 +2,740 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="nl_NL">
 <context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation type="unfinished">Alles selecteren</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation type="unfinished">Automatisch</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation type="unfinished">Functie</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation type="unfinished">Gobaal</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation type="unfinished">Verborgen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation type="unfinished">Overgeërfd</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation type="unfinished">Blijvend</translation>
+    </message>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.cc" line="+64"/>
+        <source>foreground</source>
+        <translation type="unfinished">Voorgrond</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>background</source>
+        <translation type="unfinished">Achtergrond</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>selection</source>
+        <translation type="unfinished">Selectie</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>cursor</source>
+        <translation type="unfinished">Aanwijzer</translation>
+    </message>
+</context>
+<context>
+    <name>QTerminal</name>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.h" line="+116"/>
+        <source>Copy</source>
+        <translation type="unfinished">Kopiëren</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Paste</source>
+        <translation type="unfinished">Plakken</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Clear All</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QWinTerminalImpl</name>
+    <message>
+        <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1451"/>
+        <source>copied selection to clipboard</source>
+        <translation type="unfinished">selectie naar klembord gekopieerd</translation>
+    </message>
+</context>
+<context>
+    <name>QsciLexerBatch</name>
+    <message>
+        <location filename="../../../qsci/qscilexerbatch.cpp" line="+179"/>
+        <source>Default</source>
+        <translation type="unfinished">Standaard</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Comment</source>
+        <translation type="unfinished">Commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Keyword</source>
+        <translation type="unfinished">Trefwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Label</source>
+        <translation type="unfinished">Etiket</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Hide command character</source>
+        <translation type="unfinished">Verberg opdrachtteken</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>External command</source>
+        <translation type="unfinished">Externe opdracht</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Variable</source>
+        <translation type="unfinished">Variabele</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Operator</source>
+        <translation type="unfinished">Operator</translation>
+    </message>
+</context>
+<context>
+    <name>QsciLexerCPP</name>
+    <message>
+        <location filename="../../../qsci/qscilexercpp.cpp" line="+352"/>
+        <source>Default</source>
+        <translation type="unfinished">Verstekwaarde</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive default</source>
+        <translation type="unfinished">Inactieve verstekwaarde</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>C comment</source>
+        <translation type="unfinished">C commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive C comment</source>
+        <translation type="unfinished">Inactief C commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>C++ comment</source>
+        <translation type="unfinished">C++ commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive C++ comment</source>
+        <translation type="unfinished">Inactief C++ commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>JavaDoc style C comment</source>
+        <translation type="unfinished">C commentaar in JavaDoc stijl</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive JavaDoc style C comment</source>
+        <translation type="unfinished">Inactief C commentaar in JavaDoc stijl</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Number</source>
+        <translation type="unfinished">Getal</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive number</source>
+        <translation type="unfinished">Inactief getal</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Keyword</source>
+        <translation type="unfinished">Trefwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive keyword</source>
+        <translation type="unfinished">Inactief trefwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Double-quoted string</source>
+        <translation type="unfinished">Tekst met dubbele aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive double-quoted string</source>
+        <translation type="unfinished">Inactieve tekst met dubbele aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Single-quoted string</source>
+        <translation type="unfinished">Tekst met aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive single-quoted string</source>
+        <translation type="unfinished">Inactieve tekst met aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>IDL UUID</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive IDL UUID</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Pre-processor block</source>
+        <translation type="unfinished">Preprocessor blok</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive pre-processor block</source>
+        <translation type="unfinished">Inactief preprocessor blok</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Operator</source>
+        <translation type="unfinished">Operator</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive operator</source>
+        <translation type="unfinished">Inactieve operator</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Identifier</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive identifier</source>
+        <translation type="unfinished">Inactieve identifier</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Unclosed string</source>
+        <translation type="unfinished">Niet afgesloten tekst</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive unclosed string</source>
+        <translation type="unfinished">Inactieve niet afgesloten tekst</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>C# verbatim string</source>
+        <translation type="unfinished">C# letterlijke tekst</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive C# verbatim string</source>
+        <translation type="unfinished">Inactieve C# letterlijke tekst</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>JavaScript regular expression</source>
+        <translation type="unfinished">Javascript reguliere uitdrukking</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive JavaScript regular expression</source>
+        <translation type="unfinished">Inatieve Javascript reguliere uitdrukking</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>JavaDoc style C++ comment</source>
+        <translation type="unfinished">C++ commentaar in JavaDoc stijl</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive JavaDoc style C++ comment</source>
+        <translation type="unfinished">Inactief C++ commentaar in JavaDoc stijl</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Secondary keywords and identifiers</source>
+        <translation type="unfinished">Secundaire trefwoorden en identifiers</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive secondary keywords and identifiers</source>
+        <translation type="unfinished">Inactieve secundaire trefwoorden en identifiers</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>JavaDoc keyword</source>
+        <translation type="unfinished">JavaDoc sleutelwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive JavaDoc keyword</source>
+        <translation type="unfinished">Inactief JavaDoc sleutelwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>JavaDoc keyword error</source>
+        <translation type="unfinished">fout JavaDoc trefwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive JavaDoc keyword error</source>
+        <translation type="unfinished">Inactief fout JavaDoc trefwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Global classes and typedefs</source>
+        <translation type="unfinished">Globale klassen en typedefs</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive global classes and typedefs</source>
+        <translation type="unfinished">Inactieve globale klassen en typedefs</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>C++ raw string</source>
+        <translation type="unfinished">C++ ruwe tekst</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Inactive C++ raw string</source>
+        <translation type="unfinished">Inactieve C++ ruwe tekst</translation>
+    </message>
+</context>
+<context>
+    <name>QsciLexerDiff</name>
+    <message>
+        <location filename="../../../qsci/qscilexerdiff.cpp" line="+107"/>
+        <source>Default</source>
+        <translation type="unfinished">Verstekwaarde</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Comment</source>
+        <translation type="unfinished">Commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Command</source>
+        <translation type="unfinished">Opdracht</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Header</source>
+        <translation type="unfinished">Koptekst</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Position</source>
+        <translation type="unfinished">Positie</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Removed line</source>
+        <translation type="unfinished">Verwijderde regel</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Added line</source>
+        <translation type="unfinished">Toegevoegde regel</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Changed line</source>
+        <translation type="unfinished">Gewijzigde regel</translation>
+    </message>
+</context>
+<context>
+    <name>QsciLexerMatlab</name>
+    <message>
+        <location filename="../../../qsci/qscilexermatlab.cpp" line="+138"/>
+        <source>Default</source>
+        <translation type="unfinished">Verstekwaarde</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Comment</source>
+        <translation type="unfinished">Commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Command</source>
+        <translation type="unfinished">Opdracht</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Number</source>
+        <translation type="unfinished">Getal</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Keyword</source>
+        <translation type="unfinished">Trefwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Single-quoted string</source>
+        <translation type="unfinished">Tekst tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Operator</source>
+        <translation type="unfinished">Operator</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Identifier</source>
+        <translation type="unfinished">Identifier</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Double-quoted string</source>
+        <translation type="unfinished">Tekst tussen dubbele aanhalingstekens</translation>
+    </message>
+</context>
+<context>
+    <name>QsciLexerPerl</name>
+    <message>
+        <location filename="../../../qsci/qscilexerperl.cpp" line="+333"/>
+        <source>Default</source>
+        <translation type="unfinished">Verstekwaarde</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Error</source>
+        <translation type="unfinished">Fout</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Comment</source>
+        <translation type="unfinished">Commentaar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>POD</source>
+        <translation type="unfinished">POD</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Number</source>
+        <translation type="unfinished">Getal</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Keyword</source>
+        <translation type="unfinished">Trefwoord</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Double-quoted string</source>
+        <translation type="unfinished">Tekst tussen dubbele aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Single-quoted string</source>
+        <translation type="unfinished">Tekst tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Operator</source>
+        <translation type="unfinished">Operator</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Identifier</source>
+        <translation type="unfinished">Identifier</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Scalar</source>
+        <translation type="unfinished">Enkel getal</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Array</source>
+        <translation type="unfinished">Array</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Hash</source>
+        <translation type="unfinished">Hash</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Symbol table</source>
+        <translation type="unfinished">Symbooltabel</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Regular expression</source>
+        <translation type="unfinished">Reguliere uitdrukking</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Substitution</source>
+        <translation type="unfinished">Vervanging</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Backticks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Data section</source>
+        <translation type="unfinished">Data sectie</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Here document delimiter</source>
+        <translation type="unfinished">Here document  scheidingsteken</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Single-quoted here document</source>
+        <translation type="unfinished">Here document tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Double-quoted here document</source>
+        <translation type="unfinished">Here dicument tussen dubbele aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Backtick here document</source>
+        <translation type="unfinished">Backtick here document</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (q)</source>
+        <translation type="unfinished">q tekst tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (qq)</source>
+        <translation type="unfinished">qq tekst tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (qx)</source>
+        <translation type="unfinished">qx tekst tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (qr)</source>
+        <translation type="unfinished">qr tekst tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (qw)</source>
+        <translation type="unfinished">qw tekst tussen aanhalingstekens</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>POD verbatim</source>
+        <translation type="unfinished">POD letterlijk</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Subroutine prototype</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Format identifier</source>
+        <translation type="unfinished">Sjabloon identifier</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Format body</source>
+        <translation type="unfinished">Sjabloon inhoud</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Double-quoted string (interpolated variable)</source>
+        <translation type="unfinished">Tekst tussen aanhalingstekens (geïnterpoleerde variabele)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Translation</source>
+        <translation type="unfinished">Vertaling</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Regular expression (interpolated variable)</source>
+        <translation type="unfinished">Reguliere uitdrukking (Geïnterpoleerde variabele)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Substitution (interpolated variable)</source>
+        <translation type="unfinished">Vervanging</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Backticks (interpolated variable)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Double-quoted here document (interpolated variable)</source>
+        <translation type="unfinished">Here document tussen dubbele aanhalingstekens (geïnterpoleerde variabele</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Backtick here document (interpolated variable)</source>
+        <translation type="unfinished">Backtick here document (geïnterpoleerde variabele)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (qq, interpolated variable)</source>
+        <translation type="unfinished">Tekst tussen aanhalingstekens (qq, geïnterpoleerde variabele)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (qx, interpolated variable)</source>
+        <translation type="unfinished">Tekst tussen aanhalingstekens (qx, geïnterpoleerde variabele)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Quoted string (qr, interpolated variable)</source>
+        <translation type="unfinished">Tekst tussen aanhalingstekens (qr, geïnterpoleerde variabele)</translation>
+    </message>
+</context>
+<context>
+    <name>QsciScintilla</name>
+    <message>
+        <location filename="../../../qsci/qsciscintilla.cpp" line="+4201"/>
+        <source>&amp;Undo</source>
+        <translation type="unfinished">Ongedaan maken</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>&amp;Redo</source>
+        <translation type="unfinished">He&amp;rhalen</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Cu&amp;t</source>
+        <translation type="unfinished">Knippen</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>&amp;Copy</source>
+        <translation type="unfinished">Kopiëren</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>&amp;Paste</source>
+        <translation type="unfinished">Plakken</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Delete</source>
+        <translation type="unfinished">Verwijderen</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Select All</source>
+        <translation type="unfinished">Alles kiezen</translation>
+    </message>
+</context>
+<context>
     <name>documentation_dock_widget</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
         <source>Documentation</source>
         <translation>Documentatie</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation type="unfinished">Kijk in de documentatie voor hulp.</translation>
+    </message>
 </context>
 <context>
     <name>file_editor</name>
     <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
         <source>Octave Editor</source>
         <translation></translation>
     </message>
     <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
-        <translation>Bestand %1 is al geopend in de editor.</translation>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation type="unfinished">Octave bestanden (*.m);;Alle bestanden (*)</translation>
     </message>
     <message>
-        <location line="+38"/>
+        <location line="+117"/>
         <source>Could not open file %1 for read:
 %2.</source>
         <translation>Bestand %1 kon niet geopend worden om te lezen:
 %2.</translation>
     </message>
     <message>
-        <location line="+43"/>
+        <location line="+49"/>
         <source>File not saved! A file with the selected name
 %1
 is already open in the editor</source>
         <translation>Bestand niet opgeslagen! Een bestand met de naam
 %1
-is al geopend in de editor</translation>
+is reeds geopend in de editor</translation>
     </message>
     <message>
-        <location line="+26"/>
+        <location line="+28"/>
         <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
         <translation>Het bijbehorende tabblad in de editor is verdwenen. Het is waarschijnlijk op een of andere manier gesloten.</translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+205"/>
         <source>&amp;%1 %2</source>
         <translation></translation>
     </message>
     <message>
-        <location line="+130"/>
+        <location line="+159"/>
         <source>&amp;New File</source>
         <translation>&amp;Nieuw Bestand</translation>
     </message>
@@ -71,6 +755,11 @@
         <translation>Opslaan &amp;als</translation>
     </message>
     <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation type="unfinished">Afdrukken</translation>
+    </message>
+    <message>
         <location line="+3"/>
         <source>&amp;Undo</source>
         <translation>Ongedaan maken</translation>
@@ -96,59 +785,79 @@
         <translation>Plakken</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Next Bookmark</source>
         <translation>Volge&amp;nde bladwijzer</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Pre&amp;vious Bookmark</source>
         <translation>&amp;Vorige bladwijzer</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Toggle &amp;Bookmark</source>
         <translation>&amp;Bladwijzer invoegen</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Remove All Bookmarks</source>
         <translation>Alle bladwijzers ve&amp;rwijderen</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>&amp;Next breakpoint</source>
-        <translation>Volge&amp;nd breekpunt</translation>
+        <translation>Volge&amp;nd onderbreekpunt</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Pre&amp;vious breakpoint</source>
-        <translation>&amp;Vorig breekpunt</translation>
+        <translation>&amp;Vorig onderbreekpunt</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Toggle &amp;breakpoint</source>
-        <translation>&amp;Breekpunt invoegen</translation>
+        <translation>&amp;Onderbreekpunt invoegen</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>&amp;Remove All breakpoints</source>
-        <translation>Alle breekpunten ve&amp;rwijderen</translation>
+        <translation>Alle onderbreekpunten ve&amp;rwijderen</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation>Geselecteerde tekst markeren als &amp;commentaar</translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
-        <translation>Gelesecteerde tekst niet markeren als commentaar</translation>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
+        <translation type="unfinished">Zet om naar commentaar</translation>
     </message>
     <message>
         <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation type="unfinished">Zet om naar code</translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation type="unfinished">Recent geopend</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation type="unfinished">Sluit bestand</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation type="unfinished">Alle bestanden sluiten</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation type="unfinished">Andere bestanden sluiten</translation>
+    </message>
+    <message>
+        <location line="-94"/>
         <source>&amp;Find and Replace</source>
-        <translation>Vervangen</translation>
+        <translation>Zoek en Vervang</translation>
     </message>
     <message>
         <location line="+3"/>
@@ -156,22 +865,22 @@
         <translation>Bestand opslaan en uitvoeren</translation>
     </message>
     <message>
-        <location line="+51"/>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation type="unfinished">Ga naar regel</translation>
+    </message>
+    <message>
+        <location line="+63"/>
         <source>&amp;File</source>
         <translation>Bestand</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation>&amp;Recent bestand openen</translation>
-    </message>
-    <message>
-        <location line="+8"/>
+        <location line="+35"/>
         <source>&amp;Edit</source>
         <translation>B&amp;ewerken</translation>
     </message>
     <message>
-        <location line="+19"/>
+        <location line="+21"/>
         <source>&amp;Debug</source>
         <translation>&amp;Debuggen</translation>
     </message>
@@ -184,77 +893,283 @@
 <context>
     <name>file_editor_tab</name>
     <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation type="unfinished">Ga naar regel ...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation type="unfinished">Regelnummer</translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation type="unfinished">naamloos</translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation type="unfinished">Wil je de wijzigingen opslaan of niet?</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation type="unfinished">Wil je niet meer afsluiten, het gewijzigde, of het originele bestand opslaan?</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
         <source>Octave Editor</source>
         <translation></translation>
     </message>
     <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
-        <translation>Het bestand &apos;%1&apos; is aangepast. Wil je de wijzigingen opslaan?</translation>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation type="unfinished">Het bestand
+%1
+dat gesloten moet worden is gewijzigd.</translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation type="unfinished">Octave bestanden (*.m);;Alle bestanden (*)</translation>
     </message>
     <message>
-        <location line="+102"/>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation type="unfinished">Bestand niet opgeslagen! De gekozen bestandsnaam
+%1
+is identiek aan de huidige bestandsnaam</translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation type="unfinished">
+Opgelet: Het bestand in de editor is gewijzigd!</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation type="unfinished">Het lijkt er op dat bestand
+%1
+is gewist of hernoemd. Wil je het nu opslaan?</translation>
+    </message>
+    <message>
+        <location line="-192"/>
         <source>Could not open file %1 for write:
 %2.</source>
         <translation>Kon bestand %1 niet openen om te schrijven:
 %2.</translation>
     </message>
     <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation>Bestand niet opgeslagen! Je hebt een bestandsnaam
-
-     %1
-
-gekozen die hetzelfde is als de huidige bestandsnaam. Gebruik Opslaan om te overschrijven.</translation>
-    </message>
-    <message>
-        <location line="+63"/>
+        <location line="+170"/>
         <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
-        <translation>Het lijkt erop dat &apos;%1&apos; is aangepast door een ander programma. Wil je het opnieuw laden?</translation>
-    </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation>Het lijkt erop dat &apos;%1&apos; verwijderd of hernoemd is. Wil je het nu opslaan?</translation>
+        <translation>Het lijkt erop dat &apos;%1&apos; is gewijzigd door een ander programma. Wil je het opnieuw laden?</translation>
     </message>
 </context>
 <context>
     <name>files_dock_widget</name>
     <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
-        <translation>Huidige map</translation>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Bestandsbrowser</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation type="unfinished">Blader door uw bestanden.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation type="unfinished">Voer pad- of bestandsnaam in</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation type="unfinished">Eén mapniveau omhoog</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation type="unfinished">Laat octave map zien</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation type="unfinished">Ga naar huidige octave map</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation type="unfinished">Stel octave map in</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation type="unfinished">Maak huidige browser map de Octave map</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation type="unfinished">Bewerkingen op huidige map</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation type="unfinished">Laat home map zien</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation type="unfinished">Zoek in map</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation type="unfinished">Zoek bestanden ...</translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation type="unfinished">Nieuw bestand</translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation type="unfinished">Nieuwe map</translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation type="unfinished">Dubbelklik op bestandsnaam om te openen</translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation type="unfinished">Open</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation type="unfinished">Open met bijbehorend programma</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation type="unfinished">Kopieer selectie naar klembord</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation type="unfinished">Voer uit</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation type="unfinished">Lees data in</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation type="unfinished">Stel huidige map in</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation type="unfinished">Hernoemen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation type="unfinished">Verwijderen</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation type="unfinished">Hernoem bestand/map</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation type="unfinished">Hernoem bestand</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation type="unfinished">
+ naar: </translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation type="unfinished">Wis bestand/map</translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sure you want to delete
+</source>
+        <translation type="unfinished">Weet u zeker dat u dit wilt verwijderen
+        </translation>
     </message>
     <message>
         <location line="+11"/>
-        <source>Move up one directory.</source>
-        <translation>Een map naar boven gaan.</translation>
+        <source>Can not delete a directory that is not empty</source>
+        <translation type="unfinished">Kan geen niet-lege map wissen</translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation type="unfinished">Stel file browser map in</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation type="unfinished">Maak nieuw bestand</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
-        <translation>Voer het pad of de bestandsnaam in.</translation>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation type="unfinished">Maak nieuw bestand in
+</translation>
     </message>
     <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
-        <translation>Dubbelklik op een bestand om te openen.</translation>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation type="unfinished">Maak nieuwe map</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation type="unfinished">Maak nieuwe map in
+</translation>
     </message>
 </context>
 <context>
     <name>find_dialog</name>
     <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
         <source>Find &amp;what:</source>
         <translation>Zoek naar:</translation>
     </message>
@@ -276,7 +1191,7 @@
     <message>
         <location line="+1"/>
         <source>&amp;Wrap while searching</source>
-        <translation>Bestandseinde negeren</translation>
+        <translation>Na bestandseinde doorgaan aan begin</translation>
     </message>
     <message>
         <location line="+2"/>
@@ -284,7 +1199,12 @@
         <translation>Volgende zoeken</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation type="unfinished">Vorige zoeken</translation>
+    </message>
+    <message>
+        <location line="+1"/>
         <source>&amp;Replace</source>
         <translation>Ve&amp;rvang</translation>
     </message>
@@ -299,7 +1219,7 @@
         <translation>&amp;Meer</translation>
     </message>
     <message>
-        <location line="+11"/>
+        <location line="+13"/>
         <source>&amp;Whole words</source>
         <translation>Hele &amp;woorden</translation>
     </message>
@@ -316,352 +1236,431 @@
     <message>
         <location line="+1"/>
         <source>Search se&amp;lection</source>
-        <translation>In se&amp;lectie</translation>
+        <translation>In se&amp;lectie zoeken</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation type="unfinished">vanaf einde terug zoeken</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation type="unfinished">Zoeken vanaf begin</translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation type="unfinished">Resultaat vervangen</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation type="unfinished">%1 vervangingen</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation type="unfinished">Zoek resultaat</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation type="unfinished">Geen overeenkomsten meer gevonden</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation type="unfinished">Zoek bestanden</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation type="unfinished">Genaamd:</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation type="unfinished">Voer de bestandnaam-expressie in</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation type="unfinished">Begin in:</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation type="unfinished">Geef startmap op</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation type="unfinished">Bladeren ...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation type="unfinished">Blader naar begin map</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation type="unfinished">Ook in onderliggende mappen</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation type="unfinished">Zoek ook in onderliggende mappen naar overeenkomende bestanden</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation type="unfinished">Neem mappen ook mee</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation type="unfinished">Neem overeenkomende mappen mee in zoekresultaten</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation type="unfinished">Niet-hoofdlettergevoelige naam</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation type="unfinished">Naam instellen op niet-hoofdlettergevoelig</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation type="unfinished">Met tekst:</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation type="unfinished">Zoeken naar overeenkomende tekst</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation type="unfinished">Overeen te komen tekst</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation type="unfinished">Niet-hoofdlettergevoelige tekst</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation type="unfinished">Tekst instellen op niet-hoofdlettergevoelig</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation type="unfinished">Zoekresultaten</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Idle.</source>
+        <translation type="unfinished">Niet bezig.</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation type="unfinished">Zoek</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation type="unfinished">begin met zoeken naar overeenkomende bestanden</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation type="unfinished">Stop</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation type="unfinished">Stop met zoeken</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation type="unfinished">Bestandsnaam/lokatie</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation type="unfinished">Inhoud van bestand</translation>
+    </message>
+    <message>
+        <location line="+99"/>
+        <source>Searching...</source>
+        <translation type="unfinished">Bezig met zoeken...</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation type="unfinished">Stel zoekmap in</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation type="unfinished">Bestandsnaam</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation type="unfinished">Map</translation>
     </message>
 </context>
 <context>
     <name>history_dock_widget</name>
     <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation type="unfinished">Bladeren en zoeken door de opdrachtgeschiedenis.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
         <source>Doubleclick a command to transfer it to the terminal.</source>
-        <translation>Dubbelklik een commando om het naar de terminal te sturen.</translation>
+        <translation>Dubbelklik op een opdracht om het naar de terminal te sturen.</translation>
     </message>
     <message>
         <location line="+6"/>
         <source>Enter text to filter the command history.</source>
-        <translation>Voer text in om de commandogeschiedenis te filteren.</translation>
+        <translation>Voer tekst in om de opdrachtgeschiedenis mee te filteren.</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Command History</source>
-        <translation>Commandogeschiedenis</translation>
+        <translation>Opdrachtgeschiedenis</translation>
     </message>
     <message>
-        <location line="+42"/>
+        <location line="+20"/>
         <source>Copy</source>
         <translation>Kopiëren</translation>
     </message>
     <message>
         <location line="+1"/>
         <source>Evaluate</source>
-        <translation>Evalueer</translation>
-    </message>
-</context>
-<context>
-    <name>lexer_octave_gui</name>
-    <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation>Standaard</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation>Commentaar</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation>Commando</translation>
+        <translation>Werk uit</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation>Nummer</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation>Trefwoord</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation>String met enkele quotes</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation>Identificator</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
-        <translation>String met dubbele quotes</translation>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translation type="unfinished">Nieuw script</translation>
     </message>
 </context>
 <context>
     <name>main_window</name>
     <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation>Werkruimte opslaan</translation>
-    </message>
-    <message>
-        <location line="+11"/>
+        <location filename="../src/main-window.cc" line="+155"/>
         <source>Load Workspace</source>
         <translation>Werkruimte laden</translation>
     </message>
     <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation>Werkmap instellen</translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
+        <location line="+355"/>
+        <location line="+769"/>
         <source>About Octave</source>
         <translation>Over Octave</translation>
     </message>
     <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation>Bekijk de variabelen in de huidige werkruimte.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation>Bladeren en zoeken door de commandogeschiedenis.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation>Blader door uw bestanden.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation>Zie de documentatie voor hulp.</translation>
-    </message>
-    <message>
-        <location line="+39"/>
+        <location line="-338"/>
         <source>&amp;File</source>
         <translation>Bestand</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+52"/>
         <source>New</source>
         <translation>Nieuw</translation>
     </message>
     <message>
-        <location line="+3"/>
+        <location line="+4"/>
         <source>Script</source>
-        <translation></translation>
+        <translation>Script</translation>
     </message>
     <message>
-        <location line="+3"/>
+        <location line="+2"/>
         <source>Function</source>
         <translation>Functie</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Class</source>
-        <translation>Klasse</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation>Enumeratie</translation>
-    </message>
-    <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Figure</source>
         <translation>Figuur</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation>Variabele</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation></translation>
+        <location line="-55"/>
+        <source>Open...</source>
+        <translation>Open...</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Open...</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation>Commandoscherm sluiten</translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation>Importeer data...</translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation>Werkruimte opslaan...</translation>
-    </message>
-    <message>
-        <location line="+6"/>
+        <location line="+18"/>
         <source>Preferences...</source>
         <translation>Voorkeuren...</translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation>Pagina instellingen...</translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation></translation>
+        <location line="+4"/>
+        <source>Exit</source>
+        <translation>Afsluiten</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation>Print selectie...</translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Exit</source>
-        <translation>Sluiten</translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+51"/>
         <source>&amp;Edit</source>
         <translation>B&amp;ewerken</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+5"/>
         <source>Undo</source>
         <translation>Ongedaan maken</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation>Herhalen</translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <source>Cut</source>
-        <translation>Knippen</translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+7"/>
         <source>Copy</source>
         <translation>Kopiëren</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+5"/>
         <source>Paste</source>
         <translation>Plakken</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Paste To Workspace...</source>
-        <translation>Plak naar werkruimte...</translation>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
+        <translation type="unfinished">Bewaar werkruimte als ...</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Select All</source>
-        <translation>Alles selecteren</translation>
+        <location line="-602"/>
+        <source>Set working directory</source>
+        <translation type="unfinished">Stel werkmap in</translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Delete</source>
-        <translation>Verwijderen</translation>
+        <location line="+686"/>
+        <source>Find Files...</source>
+        <translation>Zoek bestanden...</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation>Vind...</translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Find Files...</source>
-        <translation>Vind bestanden...</translation>
-    </message>
-    <message>
-        <location line="+7"/>
         <source>Clear Command Window</source>
-        <translation>Wis commandoscherm</translation>
+        <translation>Veeg opdrachtvenster schoon</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Clear Command History</source>
-        <translation>Wis commandogeschiedenis</translation>
+        <translation>Wis opdrachtgeschiedenis</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
         <translation>Wis werkruimte</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
         <translation>De&amp;buggen</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
-        <translation>Stap</translation>
+        <translation>Volgende opdracht</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
-        <translation>Stap in</translation>
+        <translation>Stap naar binnen</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
-        <translation>Stap uit</translation>
+        <translation>Stap naar buiten</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+4"/>
         <source>Continue</source>
         <translation>Doorgaan</translation>
     </message>
     <message>
-        <location line="+13"/>
+        <location line="+8"/>
         <source>Exit Debug Mode</source>
-        <translation>Debuggen sluiten</translation>
+        <translation>Debuggen afsluiten</translation>
+    </message>
+    <message>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation type="unfinished">Laat bestandsbrowser zien</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Bestandsbrowser</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
+        <translation type="unfinished">Stel oorspronkelijke window layout opnieuw in</translation>
+    </message>
+    <message>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation type="unfinished">Op schijf</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
-        <translation>Bureaubla&amp;d</translation>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation type="unfinished">Online</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation type="unfinished">Geef mapnaam op</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+8"/>
+        <source>Current Directory: </source>
+        <translation type="unfinished">Huidige map:</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>One directory up</source>
+        <translation type="unfinished">Eén mapniveau omhoog</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation type="unfinished">Blader door mappen</translation>
+    </message>
+    <message>
+        <location line="-392"/>
         <source>Load workspace</source>
         <translation>Werkruimte laden</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+192"/>
         <source>&amp;Window</source>
-        <translation>Scherm</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Show Command Window</source>
-        <translation>Commandoscherm weergeven</translation>
+        <translation>Venster</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Show Command History</source>
-        <translation>Commandogeschiedenis weergeven</translation>
+        <source>Show Command Window</source>
+        <translation>Opdrachtvenster weergeven</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation>Huidige map weergeven</translation>
+        <location line="+3"/>
+        <source>Show Command History</source>
+        <translation>Opdrachtgeschiedenis weergeven</translation>
     </message>
     <message>
         <location line="+6"/>
@@ -669,305 +1668,473 @@
         <translation>Werkruimte weergeven</translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Editor</source>
         <translation>Editor weergeven</translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Documentation</source>
         <translation>Documentatie weergeven</translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+5"/>
         <source>Command Window</source>
-        <translation>Commandoscherm</translation>
+        <translation>Opdrachtvenster</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Command History</source>
-        <translation>Commandogeschiedenis</translation>
+        <translation>Opdrachtgeschiedenis</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation>Huidige map</translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+6"/>
         <source>Workspace</source>
         <translation>Werkruimte</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Editor</source>
-        <translation></translation>
+        <translation>Editor</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
+        <location line="+108"/>
         <source>Documentation</source>
         <translation>Documentatie</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
-        <translation>Reset schermen</translation>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation>Hulp</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location line="+2"/>
+        <location line="+7"/>
         <source>Report Bug</source>
         <translation>Probleem rapporteren</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+6"/>
         <source>Visit Agora</source>
         <translation>Bezoek Agora</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="-3"/>
         <source>Visit Octave Forge</source>
         <translation>Bezoek Octave Forge</translation>
     </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
-        <translation>Huidige map:</translation>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
+        <translation type="unfinished">Widget laten zweven</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translation type="unfinished">Widget verbergen</translation>
+    </message>
+    <message>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation type="unfinished">Widget in venster opnemen</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation type="unfinished">hulp</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation type="unfinished">Het bestand %1 is niet in zoekpad.  Om de functie die je edit te debuggen moet je òf naar debetreffende map %2 gaan, of die map aan het zoekpad toevoegen.</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
+        <translation type="unfinished">Het bestand %1 is overschaduwd door een bestand met dezelfde naam in het zoekpad.  Ga naar de map %2 om de functie de je edit te kunnen debuggen.</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Change Directory or Add Directory to Load Path</source>
+        <translation type="unfinished">Ga naar andere map of Voeg map toe aan zoekpad</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Change Directory</source>
+        <translation type="unfinished">Ga naar andere map</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation type="unfinished">Voeg map toe aan zoekpad</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation type="unfinished">Afbreken</translation>
     </message>
 </context>
 <context>
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
         <translation>Instellingen</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
         <translation>Algemeen</translation>
     </message>
     <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation>Icoon ingesteld voor dock widget</translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+97"/>
         <source>Octave logo only</source>
         <translation>Alleen Octave logo</translation>
     </message>
     <message>
-        <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+10"/>
         <source>Letter icons</source>
         <translation>Letter iconen</translation>
     </message>
     <message>
-        <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
+        <location line="+7"/>
+        <source>Graphic icons</source>
         <translation>Grafische iconen</translation>
     </message>
     <message>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation>Editor</translation>
+    </message>
+    <message>
+        <location line="+16"/>
+        <source>Show white space</source>
+        <translation type="unfinished">Laat witruimtetekens zien</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation type="unfinished">Verberg witruimtetekens die worden gebruikt voor inspringen</translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation type="unfinished">Kleur</translation>
+    </message>
+    <message>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation type="unfinished">Inspringafstand</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation type="unfinished">Inspringen met tab</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Auto indentation</source>
+        <translation type="unfinished">Automatisch inspringen</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation type="unfinished">Tab breedte</translation>
+    </message>
+    <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
-        <translation></translation>
+        <source>Show indentation guides</source>
+        <translation type="unfinished">Laat inspringraster zien</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation type="unfinished">Backspace doet terug inspringen</translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation type="unfinished">Aantal tekens voordat lijst met suggesties wordt weergegeven</translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Match keywords</source>
+        <translation type="unfinished">Zoek op overeenkomende sleutelwoorden</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Case sensitive</source>
+        <translation type="unfinished">Hoofdlettergevoelig</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation type="unfinished">Vervang woord door suggestie</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation type="unfinished">Zoek overeenkomende worden in document</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation type="unfinished">Herstel bij opstarten de editor tabs uit de vorige sessie</translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
+        <translation type="unfinished">Gebruik een andere editor</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation type="unfinished">Opdrachtregel (%f=bestand, %l=regel):</translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation type="unfinished">Editorstijlen</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation type="unfinished">Kies font, fontgrootte (als verschil met standaardgrootte), fonttype (vet, schuin, onderstreept), tekstkleur en achtergrondkleur (de kleur roze (255,0,255) dient alleen om de standaard-achtergrondkleur aan te duiden)</translation>
+    </message>
+    <message>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation type="unfinished">Gebruik voorgrondkleur</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation type="unfinished">Terminalkleuren</translation>
+    </message>
+    <message>
+        <location line="+45"/>
         <source>Font</source>
         <translation>Lettertype</translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation>Lettergrootte</translation>
-    </message>
-    <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
+        <location line="-744"/>
         <source>Show line numbers</source>
         <translation>Regelnummers weergeven</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+27"/>
         <source>Highlight current line</source>
         <translation>Markeer huidige regel</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+262"/>
         <source>Code completion</source>
         <translation>Automatisch aanvullen</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-282"/>
         <source>Show complete path in window title</source>
         <translation>Hele pad in schermtitel weergeven</translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation>Tabbladen van vorige sessie herladen bij opstarten</translation>
-    </message>
-    <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation>Gebruik andere bestandeditor:</translation>
-    </message>
-    <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+548"/>
         <source>emacs</source>
         <translation></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
+        <location line="+67"/>
         <source>Terminal</source>
-        <translation></translation>
+        <translation>Opdrachtvenster</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>Cursor type:</source>
+        <translation>Type aanwijzer</translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
-        <source>Cursor type:</source>
-        <translation></translation>
+        <location line="+23"/>
+        <source>Cursor blinking</source>
+        <translation>Knipperende aanwijzer</translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Cursor blinking</source>
-        <translation>Cursor knipperen</translation>
+        <location line="+101"/>
+        <source>Font size</source>
+        <translation type="unfinished">Lettergrootte</translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+35"/>
         <source>File Browser</source>
         <translation>Bestandsbrowser</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation>Bestandsnamen weergeven</translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file size</source>
         <translation>Bestandsgrootte weergeven</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file type</source>
         <translation>Bestandstype weergeven</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show date of last modification</source>
-        <translation>Datum van laatste aanpassing weergeven</translation>
+        <translation>Datum van laatste wijziging weergeven</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show hidden files</source>
         <translation>Verborgen bestanden weergeven</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation type="unfinished">Synchroniseer octave map met die van bestandsbrowser</translation>
+    </message>
+    <message>
+        <location line="+7"/>
         <source>Alternating row colors</source>
-        <translation>Afwisselende regelkleuren</translation>
+        <translation>Om en om andere regelkleuren</translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation type="unfinished">Werkruimte</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation type="unfinished">Kleuren voor klasse</translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
         <translation>Netwerk</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
+        <location line="+45"/>
         <source>Use proxy server</source>
         <translation>Gebruik proxyserver</translation>
     </message>
     <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+10"/>
         <source>Proxy Type:</source>
         <translation>Proxy type:</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
+        <location line="-33"/>
         <source>HttpProxy</source>
-        <translation></translation>
+        <translation>http proxy</translation>
+    </message>
+    <message>
+        <location line="-1107"/>
+        <source>Icon set for dock widgets</source>
+        <translation type="unfinished">Iconenset voor dock widgets</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation type="unfinished">Taal instellen (vereist herstart)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation type="unfinished">Icoongrootte</translation>
+    </message>
+    <message>
+        <location line="+1098"/>
         <source>Socks5Proxy</source>
         <translation></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
+        <location line="-16"/>
         <source>Hostname:</source>
         <translation>Hostnaam:</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+54"/>
         <source>Port:</source>
         <translation>Poort:</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-27"/>
         <source>Username:</source>
         <translation>Gebruikersnaam:</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+37"/>
         <source>Password:</source>
         <translation>Wachtwoord:</translation>
     </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation type="unfinished">Systeeminstelling</translation>
+    </message>
+    <message>
+        <location line="-268"/>
+        <source>IBeam Cursor</source>
+        <translation type="unfinished">I-balkje</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Block Cursor</source>
+        <translation type="unfinished">Blokje</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Underline Cursor</source>
+        <translation type="unfinished">Liggend streepje</translation>
+    </message>
+    <message>
+        <location line="+129"/>
+        <source>Difference to the default size</source>
+        <translation type="unfinished">Verschil met standaardgrootte</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation type="unfinished">Achtergrondkleur; roze (255,0,255) staat voor standaardkleur</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>b</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>i</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
-        <translation>Commandoscherm</translation>
+        <translation>Opdrachtvenster</translation>
     </message>
 </context>
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
         <translation>Typ hier en druk op &apos;Enter&apos; om te zoeken</translation>
     </message>
@@ -981,25 +2148,19 @@
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
         <translation>Welkom bij GNU Octave</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
-        <translation>Het lijkt erop dat je de Octave GUI voor de eerste keer opstart op deze computer, omdat er geen configuratiebestand in &apos;~/.octave-gui&apos; gevonden is. Deze wizard zal je begeleiden tijdens het invullen van de belangrijkste instellingen die je zou moeten doen voordat je Octave GUI kan gebruiken. Als je eerder gemaakte instellingen wilt overzetten, sluit dan dit scherm en kopieer het configuratiebestand naar je home map. De aanwezigheid van het bestand zal automatisch gedetecteerd worden en deze wizard overslaan. BELANGRIJK: Deze wizard is nog niet volledig functioneel. Klik door tot het einde voor standaardinstellingen.</translation>
+        <translation>Het lijkt erop dat je de Octave GUI voor de eerste keer opstart op deze computer omdat er geen configuratiebestand in &apos;~/.octave-gui&apos; is gevonden. Deze wizard zal je begeleiden tijdens het instellen van de belangrijkste zaken voordat je de Octave GUI kan gebruiken. Wil je eerder gemaakte instellingen overzetten, sluit dan dit dialoogvenster en kopieer het configuratiebestand naar je home map. De aanwezigheid van het bestand zal automatisch gedetecteerd worden en deze wizard doen overslaan. BELANGRIJK: Deze wizard is nog niet volledig functioneel. Klik door tot het einde voor standaardinstellingen.</translation>
     </message>
     <message>
         <location line="+41"/>
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
         <translation>Volgende</translation>
     </message>
@@ -1008,34 +2169,26 @@
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
         <translation>Vorige</translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
         <translation>Welkom bij Octave!</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
         <translation>Dit is de ontwikkelvariant van Octave met de eerste officiële GUI.</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
         <translation>Het lijkt erop dat je de Octave GUI voor de eerste keer uitvoert op deze computer. Deze assistent zal je helpen het programma te configureren. Klik &apos;Voltooien&apos; om een configuratiebestand te maken en de Octave GUI te starten.</translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
         <translation>Voltooien</translation>
     </message>
@@ -1043,32 +2196,72 @@
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
         <translation>Naam</translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Class</source>
-        <translation>Klasse</translation>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Dimension</source>
+        <translation>Dimensies</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Dimension</source>
-        <translation>Dimensie</translation>
+        <location line="+1"/>
+        <source>Value</source>
+        <translation>Waarde</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Value</source>
-        <translation>Waarde</translation>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation type="unfinished">Klasse</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation type="unfinished">Klik rechts om te kopiëren, hernoemen of weergeven</translation>
     </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
         <translation>Werkruimte</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation type="unfinished">Bekijk de variabelen in de huidige werkruimte.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation type="unfinished">Kopiëren</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation type="unfinished">Hernoemen</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation type="unfinished">Alleen hoofdsymbolen kunnen worden hernoemd.</translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation type="unfinished">Bekijk variabelen in actieve werkruimte</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation type="unfinished">Kleuren voor klasse:</translation>
+    </message>
 </context>
 </TS>
--- a/libgui/languages/pt_BR.ts
+++ b/libgui/languages/pt_BR.ts
@@ -2,553 +2,72 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pt_BR" sourcelanguage="en">
 <context>
-    <name>documentation_dock_widget</name>
+    <name>ListDialog</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
-        <source>Documentation</source>
-        <translation type="unfinished">Documentação</translation>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation>Selecionar Tudo</translation>
     </message>
 </context>
 <context>
-    <name>file_editor</name>
-    <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
-        <source>Octave Editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+38"/>
-        <source>Could not open file %1 for read:
-%2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+43"/>
-        <source>File not saved! A file with the selected name
-%1
-is already open in the editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+26"/>
-        <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+141"/>
-        <source>&amp;%1 %2</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>QObject</name>
     <message>
-        <location line="+130"/>
-        <source>&amp;New File</source>
-        <translation type="unfinished">&amp;Novo Arquivo</translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>&amp;Open File</source>
-        <translation type="unfinished">&amp;Abrir Arquivo</translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>&amp;Save File</source>
-        <translation type="unfinished">&amp;Salvar Arquivo</translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save File &amp;As</source>
-        <translation type="unfinished">Salvar Arquivo &amp;Como</translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>&amp;Undo</source>
-        <translation type="unfinished">&amp;Desfazer</translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>&amp;Redo</source>
-        <translation type="unfinished">&amp;Refazer</translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>&amp;Copy</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Cu&amp;t</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Paste</source>
-        <translation type="unfinished"></translation>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation>automática</translation>
     </message>
     <message>
         <location line="+1"/>
-        <source>&amp;Next Bookmark</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>Pre&amp;vious Bookmark</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>Toggle &amp;Bookmark</source>
-        <translation type="unfinished"></translation>
+        <source>function</source>
+        <translation>função</translation>
     </message>
     <message>
         <location line="+1"/>
-        <source>&amp;Remove All Bookmarks</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>&amp;Next breakpoint</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Pre&amp;vious breakpoint</source>
-        <translation type="unfinished"></translation>
+        <source>global</source>
+        <translation>global</translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Toggle &amp;breakpoint</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>&amp;Remove All breakpoints</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation>oculta</translation>
     </message>
     <message>
         <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>&amp;Find and Replace</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Save File And Run</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+51"/>
-        <source>&amp;File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+8"/>
-        <source>&amp;Edit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+19"/>
-        <source>&amp;Debug</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+9"/>
-        <source>&amp;Run</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>file_editor_tab</name>
-    <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
-        <source>Octave Editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+102"/>
-        <source>Could not open file %1 for write:
-%2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+63"/>
-        <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>files_dock_widget</name>
-    <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+11"/>
-        <source>Move up one directory.</source>
-        <translation type="unfinished">Subir um diretório.</translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
-        <translation type="unfinished">Digite o caminho ou o nome do arquivo.</translation>
-    </message>
-    <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
-        <translation type="unfinished">Clique duas vezes num arquivo para abrí-lo.</translation>
-    </message>
-</context>
-<context>
-    <name>find_dialog</name>
-    <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
-        <source>Find &amp;what:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Re&amp;place with:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Match &amp;case</source>
-        <translation type="unfinished"></translation>
+        <source>inherited</source>
+        <translation>herdada</translation>
     </message>
     <message>
         <location line="+1"/>
-        <source>Search from &amp;start</source>
+        <source>persistent</source>
+        <translation>persistente</translation>
+    </message>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.cc" line="+64"/>
+        <source>foreground</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+1"/>
-        <source>&amp;Wrap while searching</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>&amp;Find Next</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>&amp;Replace</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>Replace &amp;All</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>&amp;More</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+11"/>
-        <source>&amp;Whole words</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>Regular E&amp;xpressions</source>
+        <source>background</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+1"/>
-        <source>Search &amp;backward</source>
+        <source>selection</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+1"/>
-        <source>Search se&amp;lection</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>history_dock_widget</name>
-    <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
-        <source>Doubleclick a command to transfer it to the terminal.</source>
-        <translation type="unfinished">Clique duas vezes num comando para transferí-lo ao terminal.</translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Enter text to filter the command history.</source>
-        <translation type="unfinished">Digite um texto para filtrar o hitórico de comandos.</translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Command History</source>
-        <translation type="unfinished">Histórico de Comandos</translation>
-    </message>
-    <message>
-        <location line="+42"/>
-        <source>Copy</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>Evaluate</source>
+        <source>cursor</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>lexer_octave_gui</name>
-    <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation type="unfinished">Padrão</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation type="unfinished">Comentário</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation type="unfinished">Comando</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation type="unfinished">Número</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation type="unfinished">Palavra-Chave</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation type="unfinished">String com aspas simples</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation type="unfinished">Operador</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation type="unfinished">Identificador</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
-        <translation type="unfinished">String com aspas duplas</translation>
-    </message>
-</context>
-<context>
-    <name>main_window</name>
-    <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation type="unfinished">Salvar ambiente de trabalho</translation>
-    </message>
-    <message>
-        <location line="+11"/>
-        <source>Load Workspace</source>
-        <translation type="unfinished">Carregar ambiente de trabalho</translation>
-    </message>
-    <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
-        <source>About Octave</source>
-        <translation type="unfinished">Sobre o Octave</translation>
-    </message>
-    <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation type="unfinished">Visualizar variáveis no ambiente de trabalho.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation type="unfinished">Pesquise no histórico de comandos.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation type="unfinished">Procure seus arquivos.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+39"/>
-        <source>&amp;File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>New</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>QTerminal</name>
     <message>
-        <location line="+3"/>
-        <source>Script</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Function</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Class</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Figure</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Open...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Preferences...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Exit</source>
-        <translation type="unfinished">Sair</translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>&amp;Edit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Undo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <source>Cut</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location filename="../qterminal/libqterminal/QTerminal.h" line="+116"/>
         <source>Copy</source>
-        <translation type="unfinished"></translation>
+        <translation type="unfinished">Copiar</translation>
     </message>
     <message>
         <location line="+4"/>
@@ -557,510 +76,1595 @@
     </message>
     <message>
         <location line="+4"/>
-        <source>Paste To Workspace...</source>
+        <source>Clear All</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QWinTerminalImpl</name>
+    <message>
+        <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1451"/>
+        <source>copied selection to clipboard</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>documentation_dock_widget</name>
+    <message>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
+        <source>Documentation</source>
+        <translation>Documentação</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation>Veja a documentação para ajuda.</translation>
+    </message>
+</context>
+<context>
+    <name>file_editor</name>
+    <message>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
+        <source>Octave Editor</source>
+        <translation>Editor Octave</translation>
+    </message>
+    <message>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Scripts Octave (*.m);;Todos Arquivos (*)</translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Could not open file %1 for read:
+%2.</source>
+        <translation>Não foi possível abrir arquivo %1 para leitura: %2.</translation>
+    </message>
+    <message>
+        <location line="+49"/>
+        <source>File not saved! A file with the selected name
+%1
+is already open in the editor</source>
+        <translation>Arquivo não salvo! Um arquivo com o nome selecionado %1 se encontra aberto no editor</translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
+        <translation>A aba do editor associada ao arquivo desapareceu. Foi provavelmente fechada de alguma maneira.</translation>
+    </message>
+    <message>
+        <location line="+205"/>
+        <source>&amp;%1 %2</source>
+        <translation>&amp;%1 %2</translation>
+    </message>
+    <message>
+        <location line="+159"/>
+        <source>&amp;New File</source>
+        <translation>&amp;Novo Arquivo</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Open File</source>
+        <translation>&amp;Abrir Arquivo</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Save File</source>
+        <translation>&amp;Salvar Arquivo</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Save File &amp;As</source>
+        <translation>Salvar Arquivo &amp;Como</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation>Imprimir</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Undo</source>
+        <translation>&amp;Desfazer</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Redo</source>
+        <translation>&amp;Refazer</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Copy</source>
+        <translation>&amp;Copiar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Cu&amp;t</source>
+        <translation>Recor&amp;tar</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Paste</source>
+        <translation>Co&amp;lar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Next Bookmark</source>
+        <translation>&amp;Próximo Marcador</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Pre&amp;vious Bookmark</source>
+        <translation>Marcardor &amp;Anterior</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Toggle &amp;Bookmark</source>
+        <translation>Visualizar &amp;Marcador</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Remove All Bookmarks</source>
+        <translation>&amp;Remover Todos Marcadores</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>&amp;Next breakpoint</source>
+        <translation>Ponto de interrupção &amp;seguinte</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Pre&amp;vious breakpoint</source>
+        <translation>Ponto de interrupção &amp;anterior</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Toggle &amp;breakpoint</source>
+        <translation>Visualizar ponto de &amp;interrupção</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Remove All breakpoints</source>
+        <translation>&amp;Remover Todos Pontos de interrupção</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
+        <translation>&amp;Comentar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation>&amp;Descomentar</translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation>Arquivos &amp;recentes</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation>&amp;Fechar</translation>
+    </message>
     <message>
         <location line="+5"/>
-        <source>Select All</source>
-        <translation type="unfinished"></translation>
+        <source>Close All</source>
+        <translation>Fechar &amp;Todos</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation>Fechar Outros Arquivos</translation>
+    </message>
+    <message>
+        <location line="-94"/>
+        <source>&amp;Find and Replace</source>
+        <translation>Procurar e Substituir</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Save File And Run</source>
+        <translation>Salvar e Executar</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation>Vá para Linha</translation>
+    </message>
+    <message>
+        <location line="+63"/>
+        <source>&amp;File</source>
+        <translation>&amp;Arquivo</translation>
+    </message>
+    <message>
+        <location line="+35"/>
+        <source>&amp;Edit</source>
+        <translation>&amp;Editar</translation>
+    </message>
+    <message>
+        <location line="+21"/>
+        <source>&amp;Debug</source>
+        <translation>&amp;Depurar</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>&amp;Run</source>
+        <translation>&amp;Executar</translation>
+    </message>
+</context>
+<context>
+    <name>file_editor_tab</name>
+    <message>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation>Vá para linha</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation>Número da linha</translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation>&lt;sem_nome&gt;</translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation>Você deseja salvar ou descartar as alterações?</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation>Você deseja salvar, descartar as alterações ou cancelar fechamento?</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
+        <source>Octave Editor</source>
+        <translation>Editor Octave</translation>
+    </message>
+    <message>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation>O arquivo
+%1
+está prestes a ser fechado com modificações.
+%2</translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Scripts Octave (*.m);; Todos Arquivos (*)</translation>
+    </message>
+    <message>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation>Arquivo não salvo! O nome selecionado
+%1
+é o mesmo do arquivo atual</translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation>
+
+Aviso: Os arquivos no editor foram modificados!</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation>Parece que o arquivo
+%1
+foi removido ou renomeado. Pretende salvá-lo agora?%2</translation>
+    </message>
+    <message>
+        <location line="-192"/>
+        <source>Could not open file %1 for write:
+%2.</source>
+        <translation>Não foi possível abrir arquivo %1 para escrita:
+%2.</translation>
+    </message>
+    <message>
+        <location line="+170"/>
+        <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
+        <translation>Parece que o arquivo &apos;%1&apos; foi modificado por outra aplicação. Deseja recarregá-lo?</translation>
+    </message>
+</context>
+<context>
+    <name>files_dock_widget</name>
+    <message>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation>Navegador de Arquivos</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation>Procure seus arquivos.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation>Informe o caminho ou nome do arquivo</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation>Mova um diretório acima</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation>Mostre o diretório corrente</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation>Vá para o diretório corrente</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation>Mude o diretório corrente</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation>Mude diretório corrente para o diretório atual do navegador</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation>Ações no diretório corrente</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation>Mostre diretório corrente</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation>Procure no diretório</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation>Procurar arquivos...</translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation>Novo Arquivo</translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation>Novo Diretório</translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation>Clique duas vezes em um arquivo para abrí-lo</translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation>Abrir</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation>Abrir na Aplicação Padrão</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation>Copiar Seleção para Área de Transferência</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation>Executar</translation>
     </message>
     <message>
         <location line="+3"/>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
+        <source>Load Data</source>
+        <translation>Carregar Dados</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation type="unfinished"></translation>
+        <source>Set Current Directory</source>
+        <translation>Alterar Diretório Corrente </translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation>Renomear</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation>Remover</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation>Renomear arquivo/diretório</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation>Renomear arquivo/diretório:</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation>
+para:</translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation>Remover arquivo/diretório</translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sure you want to delete
+</source>
+        <translation>Você tem certeza que deseja remover</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Can not delete a directory that is not empty</source>
+        <translation>Não é possível remover um diretório que não está vázio</translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation>Alterar diretório do navegador de arquivos</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation>Criar Arquivo</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation>Criar arquivo em</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation>Criar Diretório</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation>Criar diretório em</translation>
+    </message>
+</context>
+<context>
+    <name>find_dialog</name>
+    <message>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
+        <source>Find &amp;what:</source>
+        <translation>Procure por:</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Re&amp;place with:</source>
+        <translation>Substituir com:</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Match &amp;case</source>
+        <translation>Considerar caixa alta/baixa</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search from &amp;start</source>
+        <translation>Procurar do começo</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>&amp;Wrap while searching</source>
+        <translation>Destacar durante busca</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;Find Next</source>
+        <translation>Procurar Próximo</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation>Procurar Anterior</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>&amp;Replace</source>
+        <translation>Substituir</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Replace &amp;All</source>
+        <translation>Substituir Todos</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;More</source>
+        <translation>Mais</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>&amp;Whole words</source>
+        <translation>Todas as palavras</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Regular E&amp;xpressions</source>
+        <translation>Expressões Regulares</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search &amp;backward</source>
+        <translation>Procure para trás</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search se&amp;lection</source>
+        <translation>Seleção de busca</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation>Procurar do final</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation>Procurar do começo</translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation>Substituir Resultado</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation>%1 itens substituidos</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation>Procurar Resultado</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation>Nenhum resultado encontrado</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation>Encontrar Arquivos</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation>Nomeados:</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation>Informe a expressão do nome do arquivo</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation>Iniciar em:</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation>Entrar no diretório de início</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation>Procurar...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation>Procurar por diretório de início</translation>
     </message>
     <message>
         <location line="+3"/>
-        <source>Find Files...</source>
-        <translation type="unfinished"></translation>
+        <source>Recurse directories</source>
+        <translation>Recursão nos diretórios</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation>Procure recursivamente pelos diretórios para encontrar arquivos</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation>Inclua diretórios</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation>Inclua diretórios explorados no resultado da busca</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation>Não insensível a caixa alta/baixa</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation>Altere se o nome é insensível a caixa do texto</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation>Contém texto:</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation>Busca precisa honrar texto</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation>Texto para honrar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation>Texto insensível a caixa alta/baixa</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation>Altere se conteúdo do texto é insensível a caixa alta/baixa</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation>Resultados de Busca</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Idle.</source>
+        <translation>Ocupado.</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation>Procurar</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation>Iniciar procura por arquivos encontrados</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation>Parar</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation>Parar busca</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation>Nome do arquivo/localização</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation>Conteúdo do arquivo</translation>
+    </message>
+    <message>
+        <location line="+99"/>
+        <source>Searching...</source>
+        <translation>Buscando...</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation>Alterar diretório de busca</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation>Nome do Arquivo</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation>Diretório</translation>
+    </message>
+</context>
+<context>
+    <name>history_dock_widget</name>
+    <message>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation>Pesquise no histórico de comandos.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Doubleclick a command to transfer it to the terminal.</source>
+        <translation>Clique duas vezes num comando para transferí-lo ao terminal.</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Enter text to filter the command history.</source>
+        <translation>Digite um texto para filtrar o hitórico de comandos.</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Command History</source>
+        <translation>Histórico de Comandos</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Copy</source>
+        <translation>Copiar</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Evaluate</source>
+        <translation>Avaliar</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translation>Criar script</translation>
+    </message>
+</context>
+<context>
+    <name>main_window</name>
+    <message>
+        <location filename="../src/main-window.cc" line="+155"/>
+        <source>Load Workspace</source>
+        <translation>Carregar ambiente de trabalho</translation>
+    </message>
+    <message>
+        <location line="+355"/>
+        <location line="+769"/>
+        <source>About Octave</source>
+        <translation>Sobre o Octave</translation>
+    </message>
+    <message>
+        <location line="-338"/>
+        <source>&amp;File</source>
+        <translation>Arquivo</translation>
+    </message>
+    <message>
+        <location line="+52"/>
+        <source>New</source>
+        <translation>Novo</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Script</source>
+        <translation>Script</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Function</source>
+        <translation>Função</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Figure</source>
+        <translation>Figura</translation>
+    </message>
+    <message>
+        <location line="-55"/>
+        <source>Open...</source>
+        <translation>Abrir...</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Preferences...</source>
+        <translation>Preferências...</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Exit</source>
+        <translation>Sair</translation>
+    </message>
+    <message>
+        <location line="+51"/>
+        <source>&amp;Edit</source>
+        <translation>Editar</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Undo</source>
+        <translation>Desfazer</translation>
     </message>
     <message>
         <location line="+7"/>
+        <source>Copy</source>
+        <translation>Copiar</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Paste</source>
+        <translation>Colar</translation>
+    </message>
+    <message>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
+        <translation>Salvar Ambiente de Trabalho como</translation>
+    </message>
+    <message>
+        <location line="-602"/>
+        <source>Set working directory</source>
+        <translation>Alterar diretório de trabalho</translation>
+    </message>
+    <message>
+        <location line="+686"/>
+        <source>Find Files...</source>
+        <translation>Encontrar Arquivos...</translation>
+    </message>
+    <message>
+        <location line="+6"/>
         <source>Clear Command Window</source>
-        <translation type="unfinished"></translation>
+        <translation>Limpar Janela de Comandos</translation>
     </message>
     <message>
         <location line="+3"/>
         <source>Clear Command History</source>
-        <translation type="unfinished"></translation>
+        <translation>Limpar Histórico de Comandos</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
-        <translation type="unfinished"></translation>
+        <translation>Limpar Ambiente de Trabalho</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
-        <translation type="unfinished"></translation>
+        <translation>Depurar</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
-        <translation type="unfinished"></translation>
+        <translation>Passo</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
-        <translation type="unfinished"></translation>
+        <translation>Passo adentro</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
-        <translation type="unfinished"></translation>
+        <translation>Passo a fora</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Continue</source>
+        <translation>Continuar</translation>
     </message>
     <message>
         <location line="+8"/>
-        <source>Continue</source>
-        <translation type="unfinished"></translation>
+        <source>Exit Debug Mode</source>
+        <translation>Sair de Modo de Depuração</translation>
+    </message>
+    <message>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation>Mostrar Navegador de Arquivos</translation>
     </message>
     <message>
-        <location line="+13"/>
-        <source>Exit Debug Mode</source>
-        <translation type="unfinished"></translation>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation>Navegador de Arquivos</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
+        <translation>Recuperar Disposição de Janelas Padrão</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
-        <translation type="unfinished"></translation>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation>No Disco</translation>
     </message>
     <message>
-        <location line="+1"/>
-        <source>Load workspace</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation>Online</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation>Informe nome do diretório</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
+        <translation>Diretório Atual</translation>
     </message>
     <message>
         <location line="+4"/>
-        <source>&amp;Window</source>
-        <translation type="unfinished"></translation>
+        <source>One directory up</source>
+        <translation>Um diretório acima</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation>Procurar diretórios</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Show Command Window</source>
-        <translation type="unfinished"></translation>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation>Carregar ambiente de trabalho</translation>
+    </message>
+    <message>
+        <location line="+192"/>
+        <source>&amp;Window</source>
+        <translation>&amp;Janela</translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Show Command History</source>
-        <translation type="unfinished"></translation>
+        <source>Show Command Window</source>
+        <translation>Mostrar Janela de Comandos</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Show Command History</source>
+        <translation>Mostrar Histórico de Comandos</translation>
     </message>
     <message>
         <location line="+6"/>
         <source>Show Workspace</source>
-        <translation type="unfinished"></translation>
+        <translation>Mostrar Ambiente de Trabalho</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Editor</source>
+        <translation>Mostrar Editor</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Documentation</source>
+        <translation>Mostrar Documentação</translation>
     </message>
     <message>
         <location line="+5"/>
-        <source>Show Editor</source>
-        <translation type="unfinished"></translation>
+        <source>Command Window</source>
+        <translation>Janela de Comandos</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Command History</source>
+        <translation>Histórico de Comandos</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Workspace</source>
+        <translation>Ambiente de trabalho</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Documentation</source>
-        <translation type="unfinished"></translation>
+        <location line="+3"/>
+        <source>Editor</source>
+        <translation>Editor</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+108"/>
+        <source>Documentation</source>
+        <translation>Documentação</translation>
+    </message>
+    <message>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation>&amp;Ajuda</translation>
     </message>
     <message>
         <location line="+7"/>
-        <source>Command Window</source>
-        <translation type="unfinished"></translation>
+        <source>Report Bug</source>
+        <translation>Reportar Bug</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Command History</source>
-        <translation type="unfinished">Histórico de Comandos</translation>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation>Visite Agora</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation type="unfinished"></translation>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation>Visite Octave Forge</translation>
     </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
     <message>
-        <location line="+4"/>
-        <source>Workspace</source>
-        <translation type="unfinished">Ambiente de trabalho</translation>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
+        <translation>Desacoplar widget</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Editor</source>
-        <translation type="unfinished">Editor</translation>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translation>Esconder widget</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Documentation</source>
-        <translation type="unfinished">Documentação</translation>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation>Acoplar widget</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation>ajuda</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation>O arquivo %1 não existe no path. Para depurar a função, você precisa mudar para o diretório %2 ou adicionar esse diretório ao path.</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
+        <translation>O arquivo %1 é desconsiderado em prol de outro arquivo com mesmo nome no path. Para depurar a função, mude para o diretório %2.</translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Report Bug</source>
-        <translation type="unfinished">Reportar Bug</translation>
+        <source>Change Directory or Add Directory to Load Path</source>
+        <translation>Alterar diretório ou adicionar ao path</translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Visit Agora</source>
-        <translation type="unfinished"></translation>
+        <source>Change Directory</source>
+        <translation>Alterar Diretório</translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Visit Octave Forge</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation>Adicionar diretório ao path</translation>
     </message>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>Cancelar</translation>
     </message>
 </context>
 <context>
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
-        <translation type="unfinished">Configurações</translation>
+        <translation>Configurações</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Octave logo only</source>
-        <translation type="unfinished"></translation>
+        <translation>Geral</translation>
     </message>
     <message>
-        <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Letter icons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
-        <translation type="unfinished">Editor</translation>
+        <location line="+97"/>
+        <source>Octave logo only</source>
+        <translation>Apenas logotipo Octave</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font</source>
-        <translation type="unfinished"></translation>
+        <source>Letter icons</source>
+        <translation>Ícones de letra</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Graphic icons</source>
+        <translation>Ícones de gráficos</translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation type="unfinished"></translation>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation>Editor</translation>
+    </message>
+    <message>
+        <location line="+16"/>
+        <source>Show white space</source>
+        <translation>Mostrar espaço em branco</translation>
     </message>
     <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <source>Show line numbers</source>
-        <translation type="unfinished"></translation>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation>Não mostre espaços em branco usados para identação</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Highlight current line</source>
-        <translation type="unfinished"></translation>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation>Cor</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Code completion</source>
-        <translation type="unfinished"></translation>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation>Tamanho de identação</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show complete path in window title</source>
-        <translation type="unfinished"></translation>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation>Tab identa linha</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation type="unfinished"></translation>
+        <source>Auto indentation</source>
+        <translation>Autoidentação</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation>Tamanho de TAB</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation>Mostrar guias de identação</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation>Apagar remove identação na linha</translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation>Número de caracteres para ativar lista de sugestões</translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation type="unfinished">Usar editor de arquivos personalizado:</translation>
+        <location line="+71"/>
+        <source>Match keywords</source>
+        <translation>Honrar palavras-chave</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Case sensitive</source>
+        <translation>Caixa alta/baixa</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>emacs</source>
-        <translation type="unfinished">emacs</translation>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation>Substituir palavra por outra sugerida</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation>Honrar palavras no documento</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation>Reabrir abas da sessão anterior durante inicialização</translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
+        <translation>Usar editor de texto externo</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
-        <source>Terminal</source>
-        <translation type="unfinished">Terminal</translation>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation>Linha de comando (%f=file, %l=line):</translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation>Estilos do Editor</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Selecionar fonte, tamanho de fonte (como diferença para o tamanho padrão), decoração de fonte (negrito, itálico, sublinhado), cor de texto e cor de fundo de tela (para o último, a cor rosa (255,0,255) é sinônimo da cor de fundo padrão)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
-        <source>Cursor type:</source>
-        <translation type="unfinished"></translation>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation>Usar Cor do Plano de Frente</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation>Cores do Terminal</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Font</source>
+        <translation>Fonte</translation>
+    </message>
+    <message>
+        <location line="-744"/>
+        <source>Show line numbers</source>
+        <translation>Mostra número das linhas</translation>
     </message>
     <message>
         <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Cursor blinking</source>
-        <translation type="unfinished"></translation>
+        <source>Highlight current line</source>
+        <translation>Enfatizar linha corrente</translation>
+    </message>
+    <message>
+        <location line="+262"/>
+        <source>Code completion</source>
+        <translation>Completação de código</translation>
+    </message>
+    <message>
+        <location line="-282"/>
+        <source>Show complete path in window title</source>
+        <translation>Mostrar caminho completo no título da janela</translation>
+    </message>
+    <message>
+        <location line="+548"/>
+        <source>emacs</source>
+        <translation>emacs</translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+67"/>
+        <source>Terminal</source>
+        <translation>Terminal</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>Cursor type:</source>
+        <translation>Tipo do Cursor:</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Cursor blinking</source>
+        <translation>Cursor piscando</translation>
+    </message>
+    <message>
+        <location line="+101"/>
+        <source>Font size</source>
+        <translation>Tamanho de fonte</translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>File Browser</source>
-        <translation type="unfinished">Navegador de Arquivos</translation>
+        <translation>Navegador de Arquivos</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation type="unfinished">Mostrar nomes de arquivo</translation>
+        <source>Show file size</source>
+        <translation>Mostrar tamanho do arquivo</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show file size</source>
-        <translation type="unfinished">Mostrar tamanho do arquivo</translation>
+        <source>Show file type</source>
+        <translation>Mostrar tipo do arquivo</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show file type</source>
-        <translation type="unfinished">Mostrar tipo do arquivo</translation>
+        <source>Show date of last modification</source>
+        <translation>Mostrar data de última modificação</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show date of last modification</source>
-        <translation type="unfinished">Mostrar data de última modificação</translation>
+        <source>Show hidden files</source>
+        <translation>Mostrar arquivos ocultos</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Show hidden files</source>
-        <translation type="unfinished">Mostrar arquivos ocultos</translation>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation>Sincronizar diretório do Octave com diretório do navegador de arquivos</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Alternating row colors</source>
-        <translation type="unfinished">Alternar cores das linhas</translation>
+        <translation>Alternar cores das linhas</translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation>Ambiente de trabalho</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation>Armazenar cores de classes</translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
-        <translation type="unfinished"></translation>
+        <translation>Rede</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Use proxy server</source>
+        <translation>Usar servidor proxy</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Proxy Type:</source>
+        <translation>Tipo de Proxy:</translation>
+    </message>
+    <message>
+        <location line="-33"/>
+        <source>HttpProxy</source>
+        <translation>HttpProxy</translation>
+    </message>
+    <message>
+        <location line="-1107"/>
+        <source>Icon set for dock widgets</source>
+        <translation>Conjunto de ícones para widgets</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation>Linguagem (requer reinicialização)</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
-        <source>Use proxy server</source>
-        <translation type="unfinished"></translation>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation>Tamanho de Ícone</translation>
+    </message>
+    <message>
+        <location line="+1098"/>
+        <source>Socks5Proxy</source>
+        <translation>Socks5Proxy</translation>
+    </message>
+    <message>
+        <location line="-16"/>
+        <source>Hostname:</source>
+        <translation>Hostname:</translation>
+    </message>
+    <message>
+        <location line="+54"/>
+        <source>Port:</source>
+        <translation>Porta:</translation>
     </message>
     <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Proxy Type:</source>
-        <translation type="unfinished"></translation>
+        <location line="-27"/>
+        <source>Username:</source>
+        <translation>Nome do usuário:</translation>
+    </message>
+    <message>
+        <location line="+37"/>
+        <source>Password:</source>
+        <translation>Senha:</translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
-        <source>HttpProxy</source>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation>Configuração do sistema</translation>
+    </message>
+    <message>
+        <location line="-268"/>
+        <source>IBeam Cursor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Socks5Proxy</source>
+        <location line="+1"/>
+        <source>Block Cursor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
-        <source>Hostname:</source>
+        <location line="+1"/>
+        <source>Underline Cursor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Port:</source>
-        <translation type="unfinished"></translation>
+        <location line="+129"/>
+        <source>Difference to the default size</source>
+        <translation>Diferença do tamanho padrão</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation>Cor de fundo, rosa (255,0,255) significa padrão</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Username:</source>
-        <translation type="unfinished"></translation>
+        <location line="+2"/>
+        <source>b</source>
+        <translation>b</translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Password:</source>
-        <translation type="unfinished">Senha:</translation>
+        <location line="+1"/>
+        <source>i</source>
+        <translation>i</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <translation>u</translation>
     </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
-        <translation type="unfinished"></translation>
+        <translation>Janela de Comandos</translation>
     </message>
 </context>
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
-        <translation type="unfinished"></translation>
+        <translation>Digite aqui e pressione &apos;Enter&apos; para procurar</translation>
     </message>
     <message>
         <location line="+4"/>
         <source>Global search</source>
-        <translation type="unfinished"></translation>
+        <translation>Busca global</translation>
     </message>
 </context>
 <context>
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
-        <translation type="unfinished"></translation>
+        <translation>Bem-vindo ao GNU Octave</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
-        <translation type="unfinished"></translation>
+        <translation>Aparentemente o Octave GUI foi lançado pela primeira vez neste computador, já que nenhum arquivo de configuração foi encontrado em &apos;~/.octave-gui&apos;. Este tutorial irá guiá-lo para realizar configurações essenciais antes de utilizar o Octave. Se deseja transferir suas configurações definidas previamente, feche este diálogo e copie os arquivos para o local apropriado. IMPORTANT: Este tutorial não é totalmente funcional ainda. Simplesmente prossiga e configurações padrão serão criadas.</translation>
     </message>
     <message>
         <location line="+41"/>
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
-        <translation type="unfinished"></translation>
+        <translation>Próximo</translation>
     </message>
     <message>
         <location line="-124"/>
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
-        <translation type="unfinished"></translation>
+        <translation>Anterior</translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
-        <translation type="unfinished"></translation>
+        <translation>Bem-vindo ao Octave!</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
-        <translation type="unfinished"></translation>
+        <translation>Esta é a versão de desenvolvimento do Octave com a primeira GUI oficial.</translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
-        <translation type="unfinished"></translation>
+        <translation>Você parece ter executado o Octave GUI pela primeira vez neste computador. Este assistente irá ajudá-lo. Clique &apos;Finalizar&apos; para escrever um arquivo de configuração padrão e lançar o Octave GUI.</translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
-        <translation type="unfinished"></translation>
+        <translation>Finalizar</translation>
     </message>
 </context>
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
-        <translation type="unfinished">Nome</translation>
+        <translation>Nome</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Class</source>
+        <translation>Classe</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Class</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Dimension</source>
+        <translation>Dimensão</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Dimension</source>
-        <translation type="unfinished"></translation>
+        <location line="+1"/>
+        <source>Value</source>
+        <translation>Valor</translation>
     </message>
     <message>
-        <location line="+0"/>
-        <source>Value</source>
-        <translation type="unfinished">Valor</translation>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation>Classe de Armazenamento</translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation>Clique com botão direito para copiar, renomear ou mostrar</translation>
     </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
-        <translation type="unfinished">Ambiente de trabalho</translation>
+        <translation>Ambiente de trabalho</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation>Visualizar variáveis no ambiente de trabalho.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation>Copiar</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation>Renomear</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation>Somente símbolos do nível de topo podem ser renomeados.</translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation>Veja as variáveis no ambiente de trabalho ativo.&lt;br&gt;</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation>Cores para classe de armazenamento:</translation>
     </message>
 </context>
 </TS>
--- a/libgui/languages/ru_RU.ts
+++ b/libgui/languages/ru_RU.ts
@@ -2,53 +2,98 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ru_RU">
 <context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>documentation_dock_widget</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
         <source>Documentation</source>
         <translation type="unfinished">Документация</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>file_editor</name>
     <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+38"/>
+        <location line="+117"/>
         <source>Could not open file %1 for read:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+43"/>
+        <location line="+49"/>
         <source>File not saved! A file with the selected name
 %1
 is already open in the editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
+        <location line="+28"/>
         <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+205"/>
         <source>&amp;%1 %2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+130"/>
+        <location line="+159"/>
         <source>&amp;New File</source>
         <translation type="unfinished">Созд&amp;ать</translation>
     </message>
@@ -68,6 +113,11 @@
         <translation type="unfinished">Сохранить &amp;как</translation>
     </message>
     <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location line="+3"/>
         <source>&amp;Undo</source>
         <translation type="unfinished">О&amp;тменить</translation>
@@ -93,22 +143,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Next Bookmark</source>
         <translation type="unfinished">С&amp;ледующая закладка</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Pre&amp;vious Bookmark</source>
         <translation type="unfinished">Пр&amp;едыдущая закладка</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Toggle &amp;Bookmark</source>
         <translation type="unfinished">&amp;Установить/снять закладку</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Remove All Bookmarks</source>
         <translation type="unfinished"></translation>
     </message>
@@ -133,17 +183,37 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-94"/>
         <source>&amp;Find and Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -153,22 +223,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+51"/>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+63"/>
         <source>&amp;File</source>
         <translation type="unfinished">&amp;Файл</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+8"/>
+        <location line="+35"/>
         <source>&amp;Edit</source>
         <translation type="unfinished">&amp;Правка</translation>
     </message>
     <message>
-        <location line="+19"/>
+        <location line="+21"/>
         <source>&amp;Debug</source>
         <translation type="unfinished"></translation>
     </message>
@@ -181,72 +251,271 @@
 <context>
     <name>file_editor_tab</name>
     <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+102"/>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-192"/>
         <source>Could not open file %1 for write:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+63"/>
+        <location line="+170"/>
         <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>files_dock_widget</name>
     <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Текущий каталог</translation>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Файловый менеджер</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation type="unfinished">Просмотр файлов.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sre you want to delete
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+11"/>
-        <source>Move up one directory.</source>
-        <translation type="unfinished">Перейти на уровень выше.</translation>
+        <source>Can not delete a directory that is not empty</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
-        <translation type="unfinished">Введите путь или имя файла.</translation>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
-        <translation type="unfinished">Двойной щелчок по файлу откроет его.</translation>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>find_dialog</name>
     <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
         <source>Find &amp;what:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -276,7 +545,12 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
         <source>&amp;Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -291,7 +565,7 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
+        <location line="+13"/>
         <source>&amp;Whole words</source>
         <translation type="unfinished"></translation>
     </message>
@@ -310,11 +584,202 @@
         <source>Search se&amp;lection</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Idle.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+100"/>
+        <source>Searching...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>history_dock_widget</name>
     <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation type="unfinished">Просмотр и поиск в журнале выполненных команд.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
         <source>Doubleclick a command to transfer it to the terminal.</source>
         <translation type="unfinished">Двойной щелчок по команде перенесёт её в командную строку.</translation>
     </message>
@@ -329,7 +794,7 @@
         <translation type="unfinished">Журнал выполненных команд</translation>
     </message>
     <message>
-        <location line="+42"/>
+        <location line="+20"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
@@ -338,250 +803,103 @@
         <source>Evaluate</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lexer_octave_gui</name>
     <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation type="unfinished">По умолчанию</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation type="unfinished">Комментарий</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation type="unfinished">Команда</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation type="unfinished">Число</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation type="unfinished">Зарезервированное слово</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation type="unfinished">Строка в одинарных кавычках</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation type="unfinished">Оператор</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation type="unfinished">Идентификатор</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
-        <translation type="unfinished">Строка в двойных кавычках</translation>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>main_window</name>
     <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation type="unfinished">Сохранить область переменных</translation>
-    </message>
-    <message>
-        <location line="+11"/>
+        <location filename="../src/main-window.cc" line="+155"/>
         <source>Load Workspace</source>
         <translation type="unfinished">Загрузить область переменных</translation>
     </message>
     <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
+        <location line="+355"/>
+        <location line="+769"/>
         <source>About Octave</source>
         <translation type="unfinished">Об Octave</translation>
     </message>
     <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation type="unfinished">Просмотр содержимого текущей области переменных.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation type="unfinished">Просмотр и поиск в журнале выполненных команд.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation type="unfinished">Просмотр файлов.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+39"/>
+        <location line="-338"/>
         <source>&amp;File</source>
         <translation type="unfinished">&amp;Файл</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+52"/>
         <source>New</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
+        <location line="+4"/>
         <source>Script</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Function</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+2"/>
-        <source>Class</source>
+        <source>Function</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Figure</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="-55"/>
         <source>Open...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
+        <location line="+18"/>
         <source>Preferences...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+4"/>
         <source>Exit</source>
         <translation type="unfinished">Выход</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+51"/>
         <source>&amp;Edit</source>
         <translation type="unfinished">&amp;Правка</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+5"/>
         <source>Undo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <source>Cut</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+7"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+5"/>
         <source>Paste</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Paste To Workspace...</source>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Select All</source>
+        <location line="-602"/>
+        <source>Set working directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Delete</source>
+        <location line="+686"/>
+        <source>Find Files...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Find Files...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
         <source>Clear Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -591,143 +909,228 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+4"/>
         <source>Continue</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+13"/>
+        <location line="+8"/>
         <source>Exit Debug Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Файловый менеджер</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
-        <source>Load workspace</source>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+4"/>
+        <source>One directory up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+192"/>
         <source>&amp;Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+6"/>
         <source>Show Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
+        <location line="+3"/>
         <source>Show Command History</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+6"/>
         <source>Show Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Documentation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+5"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Command History</source>
         <translation type="unfinished">Журнал выполненных команд</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Текущий каталог</translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+6"/>
         <source>Workspace</source>
         <translation type="unfinished">Область переменных</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Editor</source>
         <translation type="unfinished">Редактор</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
+        <location line="+108"/>
         <source>Documentation</source>
         <translation type="unfinished">Документация</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Report Bug</source>
+        <translation type="unfinished">Сообщить об ошибке</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
+    <message>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+29"/>
+        <source>Unock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Report Bug</source>
-        <translation type="unfinished">Сообщить об ошибке</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Visit Agora</source>
+        <source>Change Directory or Add Directory to Load Path</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Visit Octave Forge</source>
+        <source>Change Directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -735,223 +1138,331 @@
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
         <translation type="unfinished">Параметры</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+97"/>
         <source>Octave logo only</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location line="+10"/>
+        <source>Letter icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Graphic  icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation type="unfinished">Редактор</translation>
+    </message>
+    <message>
         <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Letter icons</source>
+        <source>Show white space</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Auto indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Match keywords</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
+        <source>Case sensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
-        <translation type="unfinished">Редактор</translation>
+        <location line="+10"/>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+46"/>
         <source>Font</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
+        <location line="-745"/>
         <source>Show line numbers</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+27"/>
         <source>Highlight current line</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+262"/>
         <source>Code completion</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-282"/>
         <source>Show complete path in window title</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation type="unfinished">Выбрать редактор:</translation>
-    </message>
-    <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+548"/>
         <source>emacs</source>
         <translation type="unfinished">emacs</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
+        <location line="+67"/>
         <source>Terminal</source>
         <translation type="unfinished">Командная строка</translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
+        <location line="+15"/>
         <source>Cursor type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+23"/>
         <source>Cursor blinking</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+102"/>
+        <source>Font size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>File Browser</source>
         <translation type="unfinished">Файловый менеджер</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation type="unfinished">Показывать имена файлов</translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file size</source>
         <translation type="unfinished">Показывать размер файлов</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file type</source>
         <translation type="unfinished">Показывать типы файлов</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show date of last modification</source>
         <translation type="unfinished">Показывать дату последнего изменения</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show hidden files</source>
         <translation type="unfinished">Показывать скрытые файлы</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
         <source>Alternating row colors</source>
         <translation type="unfinished">Чередующиеся цвета строк</translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation type="unfinished">Область переменных</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
+        <location line="+45"/>
         <source>Use proxy server</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+10"/>
         <source>Proxy Type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
+        <location line="-33"/>
         <source>HttpProxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-1108"/>
+        <source>Icon set for dock widgets</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1099"/>
         <source>Socks5Proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
+        <location line="-16"/>
         <source>Hostname:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+54"/>
         <source>Port:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-27"/>
         <source>Username:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+37"/>
         <source>Password:</source>
         <translation type="unfinished">Пароль:</translation>
     </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-137"/>
+        <source>Difference to the defalt size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>b</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>i</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -959,7 +1470,7 @@
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
         <translation type="unfinished"></translation>
     </message>
@@ -973,13 +1484,11 @@
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -988,10 +1497,6 @@
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1000,34 +1505,26 @@
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1035,32 +1532,72 @@
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
         <translation type="unfinished">Идентификатор</translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Class</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Dimension</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Value</source>
         <translation type="unfinished">Значение</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
         <translation type="unfinished">Область переменных</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation type="unfinished">Просмотр содержимого текущей области переменных.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 </TS>
--- a/libgui/languages/translators
+++ b/libgui/languages/translators
@@ -6,7 +6,8 @@
 de_DE Jacob Dawid <jacob.dawid@googlemail.com>
 en_US Jacob Dawid <jacob.dawid@googlemail.com>
 es_ES Valentin Ortega-Clavero <arcanos3030@gmail.com>
-pt_BE Júlio Hoffimann Mendes <julio.hoffimann@gmail.com>
+fr_FR David Bateman <dbateman@free.fr>, Catalin Codreanu <codreanu.catalin@gmail.com>
+pt_BR Júlio Hoffimann Mendes <julio.hoffimann@gmail.com>
 ru_RU Andriy Shinkarchuck <adriano32.gnu@gmail.com>
 uk_UA Andriy Shinkarchuck <adriano32.gnu@gmail.com>
 nl_NL Sander van Rijn <svr003@gmail.com>
--- a/libgui/languages/uk_UA.ts
+++ b/libgui/languages/uk_UA.ts
@@ -2,53 +2,98 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="uk_UA">
 <context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+250"/>
+        <source>Select All</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>documentation_dock_widget</name>
     <message>
-        <location filename="../src/documentation-dockwidget.cc" line="+34"/>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
         <source>Documentation</source>
         <translation type="unfinished">Документація</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>file_editor</name>
     <message>
-        <location filename="../src/m-editor/file-editor.cc" line="+146"/>
-        <location line="+38"/>
-        <location line="+43"/>
-        <location line="+26"/>
+        <location filename="../src/m-editor/file-editor.cc" line="+294"/>
+        <location line="+49"/>
+        <location line="+28"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-106"/>
-        <source>File %1 is already open in the editor.</source>
+        <location line="-193"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+38"/>
+        <location line="+117"/>
         <source>Could not open file %1 for read:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+43"/>
+        <location line="+49"/>
         <source>File not saved! A file with the selected name
 %1
 is already open in the editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
+        <location line="+28"/>
         <source>The associated file editor tab has disappeared.  It was likely closed by some means.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+205"/>
         <source>&amp;%1 %2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+130"/>
+        <location line="+159"/>
         <source>&amp;New File</source>
         <translation type="unfinished">&amp;Створити</translation>
     </message>
@@ -68,6 +113,11 @@
         <translation type="unfinished">Зберегти &amp;як</translation>
     </message>
     <message>
+        <location line="+4"/>
+        <source>Print</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location line="+3"/>
         <source>&amp;Undo</source>
         <translation type="unfinished">В&amp;ернути</translation>
@@ -93,22 +143,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Next Bookmark</source>
         <translation type="unfinished">До &amp;наступної закладки</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Pre&amp;vious Bookmark</source>
         <translation type="unfinished">До &amp;попередньої закладки</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>Toggle &amp;Bookmark</source>
         <translation type="unfinished">В&amp;становити/видалити закладку</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+3"/>
         <source>&amp;Remove All Bookmarks</source>
         <translation type="unfinished"></translation>
     </message>
@@ -133,17 +183,37 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>&amp;Comment Selected Text</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+1"/>
-        <source>&amp;Uncomment Selected Text</source>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+3"/>
+        <source>&amp;Uncomment</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+73"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>&amp;Close</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close All</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close Other Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-94"/>
         <source>&amp;Find and Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -153,22 +223,22 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+51"/>
+        <location line="+2"/>
+        <source>Go&amp;to Line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+63"/>
         <source>&amp;File</source>
         <translation type="unfinished">&amp;Файл</translation>
     </message>
     <message>
-        <location line="+6"/>
-        <source>Open &amp;Recent</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+8"/>
+        <location line="+35"/>
         <source>&amp;Edit</source>
         <translation type="unfinished">&amp;Правка</translation>
     </message>
     <message>
-        <location line="+19"/>
+        <location line="+21"/>
         <source>&amp;Debug</source>
         <translation type="unfinished"></translation>
     </message>
@@ -181,72 +251,271 @@
 <context>
     <name>file_editor_tab</name>
     <message>
-        <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/>
-        <location line="+102"/>
-        <location line="+98"/>
-        <location line="+63"/>
-        <location line="+14"/>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+726"/>
+        <source>Goto line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+70"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+114"/>
+        <location line="+104"/>
+        <location line="+66"/>
+        <location line="+22"/>
         <source>Octave Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-276"/>
-        <source>The file &apos;%1&apos; has been modified. Do you want to save the changes?</source>
+        <location line="-305"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+184"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+102"/>
+        <location line="+34"/>
+        <source>File not saved! The selected file name
+%1
+is the same as the current file name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+81"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-192"/>
         <source>Could not open file %1 for write:
 %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+98"/>
-        <source>File not saved!  You&apos;ve selected a file name
-
-     %1
-
-which is the same as the current file name.  Use Save to overwrite.  (Could allow overwriting, with message, if that is what folks want.)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+63"/>
+        <location line="+170"/>
         <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location line="+14"/>
-        <source>It seems that &apos;%1&apos; has been deleted or renamed. Do you want to save it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>files_dock_widget</name>
     <message>
-        <location filename="../src/files-dockwidget.cc" line="+43"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Поточний каталог</translation>
+        <location filename="../src/files-dock-widget.cc" line="+67"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Файловий менеджер</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation type="unfinished">Переглянути файли.</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Move up one directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Goto current octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Set octave directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Set octave directroy to current browser directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Actions on current directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Show Home directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <location line="+244"/>
+        <source>Find Files ...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-240"/>
+        <location line="+252"/>
+        <source>New File</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-249"/>
+        <location line="+252"/>
+        <source>New Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-223"/>
+        <source>Doubleclick a file to open it</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+185"/>
+        <source>Open</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Rename file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>
+ to: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+11"/>
+        <source>Delete file/directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-10"/>
+        <source>Are you sre you want to delete
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+11"/>
-        <source>Move up one directory.</source>
-        <translation type="unfinished">Перейти вгору деревом каталогів.</translation>
+        <source>Can not delete a directory that is not empty</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+128"/>
+        <source>Set directory of file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Create File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Enter the path or filename.</source>
-        <translation type="unfinished">Введіть повний шлях до файлу або назву файлу.</translation>
+        <location line="+0"/>
+        <source>Create file in
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+26"/>
-        <source>Doubleclick a file to open it.</source>
-        <translation type="unfinished">Подвійне клацання відкриє файл.</translation>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Create folder in
+</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>find_dialog</name>
     <message>
-        <location filename="../src/m-editor/find-dialog.cc" line="+58"/>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
         <source>Find &amp;what:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -276,7 +545,12 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
         <source>&amp;Replace</source>
         <translation type="unfinished"></translation>
     </message>
@@ -291,7 +565,7 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
+        <location line="+13"/>
         <source>&amp;Whole words</source>
         <translation type="unfinished"></translation>
     </message>
@@ -310,11 +584,202 @@
         <source>Search se&amp;lection</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+61"/>
+        <source>Search from end</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+117"/>
+        <source>Replace Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+47"/>
+        <source>Find Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Start in:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Enter the start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include matching directories in search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set matching name is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text to match</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Text case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set text content is case insensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Search results</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Idle.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+100"/>
+        <source>Searching...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+29"/>
+        <source>Filename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>history_dock_widget</name>
     <message>
-        <location filename="../src/history-dockwidget.cc" line="+55"/>
+        <location filename="../src/history-dock-widget.cc" line="+42"/>
+        <source>Browse and search the command history.</source>
+        <translation type="unfinished">Перегляд і пошук серед історії виконаних команд.</translation>
+    </message>
+    <message>
+        <location line="+23"/>
         <source>Doubleclick a command to transfer it to the terminal.</source>
         <translation type="unfinished">Подвійне клацання перенесе команду до командного рядку.</translation>
     </message>
@@ -329,7 +794,7 @@
         <translation type="unfinished">Історія виконаних команд</translation>
     </message>
     <message>
-        <location line="+42"/>
+        <location line="+20"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
@@ -338,250 +803,103 @@
         <source>Evaluate</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lexer_octave_gui</name>
     <message>
-        <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/>
-        <source>Default</source>
-        <translation type="unfinished">Стандартні налаштування</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Comment</source>
-        <translation type="unfinished">Коментар</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Command</source>
-        <translation type="unfinished">Команда</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Number</source>
-        <translation type="unfinished">Число</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Keyword</source>
-        <translation type="unfinished">Зарезервоване слово</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Single-quoted string</source>
-        <translation type="unfinished">Рядок в одинарних лапках</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Operator</source>
-        <translation type="unfinished">Оператор</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Identifier</source>
-        <translation type="unfinished">Ідентифікатор</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Double-quoted string</source>
-        <translation type="unfinished">Рядок у подвійних лапках</translation>
+        <location line="+1"/>
+        <source>Create script</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>main_window</name>
     <message>
-        <location filename="../src/main-window.cc" line="+135"/>
-        <source>Save Workspace</source>
-        <translation type="unfinished">Зберегти область змінних</translation>
-    </message>
-    <message>
-        <location line="+11"/>
+        <location filename="../src/main-window.cc" line="+155"/>
         <source>Load Workspace</source>
         <translation type="unfinished">Завантажити область змінних</translation>
     </message>
     <message>
-        <location line="+155"/>
-        <source>Set working direcotry</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+186"/>
-        <location line="+381"/>
+        <location line="+355"/>
+        <location line="+769"/>
         <source>About Octave</source>
         <translation type="unfinished">Про Octave</translation>
     </message>
     <message>
-        <location line="-290"/>
-        <source>View the variables in the active workspace.</source>
-        <translation type="unfinished">Перегляд змісту поточної області змінних.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse and search the command history.</source>
-        <translation type="unfinished">Перегляд і пошук серед історії виконаних команд.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Browse your files.</source>
-        <translation type="unfinished">Переглянути файли.</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>See the documentation for help.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+39"/>
+        <location line="-338"/>
         <source>&amp;File</source>
         <translation type="unfinished">&amp;Файл</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+52"/>
         <source>New</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
+        <location line="+4"/>
         <source>Script</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Function</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+2"/>
-        <source>Class</source>
+        <source>Function</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Enumeration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Figure</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
-        <source>Variable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>GUI</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="-55"/>
         <source>Open...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Close Command Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
-        <source>Import Data...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Save Workspace...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+6"/>
+        <location line="+18"/>
         <source>Preferences...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Page Setup...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Print</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
-        <source>Print Selection...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+4"/>
         <source>Exit</source>
         <translation type="unfinished">Вийти</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+51"/>
         <source>&amp;Edit</source>
         <translation type="unfinished">&amp;Правка</translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+5"/>
         <source>Undo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Redo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+5"/>
-        <source>Cut</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+7"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+5"/>
         <source>Paste</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Paste To Workspace...</source>
+        <location line="-895"/>
+        <location line="+817"/>
+        <source>Save Workspace As</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Select All</source>
+        <location line="-602"/>
+        <source>Set working directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+3"/>
-        <source>Delete</source>
+        <location line="+686"/>
+        <source>Find Files...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+6"/>
-        <source>Find...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+3"/>
-        <source>Find Files...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+7"/>
         <source>Clear Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -591,143 +909,228 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Clear Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+36"/>
         <source>De&amp;bug</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+3"/>
         <source>Step</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step in</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+3"/>
         <source>Step out</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+4"/>
         <source>Continue</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+13"/>
+        <location line="+8"/>
         <source>Exit Debug Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <source>&amp;Desktop</source>
+        <location line="+48"/>
+        <source>Show File Browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>File Browser</source>
+        <translation type="unfinished">Файловий менеджер</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Reset Default Window Layout</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+1"/>
-        <source>Load workspace</source>
+        <location line="+106"/>
+        <source>On Disk</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Enter directory name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Current Directory: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+4"/>
+        <source>One directory up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse directories</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-392"/>
+        <source>Load workspace</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+192"/>
         <source>&amp;Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+2"/>
+        <location line="+6"/>
         <source>Show Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
+        <location line="+3"/>
         <source>Show Command History</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Show Current Directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <location line="+6"/>
         <source>Show Workspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
+        <location line="+3"/>
         <source>Show Documentation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+5"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Command History</source>
         <translation type="unfinished">Історія виконаних команд</translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>Current Directory</source>
-        <translation type="unfinished">Поточний каталог</translation>
-    </message>
-    <message>
-        <location line="+4"/>
+        <location line="+6"/>
         <source>Workspace</source>
         <translation type="unfinished">Область змінних</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
         <source>Editor</source>
         <translation type="unfinished">Редактор</translation>
     </message>
     <message>
-        <location line="+4"/>
+        <location line="+3"/>
+        <location line="+108"/>
         <source>Documentation</source>
         <translation type="unfinished">Документація</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>Reset Windows</source>
+        <location line="-36"/>
+        <source>&amp;Help</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Report Bug</source>
+        <translation type="unfinished">Повідомити про помилку</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Visit Agora</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-3"/>
+        <source>Visit Octave Forge</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
+    <message>
+        <location filename="../src/octave-dock-widget.cc" line="+52"/>
+        <source>Undock widget</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+4"/>
-        <source>&amp;Help</source>
+        <location line="+9"/>
+        <source>Hide widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+82"/>
+        <source>Dock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+29"/>
+        <source>Unock widget</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+85"/>
+        <source>help</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+270"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Report Bug</source>
-        <translation type="unfinished">Повідомити про помилку</translation>
-    </message>
-    <message>
-        <location line="+2"/>
-        <source>Visit Agora</source>
+        <source>Change Directory or Add Directory to Load Path</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+2"/>
-        <source>Visit Octave Forge</source>
+        <source>Change Directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+20"/>
-        <source>Current Directory:</source>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -735,223 +1138,331 @@
     <name>settings_dialog</name>
     <message>
         <location filename="../src/settings-dialog.ui" line="+29"/>
-        <location filename="../src/ui-settings-dialog.h" line="+461"/>
         <source>Settings</source>
         <translation type="unfinished">Налаштування</translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+5"/>
         <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+18"/>
-        <location filename="../src/ui-settings-dialog.h" line="-4"/>
-        <source>Icon set for dock widget</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+97"/>
         <source>Octave logo only</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location line="+10"/>
+        <source>Letter icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Graphic  icons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+39"/>
+        <source>Editor</source>
+        <translation type="unfinished">Редактор</translation>
+    </message>
+    <message>
         <location line="+16"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Letter icons</source>
+        <source>Show white space</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Do not show white spaces used for indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Auto indentation</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+84"/>
+        <source>Characters before list with suggestions is displayed</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Match keywords</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Graphic  icons</source>
+        <source>Case sensitive</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <source>Use custom file editor</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+11"/>
-        <source>Editor</source>
-        <translation type="unfinished">Редактор</translation>
+        <location line="+10"/>
+        <source>Command  line (%f=file, %l=line):</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>Editor Styles</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+76"/>
+        <source>Use Foreground Color</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Terminal Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+46"/>
         <source>Font</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="-130"/>
-        <location line="+147"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
-        <location line="+10"/>
-        <source>Font Size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="-109"/>
-        <location filename="../src/ui-settings-dialog.h" line="-9"/>
+        <location line="-745"/>
         <source>Show line numbers</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+27"/>
         <source>Highlight current line</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+262"/>
         <source>Code completion</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-282"/>
         <source>Show complete path in window title</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Restore tabs from previous session on startup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
-        <source>Use custom file editor:</source>
-        <translation type="unfinished">Використовувати інший редактор:</translation>
-    </message>
-    <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+548"/>
         <source>emacs</source>
         <translation type="unfinished">emacs</translation>
     </message>
     <message>
-        <location line="+10"/>
-        <location filename="../src/ui-settings-dialog.h" line="+6"/>
+        <location line="+67"/>
         <source>Terminal</source>
         <translation type="unfinished">Командний рядок</translation>
     </message>
     <message>
-        <location line="+62"/>
-        <location filename="../src/ui-settings-dialog.h" line="-2"/>
+        <location line="+15"/>
         <source>Cursor type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+27"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+23"/>
         <source>Cursor blinking</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+36"/>
-        <location filename="../src/ui-settings-dialog.h" line="+8"/>
+        <location line="+102"/>
+        <source>Font size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>File Browser</source>
         <translation type="unfinished">Файловий менеджер</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-6"/>
-        <source>Show filenames</source>
-        <translation type="unfinished">Показувати назви файлів</translation>
-    </message>
-    <message>
-        <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file size</source>
         <translation type="unfinished">Показувати розмір файлів</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show file type</source>
         <translation type="unfinished">Показувати типи файлів</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show date of last modification</source>
         <translation type="unfinished">Показувати дату останньої зміни</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
         <source>Show hidden files</source>
         <translation type="unfinished">Показувати приховані файли</translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <source>Synchronize octave directory with the file browser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
         <source>Alternating row colors</source>
         <translation type="unfinished">Чергувати колір рядків</translation>
     </message>
     <message>
         <location line="+21"/>
-        <location filename="../src/ui-settings-dialog.h" line="+13"/>
+        <source>Workspace</source>
+        <translation type="unfinished">Область змінних</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+35"/>
         <source>Network</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+6"/>
-        <location filename="../src/ui-settings-dialog.h" line="-11"/>
+        <location line="+45"/>
         <source>Use proxy server</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+12"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+10"/>
         <source>Proxy Type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+3"/>
+        <location line="-33"/>
         <source>HttpProxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+5"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-1108"/>
+        <source>Icon set for dock widgets</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1099"/>
         <source>Socks5Proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+11"/>
-        <location filename="../src/ui-settings-dialog.h" line="+2"/>
+        <location line="-16"/>
         <source>Hostname:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+54"/>
         <source>Port:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="-27"/>
         <source>Username:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+17"/>
-        <location filename="../src/ui-settings-dialog.h" line="+1"/>
+        <location line="+37"/>
         <source>Password:</source>
         <translation type="unfinished">Пароль:</translation>
     </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+69"/>
+        <location line="+4"/>
+        <location line="+334"/>
+        <source>System setting</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="-137"/>
+        <source>Difference to the defalt size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>b</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>i</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>terminal_dock_widget</name>
     <message>
-        <location filename="../src/terminal-dockwidget.cc" line="+34"/>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
         <source>Command Window</source>
         <translation type="unfinished"></translation>
     </message>
@@ -959,7 +1470,7 @@
 <context>
     <name>webinfo</name>
     <message>
-        <location filename="../src/qtinfo/webinfo.cc" line="+74"/>
+        <location filename="../src/qtinfo/webinfo.cc" line="+78"/>
         <source>Type here and press &apos;Return&apos; to search</source>
         <translation type="unfinished"></translation>
     </message>
@@ -973,13 +1484,11 @@
     <name>welcome_wizard</name>
     <message>
         <location filename="../src/welcome-wizard.ui" line="+26"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+286"/>
         <source>Welcome to GNU Octave</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+13"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at &apos;~/.octave-gui&apos;. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -988,10 +1497,6 @@
         <location line="+50"/>
         <location line="+52"/>
         <location line="+52"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+2"/>
         <source>Next</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1000,34 +1505,26 @@
         <location line="+52"/>
         <location line="+52"/>
         <location line="+87"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-5"/>
-        <location line="+2"/>
-        <location line="+2"/>
-        <location line="+5"/>
         <source>Previous</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="-45"/>
-        <location filename="../src/ui-welcome-wizard.h" line="-3"/>
         <source>Welcome to Octave!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+7"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>This is the development version of Octave with the first official GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+10"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+1"/>
         <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click &apos;Finish&apos; to write a configuration file and launch Octave GUI.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location line="+48"/>
-        <location filename="../src/ui-welcome-wizard.h" line="+2"/>
         <source>Finish</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1035,32 +1532,72 @@
 <context>
     <name>workspace_model</name>
     <message>
-        <location filename="../src/workspace-model.cc" line="+42"/>
+        <location filename="../src/workspace-model.cc" line="-42"/>
         <source>Name</source>
         <translation type="unfinished">Ідентифікатор</translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Class</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Dimension</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+0"/>
+        <location line="+1"/>
         <source>Value</source>
         <translation type="unfinished">Значення</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+107"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>workspace_view</name>
     <message>
-        <location filename="../src/workspace-view.cc" line="+39"/>
+        <location filename="../src/workspace-view.cc" line="+47"/>
         <source>Workspace</source>
         <translation type="unfinished">Область змінних</translation>
     </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation type="unfinished">Перегляд змісту поточної області змінних.</translation>
+    </message>
+    <message>
+        <location line="+75"/>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 </TS>
--- a/libgui/qterminal/libqterminal/QTerminal.h
+++ b/libgui/qterminal/libqterminal/QTerminal.h
@@ -30,6 +30,8 @@
 #include <QColor>
 #include <QList>
 #include <QMenu>
+#include <QClipboard>
+#include <QApplication>
 
 class QTerminal : public QWidget
 {
@@ -45,11 +47,13 @@
 
   virtual ~QTerminal (void) { }
 
-  virtual void setTerminalFont(const QFont& font) = 0;
+  virtual void setTerminalFont (const QFont& font) = 0;
+
+  virtual void setSize (int h, int v) = 0;
 
-  virtual void setSize(int h, int v) = 0;
+  virtual void sendText (const QString& text) = 0;
 
-  virtual void sendText(const QString& text) = 0;
+  virtual QString selectedText () = 0;
 
   enum CursorType
     {
@@ -88,6 +92,11 @@
 
   virtual void handleCustomContextMenuRequested (const QPoint& at)
   {
+    QClipboard * cb = QApplication::clipboard ();
+
+    _paste_action->setEnabled (cb->text().length() > 0);
+    _copy_action->setEnabled (selectedText().length() > 0);
+    
     _contextMenu->move (mapToGlobal (at));
     _contextMenu->show ();
   }
@@ -102,10 +111,12 @@
 
     _contextMenu = new QMenu (this);
 
-    _contextMenu->addAction (QIcon (":/actions/icons/editcopy.png"),
+    _copy_action = _contextMenu->addAction (
+                             QIcon (":/actions/icons/editcopy.png"),
                              tr ("Copy"), this, SLOT (copyClipboard ()));
 
-    _contextMenu->addAction (QIcon (":/actions/icons/editpaste.png"),
+    _paste_action = _contextMenu->addAction (
+                            QIcon (":/actions/icons/editpaste.png"),
                             tr ("Paste"), this, SLOT (pasteClipboard ()));
 
     _contextMenu->addSeparator ();
@@ -132,6 +143,8 @@
 private:
 
     QMenu *_contextMenu;
+    QAction * _copy_action;
+    QAction * _paste_action;
 };
 
 #endif // QTERMINAL_H
--- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp
+++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp
@@ -201,3 +201,7 @@
     m_terminalView->pasteClipboard();
 }
 
+QString QUnixTerminalImpl::selectedText ()
+{
+  return m_terminalView->selectedText ();
+}
--- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h
+++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h
@@ -48,6 +48,8 @@
     void setSelectionColor (const QColor& color);
     void setCursorColor (bool useForegroundColor, const QColor& color);
 
+    QString selectedText();
+
 public slots:
     void copyClipboard();
     void pasteClipboard();
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp
@@ -319,6 +319,10 @@
   _gridLayout->setMargin(0);
 
   setLayout( _gridLayout );
+
+  connect (this, SIGNAL (set_global_shortcuts_signal (bool)),
+           parent->parent (), SLOT (set_global_shortcuts (bool)));
+
 }
 
 TerminalView::~TerminalView()
@@ -1058,6 +1062,8 @@
 
 void TerminalView::focusInEvent(QFocusEvent *focusEvent)
 {
+  emit set_global_shortcuts_signal (false);  // disable some shortcuts
+
   setBlinkingCursorState(true);
   updateImage();
   repaint();
@@ -1068,6 +1074,8 @@
 
 void TerminalView::focusOutEvent(QFocusEvent *focusEvent)
 {
+  emit set_global_shortcuts_signal (true);  // re-enable shortcuts
+
   // Force the cursor to be redrawn.
   _cursorBlinking = true;
   setBlinkingCursorState(false);
@@ -2260,16 +2268,13 @@
 
 void TerminalView::copyClipboard()
 {
-  if ( !_screenWindow )
+  if ( !_screenWindow || !hasFocus())
     return;
 
   QString text = _screenWindow->selectedText(_preserveLineBreaks);
 
   if (text.isEmpty ())
     {
-      // FIXME -- interrupt is only appropriate here if CTRL-C is bound
-      // to the copy action.  How can we determine that?
-
       ::raise (SIGINT);
     }
   else
@@ -2278,7 +2283,10 @@
 
 void TerminalView::pasteClipboard()
 {
-  emitSelection(false,false);
+  if(hasFocus ())
+    {
+      emitSelection(false,false);
+    }
 }
 
 void TerminalView::pasteSelection()
@@ -2698,3 +2706,9 @@
   _lineSpacing = i;
   setVTFont(font()); // Trigger an update.
 }
+
+QString TerminalView::selectedText ()
+{
+  QString text = _screenWindow->selectedText (_preserveLineBreaks);
+  return text;
+}
--- a/libgui/qterminal/libqterminal/unix/TerminalView.h
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.h
@@ -323,6 +323,8 @@
 
     void setSelection(const QString &t);
 
+    QString selectedText ();
+
     /**
      * Reimplemented.  Has no effect.  Use setVTFont() to change the font
      * used to draw characters in the display.
@@ -474,6 +476,12 @@
 
    void tripleClicked( const QString& text );
 
+   /**
+    * Emitted when focus changes
+    */
+   void set_global_shortcuts_signal (bool);
+
+
 protected:
     virtual bool event( QEvent * );
 
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp
@@ -40,7 +40,9 @@
 #include <stdio.h>
 #include <stdarg.h>
 #define WIN32_LEAN_AND_MEAN
-#define _WIN32_WINNT 0x0500 
+#if ! defined (_WIN32_WINNT) && ! defined (NTDDI_VERSION)
+#define _WIN32_WINNT 0x0500
+#endif
 #include <windows.h>
 #include <cstring>
 #include <csignal>
@@ -1162,6 +1164,8 @@
 QWinTerminalImpl::QWinTerminalImpl (QWidget* parent)
     : QTerminal (parent), d (new QConsolePrivate (this))
 {
+    connect (this, SIGNAL (set_global_shortcuts_signal (bool)),
+           parent, SLOT (set_global_shortcuts (bool)));
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -1332,6 +1336,8 @@
 
 void QWinTerminalImpl::focusInEvent (QFocusEvent* event)
 {
+  emit set_global_shortcuts_signal (false);   // disable some shortcuts
+
   setBlinkingCursorState (true);
 
   QWidget::focusInEvent (event);
@@ -1339,6 +1345,8 @@
 
 void QWinTerminalImpl::focusOutEvent (QFocusEvent* event)
 {
+  emit set_global_shortcuts_signal (true);    // re-enable shortcuts
+
   // Force the cursor to be redrawn.
   d->m_cursorBlinking = true;
 
@@ -1436,6 +1444,8 @@
 
 void QWinTerminalImpl::copyClipboard (void)
 {
+  if(!hasFocus()) return;
+
   QClipboard *clipboard = QApplication::clipboard ();
 
   QString selection = d->getSelection ();
@@ -1456,8 +1466,19 @@
 
 void QWinTerminalImpl::pasteClipboard (void)
 {
+  if(!hasFocus()) return;
+
   QString text = QApplication::clipboard()->text (QClipboard::Clipboard);
 
   if (! text.isEmpty ())
     sendText (text);
 }
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+QString QWinTerminalImpl::selectedText ()
+{
+  QString selection = d->getSelection ();
+  return selection;
+}
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h
@@ -60,6 +60,8 @@
   void setSelectionColor (const QColor& color);
   void setCursorColor (bool useForegoundColor, const QColor& color);
 
+  QString selectedText ();
+
 public slots:
   void copyClipboard (void);
   void pasteClipboard (void);
@@ -68,6 +70,7 @@
 signals:
   void terminated (void);
   void titleChanged (const QString&);
+  void set_global_shortcuts_signal (bool);
 
 protected:
   void viewPaintEvent (QConsoleView*, QPaintEvent*);
--- a/libgui/src/color-picker.cc
+++ b/libgui/src/color-picker.cc
@@ -3,7 +3,7 @@
 // by Harald Jedele, 23.03.01, GPL version 2 or any later version.
 //
 // Copyright (C) FZI Forschungszentrum Informatik Karlsruhe
-// Copyright (C) 2013 Torsten <ttl@justmail.de>
+// Copyright (C) 2013 Torsten
 //
 // This file is part of Octave.
 //
@@ -22,6 +22,8 @@
 // <http://www.gnu.org/licenses/>.
 //
 
+// Author: Torsten <ttl@justmail.de>
+
 #include "color-picker.h"
 
 // constuctor with initial color as parameter
--- a/libgui/src/color-picker.h
+++ b/libgui/src/color-picker.h
@@ -3,7 +3,7 @@
 // by Harald Jedele, 23.03.01, GPL version 2 or any later version.
 //
 // Copyright (C) FZI Forschungszentrum Informatik Karlsruhe
-// Copyright (C) 2013 Torsten <ttl@justmail.de>
+// Copyright (C) 2013 Torsten
 //
 // This file is part of Octave.
 //
@@ -22,6 +22,8 @@
 // <http://www.gnu.org/licenses/>.
 //
 
+// Author: Torsten <ttl@justmail.de>
+
 #ifndef COLORPICKER_H
 #define COLORPICKER_H
 
--- a/libgui/src/documentation-dock-widget.cc
+++ b/libgui/src/documentation-dock-widget.cc
@@ -31,9 +31,35 @@
 {
   setObjectName ("DocumentationDockWidget");
   setWindowIcon (QIcon (":/actions/icons/logo.png"));
-  setWindowTitle (tr ("Documentation"));
+  set_title (tr ("Documentation"));
   setStatusTip (tr ("See the documentation for help."));
 
   _webinfo = new webinfo (this);
   setWidget (_webinfo);
+
+  connect (p, SIGNAL(show_doc_signal(const QString &)),
+   this, SLOT(showDoc(const QString &)));
 }
+
+void
+documentation_dock_widget::copyClipboard ()
+{
+  _webinfo->copyClipboard ();
+}
+void
+documentation_dock_widget::pasteClipboard ()
+{
+  _webinfo->pasteClipboard ();
+}
+void
+documentation_dock_widget::showDoc (const QString &name)
+{
+  // show the doc pane
+  if (!isVisible ())
+    setVisible (true);
+  setFocus ();
+  raise ();
+
+  _webinfo->load_ref (name);
+
+}
--- a/libgui/src/documentation-dock-widget.h
+++ b/libgui/src/documentation-dock-widget.h
@@ -35,6 +35,11 @@
 
   documentation_dock_widget (QWidget *parent = 0);
 
+protected slots:
+  void copyClipboard ();
+  void pasteClipboard ();
+
+  void showDoc (const QString & name);
 private:
 
   webinfo *_webinfo;
--- a/libgui/src/files-dock-widget.cc
+++ b/libgui/src/files-dock-widget.cc
@@ -64,7 +64,7 @@
 {
   setObjectName ("FilesDockWidget");
   setWindowIcon (QIcon(":/actions/icons/logo.png"));
-  setWindowTitle (tr ("File Browser"));
+  set_title (tr ("File Browser"));
   setToolTip (tr ("Browse your files."));
 
   QWidget *container = new QWidget (this);
@@ -72,10 +72,10 @@
   setWidget (container);
 
   connect (this, SIGNAL (open_file (const QString&)),
-           parent (), SLOT (open_file (const QString&)));
+           main_win (), SLOT (open_file (const QString&)));
 
   connect (this, SIGNAL (displayed_directory_changed (const QString&)),
-           parent (), SLOT (set_current_working_directory (const QString&)));
+           main_win (), SLOT (set_current_working_directory (const QString&)));
 
   // Create a toolbar
   _navigation_tool_bar = new QToolBar ("", container);
@@ -108,6 +108,9 @@
   QToolButton * popdown_button = new QToolButton();
   popdown_button->setToolTip(tr ("Actions on current directory"));
   QMenu * popdown_menu = new QMenu();
+  popdown_menu->addAction (QIcon (":/actions/icons/home.png"),
+                           tr ("Show Home directory"),
+                           this, SLOT (popdownmenu_home (bool)));
   popdown_menu->addAction(_sync_browser_directory_action);
   popdown_menu->addAction(_sync_octave_directory_action);
   popdown_button->setMenu(popdown_menu);
@@ -198,7 +201,7 @@
            this, SLOT (set_current_directory (const QString &)));
 
   connect (this, SIGNAL (run_file_signal (const QFileInfo&)),
-           parent (), SLOT (run_file_in_terminal (const QFileInfo&)));
+           main_win (), SLOT (run_file_in_terminal (const QFileInfo&)));
 
   QCompleter *completer = new QCompleter (_file_system_model, this);
   _current_directory->setCompleter (completer);
@@ -502,7 +505,7 @@
       QFileInfo info = _file_system_model->fileInfo(index);
 
       if(QMessageBox::question(this, tr("Delete file/directory"), 
-                               tr("Are you sre you want to delete\n") + info.filePath(),
+                               tr("Are you sure you want to delete\n") + info.filePath(),
                                QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes) 
         {
            if(info.isDir())
@@ -631,10 +634,21 @@
 }
 
 void
+files_dock_widget::popdownmenu_home (bool)
+{
+  QString dir = qgetenv ("HOME");
+  if (dir.isEmpty())
+    dir = QDir::homePath ();
+  
+  set_current_directory (dir);
+}
+
+void
 files_dock_widget::popdownmenu_search_dir (bool)
 {
   QString dir = QFileDialog::getExistingDirectory
-    (this, tr ("Set directory of file browser"),_file_system_model->rootPath());
+    (this, tr ("Set directory of file browser"),_file_system_model->rootPath(),
+     QFileDialog::DontUseNativeDialog);
   set_current_directory (dir);
 }
 
@@ -698,3 +712,35 @@
   emit find_files_signal(dir);
 }
 
+void
+files_dock_widget::copyClipboard ()
+{
+  if (_file_tree_view->hasFocus ())
+    contextmenu_copy_selection (true);
+  if (_current_directory->hasFocus ())
+    {
+      QClipboard *clipboard = QApplication::clipboard ();
+
+      QLineEdit * edit = _current_directory->lineEdit ();
+      if (edit && edit->hasSelectedText ())
+        {
+          clipboard->setText (edit->selectedText ());
+        }
+    }
+}
+
+void
+files_dock_widget::pasteClipboard ()
+{
+  if (_current_directory->hasFocus ())
+    {
+      QClipboard *clipboard = QApplication::clipboard ();
+      QString str =  clipboard->text ();
+      QLineEdit * edit = _current_directory->lineEdit ();
+      if (edit && str.length () > 0) 
+        edit->insert (str);
+    }
+}
+
+
+
--- a/libgui/src/files-dock-widget.h
+++ b/libgui/src/files-dock-widget.h
@@ -101,6 +101,11 @@
   void popdownmenu_newdir(bool);
   void popdownmenu_search_dir (bool);
   void popdownmenu_findfiles (bool);
+  void popdownmenu_home (bool);
+
+  /* from octave_doc_widget */
+  void copyClipboard ();
+  void pasteClipboard ();
 
 signals:
 
--- a/libgui/src/find-files-dialog.cc
+++ b/libgui/src/find-files-dialog.cc
@@ -96,7 +96,8 @@
   _content_case_check->setChecked (settings->value ("findfiles/content_case", false).toBool());
   _content_case_check->setToolTip (tr ("Set text content is case insensitive"));
   
-  find_files_model * model = new find_files_model ();
+  find_files_model * model = new find_files_model (this);
+
   _file_list = new QTableView;
   _file_list->setWordWrap (false);
   _file_list->setModel (model);
@@ -105,7 +106,11 @@
   _file_list->setSelectionMode(QAbstractItemView::SingleSelection);
   _file_list->setAlternatingRowColors(true);
   _file_list->setToolTip (tr ("Search results"));
+  _file_list->setSortingEnabled (true);
   _file_list->horizontalHeader ()->restoreState (settings->value ("findfiles/column_state").toByteArray ());
+  _file_list->horizontalHeader ()->setSortIndicatorShown (true);
+  _file_list->horizontalHeader ()->setClickable (true);
+  _file_list->horizontalHeader ()->setStretchLastSection (true);
   _file_list->sortByColumn (
               settings->value ("findfiles/sort_files_by_column",0).toInt (),
               static_cast<Qt::SortOrder>(settings->value ("findfiles/sort_files_by_order",Qt::AscendingOrder).toUInt ()));
@@ -161,7 +166,6 @@
   content_layout->setColumnStretch (2,1);
   content_layout->addWidget (_content_case_check,5,1);
 
-
   QGridLayout *main_layout = new QGridLayout;
   main_layout->setSizeConstraint (QLayout::SetFixedSize);
   main_layout->addWidget (name_group, 0, 0);
@@ -205,7 +209,7 @@
     delete _dir_iterator;
 }
 
-void find_files_dialog::handle_done (int button)
+void find_files_dialog::handle_done (int)
 {
   // make sure we stopped processing 
   stop_find ();
--- a/libgui/src/find-files-model.cc
+++ b/libgui/src/find-files-model.cc
@@ -22,12 +22,60 @@
 
 #include "find-files-model.h"
 #include <QFileIconProvider>
+#include <QtAlgorithms>
+
+class find_file_less_than
+{
+public:
+  find_file_less_than (int ord)
+  {
+    _sortorder = ord;
+  }
+  QVariant getValue (const QFileInfo &f) const
+  {
+     QVariant val;
+     int col = (_sortorder > 0) ? _sortorder : -_sortorder;
+
+     switch (col-1)
+       {
+         case 0:
+           val = QVariant (f.fileName());
+           break;
+
+         case 1:
+           val = QVariant (f.absolutePath());
+           break;
+
+         default:
+            break;
+        }
+     return val;
+  }
+  bool lessThan (const QVariant &left, const QVariant &right) const
+  {
+    return left.toString ().compare (right.toString (), Qt::CaseInsensitive) < 0;
+  }
+  bool operator () (const QFileInfo &left, const QFileInfo &right) const
+  {
+     QVariant leftval = getValue(left);
+     QVariant rightval = getValue(right);
+
+     if (_sortorder > 0)
+        return lessThan(leftval, rightval);
+     else
+        return ! lessThan(leftval, rightval);
+  }
+private:
+  int _sortorder;
+};
+
 
 find_files_model::find_files_model (QObject *p)
   : QAbstractListModel(p)
 {
   _columnNames.append (tr ("Filename"));
   _columnNames.append (tr ("Directory"));
+  _sortorder = 0;
 }
 
 find_files_model::~find_files_model ()
@@ -47,11 +95,19 @@
 void 
 find_files_model::addFile (const QFileInfo &info)
 {
-  beginInsertRows(QModelIndex(), _files.size(), _files.size() );
+  beginInsertRows (QModelIndex (), _files.size (), _files.size () );
+
+  QList<QFileInfo>::Iterator it; 
+  find_file_less_than less_than(_sortorder);
 
-  _files.append(info);
+  for (it=_files.begin ();it!=_files.end ();it++)
+    {
+      if (less_than (info, *it)) break;
+    }
 
-  endInsertRows(); 
+  _files.insert (it, info);
+
+  endInsertRows (); 
 }
 
 int 
@@ -113,6 +169,27 @@
     return QVariant ();
 }
 
+void
+find_files_model::sort (int column, Qt::SortOrder order)
+{
+  if(column >= 0)
+    {
+      if (order == Qt::DescendingOrder)
+        _sortorder = -(column+1);
+      else
+        _sortorder = column+1;
+    }
+  else
+    _sortorder = 0;
+
+  if (_sortorder != 0)
+    {
+      beginResetModel ();
+      qSort (_files.begin (), _files.end (), find_file_less_than (_sortorder));
+      endResetModel ();
+    }
+}
+
 QFileInfo 
 find_files_model::fileInfo (const QModelIndex & p) const
 {
--- a/libgui/src/find-files-model.h
+++ b/libgui/src/find-files-model.h
@@ -31,6 +31,8 @@
 
 class find_files_model : public QAbstractListModel
 {
+  Q_OBJECT
+
 public:
   find_files_model(QObject *p=0);
   ~find_files_model ();
@@ -48,11 +50,14 @@
   QVariant headerData (int section, Qt::Orientation orientation,
                        int role = Qt::DisplayRole) const;
 
+  void sort (int column, Qt::SortOrder order=Qt::AscendingOrder);
+
   QFileInfo fileInfo (const QModelIndex & p) const;
   QIcon     fileIcon (const QModelIndex &p) const;
 private:
   QList<QFileInfo> _files;
   QStringList _columnNames;
+  int _sortorder;
 };
 
 #endif // find_files_model_h
--- a/libgui/src/history-dock-widget.cc
+++ b/libgui/src/history-dock-widget.cc
@@ -72,7 +72,7 @@
   QVBoxLayout *vbox_layout = new QVBoxLayout ();
 
   setWindowIcon (QIcon(":/actions/icons/logo.png"));
-  setWindowTitle (tr ("Command History"));
+  set_title (tr ("Command History"));
   setWidget (new QWidget ());
 
   vbox_layout->addWidget (_history_list_view);
@@ -169,3 +169,28 @@
 {
   _history_model->setStringList (QStringList ());
 }
+
+void
+history_dock_widget::copyClipboard ()
+{
+  if(_history_list_view->hasFocus())
+    handle_contextmenu_copy(true);
+  if(_filter_line_edit->hasFocus () && _filter_line_edit->hasSelectedText ())
+    {
+      QClipboard *clipboard = QApplication::clipboard ();
+      clipboard->setText ( _filter_line_edit->selectedText ());
+    }
+}
+
+void
+history_dock_widget::pasteClipboard ()
+{
+  if(_filter_line_edit->hasFocus ())
+  {
+     QClipboard *clipboard = QApplication::clipboard ();
+     QString str =  clipboard->text ();
+     if (str.length() > 0)
+       _filter_line_edit->insert (str);
+  } 
+}
+
--- a/libgui/src/history-dock-widget.h
+++ b/libgui/src/history-dock-widget.h
@@ -62,6 +62,9 @@
   void handle_contextmenu_create_script(bool flag);
   void ctxMenu(const QPoint &pos);
 
+  void copyClipboard ();
+  void pasteClipboard ();
+
 private:
 
   void construct ();
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..913096e66e7847161f4c20044c0125feed55f7fe
GIT binary patch
literal 5491
zc$@)q6^!bMP)<h;3K|Lk000e1NJLTq002M$002M;1^@s6s%dfF000#_Nkl<Zc%0>1
zX_Q@6mHzfQcX(r^Qk6<lnJSe8l8}Tz5{7_5hQ$zRl`x3Rkual+cG*bV2()6e8Wj~0
z+qJp@6>+JwHXQ|o$l%am41~!j31p~@WT@2ehC80K`^SCv<&9O95L~@hpRAKRynAn*
z@7v$rXP<rFBW6Zr%hGZjzD98;4Q*=#Sp`3%;U^iY9nc8?42YtDv0uP)C9Ir)k<arZ
z-eDX_^AXk(@P1pCJ_SHPLni~|Cx_^pL&zVMvh~cC(aEW;?dh@EQR#FllSx~)Wim57
z*YgUwd||M^kRRyHzc<()Y<5HAZ6LeOLhIWGQacFn0Y=oDw;X@}pvGHAz@aNZ0HB1A
zd{=<?7N@M@8IxzUpE!H|?5<gJk2a@FosRa7PGr(8u&e}x5Fio&0A>xP6+E|yT&^E`
zckjfOjqCB(KfhIc`;847cWxg1A0MNhw=r(Df#i-HKco(Ekag{_C?HEK5+3$1(Aaj-
zlxdldEI$3DBac7%baZ#mMmjSJU_gZdv{KMogIPBk3WOk#5RlS<lqMJo0|UL-u>N(t
z^x|{jn%}+h`tIFWX=2Js3)#N_I;d5|-%tSrKo~v-<|}Nza@PE@7oD^0yw2lJJOizx
zI-o)yLEwXRBd`Dw4e@M_a1lWW3DdGbLSXmqZTS6*zrwRmJoWCjE#ad!rak8Hk2j8R
zz>UXos0v8aRTCY&bJ>(>;)ai3dP(=mOU^|ynMU9`P%5ndLqh@{S(AnV%TA(q|86|@
z^w03*<G*^fuebI7B)a~az=Ht)EfgSykG{pidiVA-&;Rh!k6(BV+D4Cs=N6z<<eFuu
z!+;)+lxD_}(twpnVe8iQ_~{QH^jAN>;fE%Uy4T?!zdOv}>&I{~3dqtm2?sqFjh)p0
z&zD_)^Rz|Boq^DI5C;B`U=D}%D_cBf(@H=S@Z2*$!GAvTlb77ww12WO=Jz>%sIlKQ
z8r#SeKwwbH!TL|nJ~ng5l{em&nJ~T!o|6Z&ZV2#jgKpHA8A1ry$qd%5TaE93=bPL1
zY#aTL2~2uC#}5S~dB%tokfEzn4*vWP3s0GR$7L&SGt$Wv0<T#AuqL2CC<RnDJDJAL
zT|IdCfq&`iS#N$WiD^F?2?--mfJi!6_t}LXp7P~Se(F|fNrBLJBR{VJHXP8yK}1u7
zF~drvuy6k!Jo3QZ{XOgL&n7VSvEfJ<QUO_7k#Ml#<~hf=-1Es5U$7EVAPn3(AcyJ#
zN^5A%Fbz5Ewar@f_!*|1!rtEZ@cjqw*|%rQm}@<L@`<7DA3^~V9(G(bVMgwu%WwQ*
zwk4fL=sVRn9|Z8)^Fg4{-j+sdOA_yH-V4hzh8kzNH8WV{dCN{?>-Kl>=y&d0@9dv-
zxx<gY((HLn6_BEf=i9A+{mI2QeRkI5iQNdCTthJNJ~NL9JQ2b3L$tM~aLIYcp`$H>
zpFjON-dMLC3EOD;jLLBiM*<OGC9-&J?Tc9XgU6qi!NP0v{DU1MA|Ol4!Jsx@to`np
z7caed(FtcFa0Y==`q~J5Gq8<5^Sl6KJ6dqX1t((cm@JfHFf*Qb=5_pO?Izf^IU*8<
z|BN846rTO%!+7<Do-ZeG)IB+VsBVSXKzEV?Y*{w#=m{6jn)@LXbA4cSAdb8r|M&b5
zlR8J^s*4t5Oj`z?A7zYE3M@P4SO{YL_T}|RRFE)|S*p=B%nYd%7M=W2^lbRnP5nFe
zzX;%k+Ux2F&~T^OnLW20bJBHE2QGZSfH*fNA`nrP+~ea$z$=ekFTk{}vAFt@C1@R$
zhU<mplrdBqQV`Btx&TDLvoF2{+ZvfWRQ~<SaWFIB`$*Vn9JA!~F)uv+>(6B9>NoTJ
zaBourva~`3*!+nZ$IO}6Ho6nV!T_KTtUO05|Jv({j*r<#Ou)65pNf`j5}qGK*eeVd
zyTW<rEPx>izkFsb3{yf1Q3tSgzZp4TMi2y;(lr<3XZ-Qp_tw96W|mg`G{+B>FRCIy
z!|6`6<ge<Uc>-K#0Lm|x^ZKEzTM4|D1jqGp^if^7{;D&OO4{(e$ekJuKPKVt&RhT~
z1s-4dGNcrBBn(AFqhr%1%$R$;wR__;S0Eg>3P4!}WdgEv4JqvW=!EIrGgGNia0-Kf
z4x55)1h^J_(eZKof*H7B`B|_n6TW{y_RX5o4A&2^^o(O5CE-Uu`z?qFQpUv-K4>z6
zAV7OZ7g{H#PVMj6cLIQ?>Ih(j9m4KCf83PC2;4lBR|LQ#vUD@>rz}1SH!MFJh9Thx
z^|Ei)m>I6?<Lp!C!;}L5{^%-rzJ_T?Xk87smXJCkn85&~B`|*K%v9gjb<47};)NVP
z<Wv!$(Yq+wo?4VjkAYJd1S`J^cq72g6i{?LoOS8~T>q(aAc)`x3N$k8Rp1JahtrnK
zgERyl{Ew%QFF3GFqbcyH+SFJbB2;K?p9~|r_H-U}rT|!9CLl{I42^xKWjZD%S%q-C
z0>G*aD5~Gp@7EH+%y3*EA6t4NuD@z2m>EGBxzQn&T^J}7J)E+54opMhz6XDSe7*q7
zG@xsM)&j5XksGCuZfoft9Nd3=OhDvVQ0*}DCnd7u;W|0Et^?2W;CUW=-!Jzd2&(og
zk6qWpz+fKB&RvWfmVX3FYXo5kX1veN$QN9kxM(JByX8XIwt-x}IOJF=dyK<z9E84$
z<fyU4)Vm~0E9^1>jN)V@afD%{;1=`nN(3}|U~LbA0IugDm&@bQ3s1#$%a<YuLxiC^
zV8+AH3q==;jyVE%-g+rA85@JSd>!y+B$UZ;@-P#vfax3q==QP;FcoG9JJGH+!*z-v
z4$4xm?6v2F5Kt<z^o>`449hP)8?F~XmkObW`IQ6m1sC(?Ov6`hUyj@Fei%D<?L#tY
zLF;Nah+{!K4y|=moTUInCSdVY4&8|Wc8aWd9WfP-6s9Ru7{K@4ItvFufG`Zp`|+{k
zxNuz;pSf-smS1)@9M^+V3j9I+V@9FiVAhdSaPOC{#l+5b^bh2###TG#@^Kiz_q|9^
zrf6d-P5}VHM1~elm$cK+Duh-F%o<uZ@5~I}4-hJa&);$hF2DFp6pJ2IJVhNI)z|mZ
zrciJ(y?X-gyXPhxF?|wpxnfCiJmk2QQUEigos^o2T>v0JoM7RNl|~w@6}VKSsEw*I
z@EAM*-1+${aq;=5p-^xlxiyKvhqFh16~%<f6FczDdv3zKIo%i>EPyM<SUcvJ1b`vU
zBtULQCUFA^5T{A#4u*^fK=lo}=AmJzkj*4<&t2DI*+-WkUjqL@18+n`vFKvl*wOgL
zJvU>?N%P?OK^^!57)r*}3PM<55sU`G5FiLLggr3Ohh4jNV4%MrzVA1kSCvv|ZO!25
zxzmx$7vXyT2detvy5|R&IDQO{TQD18sH%+CNC8?akdPq39T1c>KmZXDL&9|&xVa(*
z2PG1T1X8IK5{U#X%Yu{=%nZ|%*t}&IuKD!6Fr>ugpF9iaox22%TU~2lW*CNyGPjta
zxDnv{0hH2J%j<G6gb!R-*|gT>#gq^NK@j3!zwsFQ`g3^YwYOoKav0Y^<R%el14Lv%
z2mk^QHb@c#dx&!JXf`km1Ey)hwryCJ1>3e^nkKgN?1JO^a2yXr^$QW(Ht~m-|BR<s
zt&V_!%7B7U;S=Y57;|QK!}p^pw@`HP?eF~pg`x`~C}y!to*xA0?&`!<m!4g<9(Z%z
zCj52%7GyK2hP45$b$K@MJP&Rt;0F#&AvB0!un+)=K#%~01W5sb=!HW(?<=L?I8ky`
zC=_5A1`NYM5GsUms#`PX8&YD+)?HZn^h?O3lU1+FT+hcTi|66!xzkJc5&R&;Z(e*A
zeSL$FQdWV8Qfv>$EtrL?E<LB>JYZV}k_ihy6rYq*b<<*etdxQlNf0RjqMwO8140zR
z)JFmkFd$fhpsEOn_v7Oz7=~~iuS`HK1LYhX8d9MAoX9E?BnYezM0GI3woKRw3sO`s
zedE|;NO2%X2EeS5FBC8^FaRk9l!^#wG;IqZz+jLt0rml5?Sl{z0i>)w5(<zu1RD?x
zPz~tXEm8C?Uug}^fJTi30E9t+VzF2zAYMdyUVtzN!HDh?;0R1Uk6bR-kbq**MX^`}
zgHiHgFt}vt5JW~fmQ<1*y8#hFkc5^dNNEry`|^F?W&<QbP;$F~56BFJHbAT!DxgtH
ztm2%%20t@E6jgI7SCEk#;J`hlt{Es4UF7o)3`17<e~AFch3f@X0W}t#5Y<a_Aw(H;
z6&VCT8lW%)i_}&CFbci*>vY?)O@ey?X@Rr}p+ks@n;Tg_J`bXjO=?`AbWAnt2WEzd
zzZz4zPb&?}H1P3rKNJPQ3bJB<_x%9fQzt+xU9vPvlGjz^i>JI8G!c~(AV30Af>;e|
zk?8^Af`}OPj!--EkTN5*2|+#t0Yb>;zyZkEvhnk46aYe*$VNq!*!m%BBoY>G`}@lx
zlIq-vN`N(7&o5P$qUlnQD7$MV_}VR)0bv5fU>4h1rni*|U?aPc6*fx>=LsVLp?pxO
zAkr)bl$BAkb|VE45rmZGs2*EH#Pz+3`<Q{E>tZC0EAAD7%5GLW1y)XlLQ1emK(L39
zQ|lnCy+B+L5%zB8^ctaaAR_^iRs@jhXMtLm08u$G*Y@a(PY3RiQdTKQH@WX%`f$NI
z`iwxrfHV^zl>>|RKR{5iOh9qx*F84Iy#T*Y3&VzxHiR%hqHzo;pDWD*4YMz;L4>CF
z0`$Jt0=g6=#V`hnTuwkp3nU~saQCq}_T}P^`}lwY0I=EdNA3CV2vQ(30g@(!psHY4
zrv{1&B2A^rTo<t;0BGRnhtL@1>9|p>il)BE4arP`bOA~yUt%M>K7Pc37b7y+69#Qh
z+WwxIA~^}f0Z22blod9d5d^_9O(YXGLRJ0U#e{7kn@OR)tp%x60w|@zglGYiP9<R5
zX1Qtu)TaK_=w$gYaz8|FRT@ua^e_8A0D=Kwq@ar1SjovNou01^))C-rxi?63-S}T&
z;q|MH^psX%BtS|<L^PQWEz`ut%{%b)Z&t(e{PGY9h%!9}F1z@wQf?p50FfH{2a0(1
zxmT*!5M{w|dHGs7y=Wb!yK#UGf)GVFTCc?Ghsx+5sY61@Bs4q(o_bR!I$x+HwEE?!
z+4{QgWLGA<-B(hw69Ni?qfD(%T0$U|N?_IVui)ubtE)4_lBo^DfMuBwRO_1rrJ}-1
z<qHGmcp1yktf5t@lA~35MW>m;aSad*%QRq`MwRuWeF9hj!UUTcgaaGk%gK+Dw0f!(
zRlAByOuPByO!(Rp>CWTFkai(d5rVxa9@OLojS8pnS6*dl`m2omjjunD^2UR&Ey%<<
zzEY}TouYRAAFum03$T%aQa%RvY<$g0o^*lx&Q~`#R{#K5t!tdH<B>#u<E_@{*&ts-
zXn+tl1z(wU#h?wtD1(<$*16G02~bK^5g3MH-O{@@@rnMH0Tvd>NW$q`AG+p@2gxvd
zP}AxO5bTHPS>G$<UOLUn4lWW_78DYMc0r^Yf{*trfydig1q?+%ef35+yf+NPs^A%u
zA8$zz01LuwL6F~$e31N^&P@Kfx9;w`DXZysgc3*Ia9*ok_rp;WPs)<^A(R7Rx0E8+
zzaNlN!Zgh);I%5KRZnGWL_nqV<8{7Ls$BA}twolXzhpqm47BplyYsDgbE%U);r-=n
zuQkG1r+~z~+oJ&`#{YV-(DyC7_su)f<Blt-fI#d=-y5wUpb~uChf+c9a<!6xO6yB0
z5r$#Y`>K=>FNLKA$Rq?A7<g}OKA)I-7n$id8d`ZM1pt6O|DVU2xiw!O-<rB2*)bOs
z41%-=p`$WbCHPtbDv4;Mf~rMPiGWJ~j|&^I)hoBPFKVKaJfJDc_gN+}xN8mX4#(Z0
z(lfvAuf4PB&u{7#F#nDcH2_Jm#~-!uj=h7cJ37q`=Oo%@0YMJLG9rSw4rnD2ja;EN
z4#eOA)LCCCHRP-jzrX<i4Fe<-AR~prU9VzK&~m@Z&V0~+wK@1<6%aRT;ax|ka;xv3
z&^G4OWczGzm<MSOCWSB!QC2`Dc+)h?;G4yQN(Izfzt;ETUbepPBM3tTL5M&BN+dwS
zM*pr?vCB!^AGFN>lE3E8zTvRd5nwO6tHD(g8hTc0aLrdbN2M;vjyo2_9!v^gN`@%`
zvjjROp;igaR8UDkv*1@L`Kou6p+=y95H^A^MBk2A^v<C5n_+hD-Tvw?4h(DAMg$Di
z%*9`sU=6-`N2gi1ren$phMi19vU`98DPWo<A`BCT**G55T0d^F0%Cu!1Rs`Oa0Wq$
zAXErKMxY4_Hk{lZ?C5#5f49;7HI<tF-QcA!^p6zN2o*qpAh48RX|#&MmMg~kn?65z
z%G^mU9W!7E1%tv82?W!Wks@Lxl-wZ(KU|Ad5P=TM+X%Qupco;W2$jaZ?Qdesu5EAh
zW#)Z}?T)8{-`#dlzc)Oj-wc_jepPaiJ0Y8U>((hP_Qxi5FB0id;~*)3A#|h!gJ2r6
z)D1{OV%V>URW#Nbp;9G_hh^Z3C6pEz*t-RrH?7TY^-_<yqvk#!$XEvz!vFp42ZiMz
z6(9gffDnK*poHiU`JQECye-#FA2)vCr0!#pX&nbcG9(m?m;@<NE&!JQUVYu~z=i-4
z(3+!{FN&cc5e5qVd$(fq#<k(5zT)%!=_CJ*lVew@Ri7&y6zZV}IM`;K{SDF_PBU{o
z=Z^_@T`;YqZBbX(QL=q}H<IZrq#%G5v<?B*6)!?+M-u;6DsTt`LPqt1!eAeE@7RD%
zTiz~g>M#DT&+hsWXC|%^jJ;4%-2z$zivNZR5CU9Qg8)lIC{`1Mv-^}5XUEb`Tc132
z+_<R|Cv;P5TPN()C<wy>kti=^V-}+2b5uuQt)K!AZlMqR_wB&;T|L2;y}cXWQ^^+#
z$%#*LYRsQ_<t@GSgFLi$*nc}LmpuR`ndYE4m7IMGQ~v&it>n&WPl)c(>2yanl}@J;
zX<?fdgp6K*D6QanE{aYu9CV7gzM`|I*XND>NWS6PW7Z(q{uUY5cA-KSp#n66N*0IK
z{}&Wc`dkP=5FjH}Xd%Hum;h&>ys-$KPK0i|WWQ5Fr3ownFheK>xnD_pH;iN-jN~pz
pYabYS{_%B(?RUZ>BH;g9`(N09aryT~5t9G_002ovPDHLkV1oV88883<
new file mode 100755
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2bc8d43e6508c29b4b28ea144834ee2dc231583a
GIT binary patch
literal 220
zc%17D@N?(olHy`uVBq!ia0vp^AT}ol8<6B)wpSQPF%}28J29*~C-V}>VN3FMcVYMs
zf(!O8pA1r4;1O92R4fd_j105pNB{-dOFVsD+3&K63UlddFOKU13dMN3IEF}EPMvU&
z_kaNhvu{|_U-b`u@7SZ-KXo3Ro78#2=gfo_|IocZO+*+hU+6F>bxtsGc<ZwN)ij2N
z<gI!cZ|w@1&)Z*owZ5j4+2h!sXP<6fS|=w~e7yE>?P+#nOAF>oaZ!+S89ZJ6T-G@y
GGywq3ibt~m
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..64d296b71140fb05da3077395c01be5ce287c3bb
GIT binary patch
literal 199
zc%17D@N?(olHy`uVBq!ia0vp^AT}ol8<6B)wpSQPF%}28J29*~C-V}>VN3FMcVYMs
zf(!O8pA1r4;1O92R4fd_j105pNB{-dOFVsD+3&K63bSeFm2TM#6ms`;aSV~ToNQud
z_V2s{OG1)@&<2N0H<gY5Giun_*xLRV2%n#0dHBGA0}7p|UEE~yj$|q+3#B=1ZrzaX
k<KuJUyXh`#!#lhT=8Jg`uReHa2hd0cPgg&ebxsLQ0Cs3Q`v3p{
new file mode 100755
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c594db71e2222fbd22f80832bf0797b34b4432b4
GIT binary patch
literal 210
zc%17D@N?(olHy`uVBq!ia0vp^AT}ol8<6B)wpSQPF%}28J29*~C-V}>VN3FMcVYMs
zf(!O8pA1r4;1O92R4fd_j105pNB{-dOFVsD+3&K63bP9wOU=0k6bkZmaSV~T+}nSU
z_kaNpQ~!$f>n6XkXSCiqe@m~<QLgyp2Un{3zX>(uO11C0c7934Wd@Vgsk04_l^siu
x310Q;1Vg3U=Czd}teb=GPYo2T&u0D1aK%Mp&87Ocu|U%qJYD@<);T3K0RUgJMGgP}
--- a/libgui/src/m-editor/file-editor-interface.h
+++ b/libgui/src/m-editor/file-editor-interface.h
@@ -61,8 +61,6 @@
 
   virtual void set_focus () = 0;
 
-  virtual void connect_visibility_changed (void) = 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
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -1010,6 +1010,11 @@
   else
     fileDialog = new QFileDialog (this);
 
+  // Giving trouble under KDE (problem is related to Qt signal handling on unix,
+  // see https://bugs.kde.org/show_bug.cgi?id=260719 ,
+  // it had/has no effect on Windows, though)
+  fileDialog->setOption(QFileDialog::DontUseNativeDialog, true);
+
   if (!_file_name.isEmpty () && _file_name.at (_file_name.count () - 1) != '/')
     {
       fileDialog->selectFile (_file_name);
--- a/libgui/src/m-editor/file-editor.cc
+++ b/libgui/src/m-editor/file-editor.cc
@@ -87,20 +87,6 @@
   set_focus ();
 }
 
-void
-file_editor::handle_visibility (bool visible)
-{
-  if (visible && ! isFloating ())
-    focus ();
-}
-
-void
-file_editor::connect_visibility_changed (void)
-{
-  connect (this, SIGNAL (visibilityChanged (bool)),
-           this, SLOT (handle_visibility (bool)));
-}
-
 // set focus to editor and its current tab
 void
 file_editor::set_focus (void)
@@ -190,6 +176,12 @@
   // Create a NonModal message.
   QFileDialog *fileDialog = new QFileDialog (this);
   fileDialog->setNameFilter (tr ("Octave Files (*.m);;All Files (*)"));
+
+  // Giving trouble under KDE (problem is related to Qt signal handling on unix,
+  // see https://bugs.kde.org/show_bug.cgi?id=260719 ,
+  // it had/has no effect on Windows, though)
+  fileDialog->setOption(QFileDialog::DontUseNativeDialog, true);
+
   fileDialog->setAcceptMode (QFileDialog::AcceptOpen);
   fileDialog->setViewMode (QFileDialog::Detail);
   fileDialog->setDirectory (ced);
@@ -682,6 +674,7 @@
             }
         }
     }
+    check_actions ();
 }
 
 void
@@ -752,21 +745,19 @@
   QAction *open_action = new QAction (QIcon (":/actions/icons/fileopen.png"),
                                       tr ("&Open File"), _tool_bar);
 
-  QAction *save_action = new QAction (QIcon (":/actions/icons/filesave.png"),
+  _save_action = new QAction (QIcon (":/actions/icons/filesave.png"),
                                       tr ("&Save File"), _tool_bar);
 
-  QAction *save_as_action
-    = new QAction (QIcon (":/actions/icons/filesaveas.png"),
-                   tr ("Save File &As"), _tool_bar);
+  _save_as_action = new QAction (QIcon (":/actions/icons/filesaveas.png"),
+                                tr ("Save File &As"), _tool_bar);
 
-  QAction *print_action
-    = new QAction ( QIcon (":/actions/icons/fileprint.png"),
-                    tr ("Print"), _tool_bar);
+  _print_action = new QAction ( QIcon (":/actions/icons/fileprint.png"),
+                                tr ("Print"), _tool_bar);
 
-  QAction *undo_action = new QAction (QIcon (":/actions/icons/undo.png"),
+  _undo_action = new QAction (QIcon (":/actions/icons/undo.png"),
                                       tr ("&Undo"), _tool_bar);
 
-  QAction *redo_action = new QAction (QIcon (":/actions/icons/redo.png"),
+  _redo_action = new QAction (QIcon (":/actions/icons/redo.png"),
                                       tr ("&Redo"), _tool_bar);
 
   _copy_action = new QAction (QIcon (":/actions/icons/editcopy.png"),
@@ -775,20 +766,17 @@
   _cut_action = new QAction (QIcon (":/actions/icons/editcut.png"),
                               tr ("Cu&t"), _tool_bar);
 
-  QAction *paste_action
+  _paste_action
     = new QAction (QIcon (":/actions/icons/editpaste.png"),
                    tr ("Paste"), _tool_bar);
 
-  QAction *next_bookmark_action
-    = new QAction (tr ("&Next Bookmark"), _tool_bar);
+  _next_bookmark_action = new QAction (tr ("&Next Bookmark"), _tool_bar);
+
+  _previous_bookmark_action = new QAction (tr ("Pre&vious Bookmark"), _tool_bar);
 
-  QAction *previous_bookmark_action
-    = new QAction (tr ("Pre&vious Bookmark"), _tool_bar);
+  _toggle_bookmark_action = new QAction (tr ("Toggle &Bookmark"), _tool_bar);
 
-  QAction *toggle_bookmark_action
-    = new QAction (tr ("Toggle &Bookmark"), _tool_bar);
-
-  QAction *remove_bookmark_action
+  _remove_bookmark_action
     = new QAction (tr ("&Remove All Bookmarks"), _tool_bar);
 
   QAction *next_breakpoint_action
@@ -804,19 +792,19 @@
     = new QAction (QIcon (":/actions/icons/bp_rm_all.png"),
                    tr ("&Remove All breakpoints"), _tool_bar);
 
-  QAction *comment_selection_action
+  _comment_selection_action
     = new QAction (tr ("&Comment"), _tool_bar);
 
-  QAction *uncomment_selection_action
+  _uncomment_selection_action
     = new QAction (tr ("&Uncomment"), _tool_bar);
 
-  QAction *find_action = new QAction (QIcon (":/actions/icons/search.png"),
+  _find_action = new QAction (QIcon (":/actions/icons/search.png"),
                                       tr ("&Find and Replace"), _tool_bar);
 
   _run_action = new QAction (QIcon (":/actions/icons/artsbuilderexecute.png"),
                              tr ("Save File And Run"), _tool_bar);
 
-  QAction *goto_line_action = new QAction (tr ("Go&to Line"), _tool_bar);
+  _goto_line_action = new QAction (tr ("Go&to Line"), _tool_bar);
 
   // the mru-list and an empty array of actions
   QSettings *settings = resource_manager::get_settings ();
@@ -831,46 +819,36 @@
   // some actions are disabled from the beginning
   _copy_action->setEnabled (false);
   _cut_action->setEnabled (false);
-  _run_action->setShortcut (Qt::ControlModifier+ Qt::Key_R);
+
   _run_action->setShortcutContext (Qt::WindowShortcut);
-  save_action->setShortcut (QKeySequence::Save);
-  save_action->setShortcutContext (Qt::WindowShortcut);
-  save_as_action->setShortcut (QKeySequence::SaveAs);
-  save_as_action->setShortcutContext (Qt::WindowShortcut);
+  _save_action->setShortcutContext (Qt::WindowShortcut);
+  _save_as_action->setShortcutContext (Qt::WindowShortcut);
 
-  print_action->setShortcut (QKeySequence::Print);
-  print_action->setShortcutContext (Qt::WindowShortcut);
+  _print_action->setShortcutContext (Qt::WindowShortcut);
 
-  next_bookmark_action->setShortcut (Qt::Key_F2);
-  next_bookmark_action->setShortcutContext (Qt::WindowShortcut);
-  previous_bookmark_action->setShortcut (Qt::SHIFT + Qt::Key_F2);
-  previous_bookmark_action->setShortcutContext (Qt::WindowShortcut);
-  toggle_bookmark_action->setShortcut (Qt::Key_F7);
-  toggle_bookmark_action->setShortcutContext (Qt::WindowShortcut);
-  comment_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_7);
-  comment_selection_action->setShortcutContext (Qt::WindowShortcut);
-  uncomment_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_8);
-  uncomment_selection_action->setShortcutContext (Qt::WindowShortcut);
-  find_action->setShortcut (QKeySequence::Find);
-  find_action->setShortcutContext (Qt::WindowShortcut);
-  goto_line_action->setShortcut (Qt::ControlModifier+ Qt::Key_G);
-  goto_line_action->setShortcutContext (Qt::WindowShortcut);
+  _next_bookmark_action->setShortcutContext (Qt::WindowShortcut);
+  _previous_bookmark_action->setShortcutContext (Qt::WindowShortcut);
+  _toggle_bookmark_action->setShortcutContext (Qt::WindowShortcut);
+  _comment_selection_action->setShortcutContext (Qt::WindowShortcut);
+  _uncomment_selection_action->setShortcutContext (Qt::WindowShortcut);
+  _find_action->setShortcutContext (Qt::WindowShortcut);
+  _goto_line_action->setShortcutContext (Qt::WindowShortcut);
 
   // toolbar
   _tool_bar->addAction (new_action);
   _tool_bar->addAction (open_action);
-  _tool_bar->addAction (save_action);
-  _tool_bar->addAction (save_as_action);
+  _tool_bar->addAction (_save_action);
+  _tool_bar->addAction (_save_as_action);
   _tool_bar->addSeparator ();
-  _tool_bar->addAction (print_action);
+  _tool_bar->addAction (_print_action);
   _tool_bar->addSeparator ();
-  _tool_bar->addAction (undo_action);
-  _tool_bar->addAction (redo_action);
+  _tool_bar->addAction (_undo_action);
+  _tool_bar->addAction (_redo_action);
   _tool_bar->addAction (_copy_action);
   _tool_bar->addAction (_cut_action);
-  _tool_bar->addAction (paste_action);
+  _tool_bar->addAction (_paste_action);
   _tool_bar->addSeparator ();
-  _tool_bar->addAction (find_action);
+  _tool_bar->addAction (_find_action);
   _tool_bar->addAction (_run_action);
   _tool_bar->addSeparator ();
   _tool_bar->addAction (toggle_breakpoint_action);
@@ -890,49 +868,50 @@
   fileMenu->addMenu (_mru_file_menu);
 
   fileMenu->addSeparator ();
-  fileMenu->addAction (save_action);
-  fileMenu->addAction (save_as_action);
+  fileMenu->addAction (_save_action);
+  fileMenu->addAction (_save_as_action);
 
   fileMenu->addSeparator ();
-  fileMenu->addAction (QIcon::fromTheme("window-close",
-                                      QIcon (":/actions/icons/fileclose.png")),
-                       tr ("&Close"),
-                       this, SLOT (request_close_file (bool)),
-                             QKeySequence::Close);
-  fileMenu->addAction (QIcon::fromTheme("window-close",
+  _close_action =
+      fileMenu->addAction (QIcon::fromTheme("window-close",
+                                  QIcon (":/actions/icons/fileclose.png")),
+                       tr ("&Close"), this, SLOT (request_close_file (bool)));
+  _close_all_action =
+      fileMenu->addAction (QIcon::fromTheme("window-close",
                                       QIcon (":/actions/icons/fileclose.png")),
                        tr ("Close All"),
                        this, SLOT (request_close_all_files (bool)));
+  _close_others_action = 
   fileMenu->addAction (QIcon::fromTheme("window-close",
                                       QIcon (":/actions/icons/fileclose.png")),
                        tr ("Close Other Files"),
                        this, SLOT (request_close_other_files (bool)));
 
   fileMenu->addSeparator ();
-  fileMenu->addAction (print_action);
+  fileMenu->addAction (_print_action);
 
   _menu_bar->addMenu (fileMenu);
 
 
   QMenu *editMenu = new QMenu (tr ("&Edit"), _menu_bar);
-  editMenu->addAction (undo_action);
-  editMenu->addAction (redo_action);
+  editMenu->addAction (_undo_action);
+  editMenu->addAction (_redo_action);
   editMenu->addSeparator ();
   editMenu->addAction (_copy_action);
   editMenu->addAction (_cut_action);
-  editMenu->addAction (paste_action);
+  editMenu->addAction (_paste_action);
   editMenu->addSeparator ();
-  editMenu->addAction (find_action);
+  editMenu->addAction (_find_action);
   editMenu->addSeparator ();
-  editMenu->addAction (comment_selection_action);
-  editMenu->addAction (uncomment_selection_action);
+  editMenu->addAction (_comment_selection_action);
+  editMenu->addAction (_uncomment_selection_action);
   editMenu->addSeparator ();
-  editMenu->addAction (toggle_bookmark_action);
-  editMenu->addAction (next_bookmark_action);
-  editMenu->addAction (previous_bookmark_action);
-  editMenu->addAction (remove_bookmark_action);
+  editMenu->addAction (_toggle_bookmark_action);
+  editMenu->addAction (_next_bookmark_action);
+  editMenu->addAction (_previous_bookmark_action);
+  editMenu->addAction (_remove_bookmark_action);
   editMenu->addSeparator ();
-  editMenu->addAction (goto_line_action);
+  editMenu->addAction (_goto_line_action);
   _menu_bar->addMenu (editMenu);
 
   _debug_menu = new QMenu (tr ("&Debug"), _menu_bar);
@@ -948,6 +927,10 @@
   _run_menu->addAction (_run_action);
   _menu_bar->addMenu (_run_menu);
 
+  // shortcuts
+  set_shortcuts (true);
+
+  // layout
   QVBoxLayout *vbox_layout = new QVBoxLayout ();
   vbox_layout->addWidget (_menu_bar);
   vbox_layout->addWidget (_tool_bar);
@@ -956,10 +939,11 @@
   editor_widget->setLayout (vbox_layout);
   setWidget (editor_widget);
 
-  connect (parent (), SIGNAL (new_file_signal (const QString&)),
+  // signals
+  connect (main_win (), SIGNAL (new_file_signal (const QString&)),
            this, SLOT (request_new_file (const QString&)));
 
-  connect (parent (), SIGNAL (open_file_signal (const QString&)),
+  connect (main_win (), SIGNAL (open_file_signal (const QString&)),
            this, SLOT (request_open_file (const QString&)));
 
   connect (new_action, SIGNAL (triggered ()),
@@ -968,10 +952,10 @@
   connect (open_action, SIGNAL (triggered ()),
            this, SLOT (request_open_file ()));
 
-  connect (undo_action, SIGNAL (triggered ()),
+  connect (_undo_action, SIGNAL (triggered ()),
            this, SLOT (request_undo ()));
 
-  connect (redo_action, SIGNAL (triggered ()),
+  connect (_redo_action, SIGNAL (triggered ()),
            this, SLOT (request_redo ()));
 
   connect (_copy_action, SIGNAL (triggered ()),
@@ -980,31 +964,31 @@
   connect (_cut_action, SIGNAL (triggered ()),
            this, SLOT (request_cut ()));
 
-  connect (paste_action, SIGNAL (triggered ()),
+  connect (_paste_action, SIGNAL (triggered ()),
            this, SLOT (request_paste ()));
 
-  connect (save_action, SIGNAL (triggered ()),
+  connect (_save_action, SIGNAL (triggered ()),
            this, SLOT (request_save_file ()));
 
-  connect (save_as_action, SIGNAL (triggered ()),
+  connect (_save_as_action, SIGNAL (triggered ()),
            this, SLOT (request_save_file_as ()));
 
-  connect (print_action, SIGNAL (triggered ()),
+  connect (_print_action, SIGNAL (triggered ()),
            this, SLOT (request_print_file ()));
 
   connect (_run_action, SIGNAL (triggered ()),
            this, SLOT (request_run_file ()));
 
-  connect (toggle_bookmark_action, SIGNAL (triggered ()),
+  connect (_toggle_bookmark_action, SIGNAL (triggered ()),
            this, SLOT (request_toggle_bookmark ()));
 
-  connect (next_bookmark_action, SIGNAL (triggered ()),
+  connect (_next_bookmark_action, SIGNAL (triggered ()),
            this, SLOT (request_next_bookmark ()));
 
-  connect (previous_bookmark_action, SIGNAL (triggered ()),
+  connect (_previous_bookmark_action, SIGNAL (triggered ()),
            this, SLOT (request_previous_bookmark ()));
 
-  connect (remove_bookmark_action, SIGNAL (triggered ()),
+  connect (_remove_bookmark_action, SIGNAL (triggered ()),
            this, SLOT (request_remove_bookmark ()));
 
   connect (toggle_breakpoint_action, SIGNAL (triggered ()),
@@ -1019,16 +1003,16 @@
   connect (remove_all_breakpoints_action, SIGNAL (triggered ()),
            this, SLOT (request_remove_breakpoint ()));
 
-  connect (comment_selection_action, SIGNAL (triggered ()),
+  connect (_comment_selection_action, SIGNAL (triggered ()),
            this, SLOT (request_comment_selected_text ()));
 
-  connect (uncomment_selection_action, SIGNAL (triggered ()),
+  connect (_uncomment_selection_action, SIGNAL (triggered ()),
            this, SLOT (request_uncomment_selected_text ()));
 
-  connect (find_action, SIGNAL (triggered ()),
+  connect (_find_action, SIGNAL (triggered ()),
            this, SLOT (request_find ()));
 
-  connect (goto_line_action, SIGNAL (triggered ()),
+  connect (_goto_line_action, SIGNAL (triggered ()),
            this, SLOT (request_goto_line ()));
 
   connect (_mru_file_menu, SIGNAL (triggered (QAction *)),
@@ -1044,7 +1028,7 @@
 
   resize (500, 400);
   setWindowIcon (QIcon (":/actions/icons/logo.png"));
-  setWindowTitle ("Editor");
+  set_title ("Editor");
 
   //restore previous session
   if (settings->value ("editor/restoreSession", true).toBool ())
@@ -1055,6 +1039,8 @@
       for (int n = 0; n < sessionFileNames.count (); ++n)
         request_open_file (sessionFileNames.at (n));
     }
+
+    check_actions ();
 }
 
 void
@@ -1083,10 +1069,10 @@
            this, SLOT (handle_mru_add_file (const QString&)));
 
   connect (f, SIGNAL (run_file_signal (const QFileInfo&)),
-           parent (), SLOT (run_file_in_terminal (const QFileInfo&)));
+           main_win (), SLOT (run_file_in_terminal (const QFileInfo&)));
   
   connect (f, SIGNAL (execute_command_in_terminal_signal (const QString&)),
-           parent (), SLOT (execute_command_in_terminal (const QString&)));
+           main_win (), SLOT (execute_command_in_terminal (const QString&)));
 
   // Signals from the file_editor non-trivial operations
   connect (this, SIGNAL (fetab_settings_changed (const QSettings *)),
@@ -1183,6 +1169,121 @@
            f, SLOT (do_breakpoint_marker (bool, const QWidget*, int)));
 
   _tab_widget->setCurrentWidget (f);
+
+  check_actions ();
+}
+
+void
+file_editor::copyClipboard ()
+{
+  QWidget * foc_w = focusWidget ();
+
+  if(foc_w && foc_w->inherits ("octave_qscintilla"))
+  {
+    request_copy ();
+  }
+}
+void
+file_editor::pasteClipboard ()
+{
+  QWidget * foc_w = focusWidget ();
+
+  if(foc_w && foc_w->inherits ("octave_qscintilla"))
+  {
+    request_paste ();
+  }
 }
 
+void
+file_editor::set_shortcuts (bool set)
+{
+  if (set)
+    {
+      _comment_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_7);
+      _uncomment_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_8);
+
+      _copy_action->setShortcut (QKeySequence::Copy);
+      _cut_action->setShortcut (QKeySequence::Cut);
+      _paste_action->setShortcut (QKeySequence::Paste);
+
+      _find_action->setShortcut (QKeySequence::Find);
+      _goto_line_action->setShortcut (Qt::ControlModifier+ Qt::Key_G);
+
+      _next_bookmark_action->setShortcut (Qt::Key_F2);
+      _previous_bookmark_action->setShortcut (Qt::SHIFT + Qt::Key_F2);
+      _toggle_bookmark_action->setShortcut (Qt::Key_F7);
+
+      _print_action->setShortcut (QKeySequence::Print);
+      _run_action->setShortcut (Qt::ControlModifier+ Qt::Key_R);
+
+      _save_action->setShortcut (QKeySequence::Save);
+      _save_as_action->setShortcut (QKeySequence::SaveAs);
+      _close_action->setShortcut (QKeySequence::Close);
+
+      _redo_action->setShortcut (QKeySequence::Redo);
+      _undo_action->setShortcut (QKeySequence::Undo);
+    }
+  else
+    {
+      QKeySequence no_key = QKeySequence ();
+
+      _comment_selection_action->setShortcut (no_key);
+      _uncomment_selection_action->setShortcut (no_key);
+
+      _copy_action->setShortcut (no_key);
+      _cut_action->setShortcut (no_key);
+      _paste_action->setShortcut (no_key);
+
+      _find_action->setShortcut (no_key);
+      _goto_line_action->setShortcut (no_key);
+
+      _next_bookmark_action->setShortcut (no_key);
+      _previous_bookmark_action->setShortcut (no_key);
+      _toggle_bookmark_action->setShortcut (no_key);
+
+      _print_action->setShortcut (no_key);
+      _run_action->setShortcut (no_key);
+
+      _save_action->setShortcut (no_key);
+      _save_as_action->setShortcut (no_key);
+      _close_action->setShortcut (no_key);
+
+      _redo_action->setShortcut (no_key);
+      _undo_action->setShortcut (no_key);
+    }
+}
+
+void
+file_editor::check_actions ()
+{
+  bool  have_tabs = _tab_widget->count () > 0;
+
+  _comment_selection_action->setEnabled (have_tabs);
+  _uncomment_selection_action->setEnabled (have_tabs);
+
+  _copy_action->setEnabled (have_tabs);
+  _cut_action->setEnabled (have_tabs);
+  _paste_action->setEnabled (have_tabs);
+
+  _find_action->setEnabled (have_tabs);
+  _goto_line_action->setEnabled (have_tabs);
+
+  _next_bookmark_action->setEnabled (have_tabs);
+  _previous_bookmark_action->setEnabled (have_tabs);
+  _toggle_bookmark_action->setEnabled (have_tabs);
+
+  _print_action->setEnabled (have_tabs);
+  _run_action->setEnabled (have_tabs);
+
+  _save_action->setEnabled (have_tabs);
+  _save_as_action->setEnabled (have_tabs);
+  _close_action->setEnabled (have_tabs);
+  _close_all_action->setEnabled (have_tabs);
+  _close_others_action->setEnabled (have_tabs && _tab_widget->count () > 1);
+
+  _undo_action->setEnabled (have_tabs);
+  _redo_action->setEnabled (have_tabs);
+}
+
+
 #endif
--- a/libgui/src/m-editor/file-editor.h
+++ b/libgui/src/m-editor/file-editor.h
@@ -47,8 +47,6 @@
   file_editor (QWidget *p);
   ~file_editor (void);
 
-  void connect_visibility_changed (void);
-
   void loadFile (const QString& fileName);
 
   QMenu *get_mru_menu (void) { return _mru_file_menu; }
@@ -59,6 +57,7 @@
   void handle_enter_debug_mode (void);
   void handle_exit_debug_mode (void);
 
+  void check_actions (void);
 signals:
 
   void fetab_settings_changed (const QSettings *settings);
@@ -99,7 +98,6 @@
 
 public slots:
   void focus (void);
-  void handle_visibility (bool visible);
 
   void request_new_file (const QString& commands);
   void request_new_script (const QString& commands);
@@ -155,6 +153,14 @@
   // Tells the editor to react on changed settings.
   void notice_settings (const QSettings *settings);
 
+  // Tells the ditor to dis- or enable some shortcuts
+  void set_shortcuts (bool set_shortcuts);
+
+
+protected slots:
+  void copyClipboard ();
+  void pasteClipboard ();
+
 private slots:
 
   void request_open_file (const QString& fileName, int line = -1,
@@ -177,10 +183,36 @@
   QMenuBar *_menu_bar;
   QToolBar *_tool_bar;
   QMenu *_debug_menu;
+
+  QAction *_comment_selection_action;
+  QAction *_uncomment_selection_action;
+
   QAction *_copy_action;
   QAction *_cut_action;
+  QAction *_paste_action;
+
+  QAction *_find_action;
+  QAction *_goto_line_action;
+
+  QAction *_next_bookmark_action;
+  QAction *_previous_bookmark_action;
+  QAction *_toggle_bookmark_action;
+  QAction * _remove_bookmark_action;
+
+  QAction *_print_action;
   QAction *_run_action;
+
+  QAction *_save_action;
+  QAction *_save_as_action;
+  QAction *_close_action;
+  QAction *_close_all_action;
+  QAction *_close_others_action;
+
+  QAction *_redo_action;
+  QAction *_undo_action;
+
   QTabWidget *_tab_widget;
+
   int _marker_breakpoint;
 
   enum { MaxMRUFiles = 10 };
--- a/libgui/src/m-editor/find-dialog.cc
+++ b/libgui/src/m-editor/find-dialog.cc
@@ -158,7 +158,17 @@
   _find_next_button->setDefault (true);
   _find_result_available = false;
 
-  move (p->x() + p->frameGeometry ().width (), p->y());
+  // move to dialog to side of the parent if there is room on the desktop to do so.
+  QWidget * desktop = QApplication::desktop ();
+  int xp = p->x () + p->frameGeometry ().width ();
+  int yp=  p->y ();
+  if (desktop != 0 && sizeHint ().isValid ())
+    {
+      if (xp + sizeHint ().width () > desktop->width ())
+        xp = desktop->width () - sizeHint ().width ();
+    }
+
+  move (xp, yp);
 
 }
 
--- a/libgui/src/m-editor/octave-qscintilla.cc
+++ b/libgui/src/m-editor/octave-qscintilla.cc
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2013 Torsten <ttl@justmail.de>
+Copyright (C) 2013 Torsten
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Torsten <ttl@justmail.de>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
--- a/libgui/src/m-editor/octave-qscintilla.h
+++ b/libgui/src/m-editor/octave-qscintilla.h
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2013 Torsten <ttl@justmail.de>
+Copyright (C) 2013 Torsten
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Torsten <ttl@justmail.de>
+
 #if !defined (octave_qscintilla_h)
 #define octave_qscintilla_h 1
 
--- a/libgui/src/main-window.cc
+++ b/libgui/src/main-window.cc
@@ -139,7 +139,7 @@
 main_window::handle_save_workspace_request (void)
 {
   QString file =
-    QFileDialog::getSaveFileName (this, tr ("Save Workspace As"), ".");
+    QFileDialog::getSaveFileName (this, tr ("Save Workspace As"), ".", 0, 0, QFileDialog::DontUseNativeDialog);
 
   if (! file.isEmpty ())
     octave_link::post_event (this, &main_window::save_workspace_callback,
@@ -152,7 +152,7 @@
   QString file = file_arg;
 
   if (file.isEmpty ())
-    file = QFileDialog::getOpenFileName (this, tr ("Load Workspace"), ".");
+    file = QFileDialog::getOpenFileName (this, tr ("Load Workspace"), ".", 0, 0, QFileDialog::DontUseNativeDialog);
 
   if (! file.isEmpty ())
     octave_link::post_event (this, &main_window::load_workspace_callback,
@@ -293,12 +293,11 @@
     }
 
   QString icon;
-  foreach (QObject *obj, children ())
+  foreach (octave_dock_widget *widget, dock_widget_list ())
     {
-      QString name = obj->objectName ();
-      if (obj->inherits ("QDockWidget") && ! name.isEmpty ())
-        { // if children is a dock widget with a name
-          QDockWidget *widget = qobject_cast<QDockWidget *> (obj);
+      QString name = widget->objectName ();
+      if (! name.isEmpty ())
+        { // if children has a name
           icon = widget_icon_data[icon_set_found].path; // prefix or octave-logo
           if (widget_icon_data[icon_set_found].name != "NONE")
             icon = icon + name + ".png"; // add widget name and ext.
@@ -355,7 +354,7 @@
 main_window::browse_for_directory (void)
 {
   QString dir
-    = QFileDialog::getExistingDirectory (this, tr ("Set working directory"));
+    = QFileDialog::getExistingDirectory (this, tr ("Set working directory"), 0, QFileDialog::DontUseNativeDialog);
 
   set_current_working_directory (dir);
 
@@ -543,36 +542,48 @@
 void
 main_window::set_window_layout (QSettings *settings)
 {
-  restoreState (settings->value ("MainWindow/windowState").toByteArray ());
-
-  settings->beginGroup ("DockWidgets");
+  QList<octave_dock_widget *> float_and_visible;
 
   // Restore the geometry of all dock-widgets
-  foreach (QObject *obj, children ())
+  foreach (octave_dock_widget *widget, dock_widget_list ())
     {
-      QString name = obj->objectName ();
+      QString name = widget->objectName ();
 
-      if (obj->inherits ("QDockWidget") && ! name.isEmpty ())
+      if (! name.isEmpty ())
         {
-          QDockWidget *widget = qobject_cast<QDockWidget *> (obj);
+          // If floating, make window from widget.
+          bool floating = settings->value
+              ("DockWidgets/" + name + "Floating", false).toBool ();
+          if (floating)
+            widget->make_window ();
+          else if (! widget->parent ())  // should not be floating but is
+            widget->make_widget (false); // no docking, just reparent
+
+          // restore geometry
           QVariant val = settings->value (name);
-
           widget->restoreGeometry (val.toByteArray ());
 
-          // If floating, make window from widget.
-          bool floating = settings->value (name+"Floating", false).toBool ();
-          if (floating)
-            widget->setWindowFlags (Qt::Window);
-
-          // make widget visible if desired (setWindowFlags hides widget).
-          bool visible = settings->value (name+"Visible", true).toBool ();
-          widget->setVisible (visible);
+          // make widget visible if desired
+          bool visible = settings->value
+              ("DockWidgets/" + name + "Visible", true).toBool ();
+          if (floating && visible)              // floating and visible
+            float_and_visible.append (widget);  // not show before main win
+          else
+            {
+              widget->make_widget ();
+              widget->setVisible (visible);       // not floating -> show
+            }
         }
     }
 
-  settings->endGroup ();
+  restoreState (settings->value ("MainWindow/windowState").toByteArray ());
+  restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
+  show ();  // main window is ready and can be shown (as first window)
 
-  restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
+  // show floating widgets after main win to ensure "Octave" in central menu
+  foreach (octave_dock_widget *widget, float_and_visible)
+     widget->setVisible (true);
+
 }
 
 void
@@ -586,24 +597,6 @@
     }
 
   settings->setValue ("MainWindow/geometry", saveGeometry ());
-  settings->beginGroup ("DockWidgets");
-  // saving the geometry of all widgets
-  foreach (QObject *obj, children())
-    {
-      QString name = obj->objectName ();
-      if (obj->inherits ("QDockWidget") && ! name.isEmpty ())
-        {
-          QDockWidget *widget = qobject_cast<QDockWidget *> (obj);
-          settings->setValue (name, widget->saveGeometry ());
-          bool floating = widget->isFloating ();
-          bool visible = widget->isVisible ();
-          settings->setValue (name+"Floating", floating);  // store floating state
-          settings->setValue (name+"Visible", visible);    // store visibility
-          if (floating)
-            widget->setWindowFlags (Qt::Widget); // if floating, recover the widget state such that the widget's
-        }                                       // state is correctly saved by the saveSate () below
-    }
-  settings->endGroup();
   settings->setValue ("MainWindow/windowState", saveState ());
   // write the list of recent used directories
   QStringList curr_dirs;
@@ -634,13 +627,34 @@
 void
 main_window::copyClipboard (void)
 {
-  emit copyClipboard_signal ();
+  if (_current_directory_combo_box->hasFocus ())
+    {
+      QLineEdit * edit = _current_directory_combo_box->lineEdit ();
+      if (edit && edit->hasSelectedText ())
+        {
+          QClipboard *clipboard = QApplication::clipboard ();
+          clipboard->setText (edit->selectedText ()); 
+        }
+    } 
+  else
+    emit copyClipboard_signal ();
 }
 
 void
 main_window::pasteClipboard (void)
 {
-  emit pasteClipboard_signal ();
+  if (_current_directory_combo_box->hasFocus ())
+    {
+      QLineEdit * edit = _current_directory_combo_box->lineEdit ();
+      QClipboard *clipboard = QApplication::clipboard ();
+      QString str =  clipboard->text ();
+      if (edit && str.length () > 0)
+        {
+          edit->insert (str); 
+        }
+    } 
+  else
+    emit pasteClipboard_signal ();
 }
 
 // Connect the signals emitted when the Octave thread wants to create
@@ -799,6 +813,9 @@
   connect (file_browser_window, SIGNAL (find_files_signal (const QString&)),
            this, SLOT (find_files (const QString&)));
 
+  connect (this, SIGNAL (set_widget_shortcuts_signal (bool)),
+           editor_window, SLOT (set_shortcuts (bool)));
+
   connect_uiwidget_links ();
 
   setWindowTitle ("Octave");
@@ -835,6 +852,8 @@
 
   construct_octave_qt_link ();
 
+  set_global_shortcuts (true);
+
 #ifdef HAVE_QSCINTILLA
   connect (this,
            SIGNAL (insert_debugger_pointer_signal (const QString&, int)),
@@ -907,6 +926,10 @@
   connect (_octave_qt_link, SIGNAL (exit_debugger_signal ()),
            this, SLOT (handle_exit_debugger ()));
 
+  connect (_octave_qt_link,
+           SIGNAL (show_preferences_signal (void)),
+           this, SLOT (process_settings_dialog_request ()));
+
 #ifdef HAVE_QSCINTILLA
   connect (_octave_qt_link,
            SIGNAL (edit_file_signal (const QString&)),
@@ -929,6 +952,10 @@
            this,
            SLOT (handle_update_breakpoint_marker_request (bool, const QString&, int)));
 
+  connect (_octave_qt_link,
+           SIGNAL (show_doc_signal (const QString &)),
+           this, SLOT (handle_show_doc (const QString &)));
+
   connect (_workspace_model,
            SIGNAL (rename_variable (const QString&, const QString&)),
            this,
@@ -966,6 +993,8 @@
   _open_action
     = file_menu->addAction (QIcon (":/actions/icons/fileopen.png"),
                             tr ("Open..."));
+  _open_action->setShortcutContext (Qt::ApplicationShortcut);
+
 
 #ifdef HAVE_QSCINTILLA
   file_menu->addMenu (editor_window->get_mru_menu ());
@@ -987,8 +1016,8 @@
 
   file_menu->addSeparator ();
 
-  QAction *exit_action = file_menu->addAction (tr ("Exit"));
-  exit_action->setShortcut (QKeySequence::Quit);
+  _exit_action = file_menu->addAction (tr ("Exit"));
+  _exit_action->setShortcutContext (Qt::ApplicationShortcut);
 
   connect (preferences_action, SIGNAL (triggered ()),
            this, SLOT (process_settings_dialog_request ()));
@@ -1004,7 +1033,7 @@
   connect (save_workspace_action, SIGNAL (triggered ()),
            this, SLOT (handle_save_workspace_request ()));
 
-  connect (exit_action, SIGNAL (triggered ()),
+  connect (_exit_action, SIGNAL (triggered ()),
            this, SLOT (close ()));
 }
 
@@ -1016,6 +1045,7 @@
   _new_script_action
     = new_menu->addAction (QIcon (":/actions/icons/filenew.png"),
                            tr ("Script"));
+  _new_script_action->setShortcutContext (Qt::ApplicationShortcut);
 
   QAction *new_function_action = new_menu->addAction (tr ("Function"));
   new_function_action->setEnabled (true);
@@ -1051,18 +1081,17 @@
   _copy_action
     = edit_menu->addAction (QIcon (":/actions/icons/editcopy.png"),
                             tr ("Copy"), this, SLOT (copyClipboard ()));
-  _copy_action->setShortcut (ctrl_shift + Qt::Key_C);
+  _copy_action->setShortcut (QKeySequence::Copy);
 
   _paste_action
     = edit_menu->addAction (QIcon (":/actions/icons/editpaste.png"),
                             tr ("Paste"), this, SLOT (pasteClipboard ()));
-  _paste_action->setShortcut (ctrl_shift + Qt::Key_V);
+  _paste_action->setShortcut (QKeySequence::Paste);
 
   edit_menu->addSeparator ();
 
-  QAction *find_files_action
+  _find_files_action
     = edit_menu->addAction (tr ("Find Files..."));
-  find_files_action->setShortcut (ctrl_shift + Qt::Key_F);
 
   edit_menu->addSeparator ();
 
@@ -1075,7 +1104,7 @@
   QAction *clear_workspace_action
     = edit_menu->addAction (tr ("Clear Workspace"));
 
-  connect (find_files_action, SIGNAL (triggered()),
+  connect (_find_files_action, SIGNAL (triggered()),
            this, SLOT (find_files ()));
 
   connect (clear_command_window_action, SIGNAL (triggered ()),
@@ -1571,4 +1600,42 @@
 
 }
 
+void
+main_window::set_global_shortcuts (bool set_shortcuts)
+{
+  if (set_shortcuts)
+    {
 
+      _open_action->setShortcut (QKeySequence::Open);
+      _new_script_action->setShortcut (QKeySequence::New);
+
+      _exit_action->setShortcut (QKeySequence::Quit);
+
+      _find_files_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_F);
+
+    }
+  else
+    {
+
+      QKeySequence no_key = QKeySequence ();
+
+      _open_action->setShortcut (no_key);
+      _new_script_action->setShortcut (no_key);
+
+      _exit_action->setShortcut (no_key);
+
+      _find_files_action->setShortcut (no_key);
+
+    }
+
+  emit set_widget_shortcuts_signal (set_shortcuts);
+}
+
+void
+main_window::handle_show_doc (const QString& file)
+{
+  doc_browser_window->setVisible (true);
+  emit show_doc_signal (file);
+}
+
+
--- a/libgui/src/main-window.h
+++ b/libgui/src/main-window.h
@@ -53,6 +53,7 @@
 #include "terminal-dock-widget.h"
 #include "documentation-dock-widget.h"
 #include "octave-qt-link.h"
+#include "octave-dock-widget.h"
 #include "find-files-dialog.h"
 
 /**
@@ -81,6 +82,8 @@
   void new_file_signal (const QString&);
   void open_file_signal (const QString&);
 
+  void show_doc_signal (const QString&);
+
   void insert_debugger_pointer_signal (const QString& file, int line);
   void delete_debugger_pointer_signal (const QString& file, int line);
   void update_breakpoint_marker_signal (bool insert, const QString& file,
@@ -89,6 +92,8 @@
   void copyClipboard_signal (void);
   void pasteClipboard_signal (void);
 
+  void set_widget_shortcuts_signal (bool);
+
 public slots:
   void report_status_message (const QString& statusMessage);
   void handle_save_workspace_request (void);
@@ -168,9 +173,15 @@
                                  const QString &dirname,
                                  const QString& multimode);
 
+  void handle_show_doc (const QString &file);
+
   // find files dialog 
   void find_files(const QString &startdir=QDir::currentPath());
   void find_files_finished(int);
+
+  // setting global shortcuts
+  void set_global_shortcuts (bool enable);
+
 protected:
   void closeEvent (QCloseEvent * closeEvent);
 
@@ -249,6 +260,17 @@
   documentation_dock_widget *doc_browser_window;
   file_editor_interface *editor_window;
   workspace_view *workspace_window;
+  QList<octave_dock_widget *> dock_widget_list ()
+  {
+    QList<octave_dock_widget *> list = QList<octave_dock_widget *> ();
+    list.append (static_cast<octave_dock_widget *> (command_window));
+    list.append (static_cast<octave_dock_widget *> (history_window));
+    list.append (static_cast<octave_dock_widget *> (file_browser_window));
+    list.append (static_cast<octave_dock_widget *> (doc_browser_window));
+    list.append (static_cast<octave_dock_widget *> (editor_window));
+    list.append (static_cast<octave_dock_widget *> (workspace_window));
+    return list;
+  }
 
   QToolBar *_main_tool_bar;
   QMenu *_debug_menu;
@@ -266,6 +288,9 @@
   QAction *_paste_action;
   QAction *_undo_action;
 
+  QAction *_find_files_action;
+  QAction *_exit_action;
+
   // Toolbars.
   QComboBox *_current_directory_combo_box;
   static const int current_directory_width = 300;
--- a/libgui/src/module.mk
+++ b/libgui/src/module.mk
@@ -39,6 +39,7 @@
   src/icons/graphic_logo_TerminalDockWidget.png \
   src/icons/graphic_logo_WorkspaceView.png \
   src/icons/help_index.png \
+  src/icons/home.png \
   src/icons/icons_license \
   src/icons/jabber_protocol.png \
   src/icons/letter_logo_DocumentationDockWidget.png \
@@ -59,6 +60,9 @@
   src/icons/terminal.png \
   src/icons/undo.png \
   src/icons/up.png \
+  src/icons/widget-close.png \
+  src/icons/widget-dock.png \
+  src/icons/widget-undock.png \
   src/icons/zoom-in.png \
   src/icons/zoom-out.png
 
@@ -87,6 +91,7 @@
   src/moc-workspace-model.cc \
   src/moc-workspace-view.cc \
   src/moc-find-files-dialog.cc \
+  src/moc-find-files-model.cc \
   src/qtinfo/moc-parser.cc \
   src/qtinfo/moc-webinfo.cc \
   src/moc-octave-dock-widget.cc
@@ -138,6 +143,7 @@
   src/m-editor/find-dialog.cc \
   src/m-editor/octave-qscintilla.cc \
   src/main-window.cc \
+  src/octave-dock-widget.cc \
   src/octave-gui.cc \
   src/octave-main-thread.cc \
   src/octave-qt-link.cc \
@@ -171,8 +177,7 @@
   -I$(top_srcdir)/liboctave/util \
   -I$(top_builddir)/libinterp -I$(top_srcdir)/libinterp \
   -I$(top_builddir)/libinterp/parse-tree -I$(top_srcdir)/libinterp/parse-tree \
-  -I$(top_builddir)/libinterp/interp-core -I$(top_srcdir)/libinterp/interp-core \
-  -I$(top_builddir)/libinterp/interpfcn -I$(top_srcdir)/libinterp/interpfcn \
+  -I$(top_builddir)/libinterp/corefcn -I$(top_srcdir)/libinterp/corefcn \
   -I$(top_srcdir)/libinterp/octave-value
 
 src_libgui_src_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)
new file mode 100644
--- /dev/null
+++ b/libgui/src/octave-dock-widget.cc
@@ -0,0 +1,212 @@
+/*
+
+Copyright (C) 2012-2013 Richard Crozier
+Copyright (C) 2013 Torsten <ttl@justmail.de>
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#include <QApplication>
+#include <QToolBar>
+#include <QToolButton>
+#include <QAction>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QSettings>
+
+#include "resource-manager.h"
+#include "octave-dock-widget.h"
+
+
+octave_dock_widget::octave_dock_widget (QWidget *p)
+    : QDockWidget (p)
+{
+
+  _parent = static_cast<QMainWindow *> (p);     // store main window
+  setFeatures (QDockWidget::DockWidgetMovable); // not floatable or cloasable
+
+  connect (this, SIGNAL (visibilityChanged (bool)),
+           this, SLOT (handle_visibility_changed (bool)));
+
+  connect (p, SIGNAL (settings_changed (const QSettings*)),
+           this, SLOT (notice_settings (const QSettings*)));
+
+  // the custom (extra) title bar of the widget
+  _dock_action = new QAction
+                   (QIcon (":/actions/icons/widget-undock.png"), "", this);
+  _dock_action-> setToolTip (tr ("Undock widget"));
+  connect (_dock_action, SIGNAL (triggered (bool)),
+           this, SLOT (change_floating (bool)));
+  QToolButton *dock_button = new QToolButton (this);
+  dock_button->setDefaultAction (_dock_action);
+  dock_button->setFocusPolicy(Qt::NoFocus);
+  dock_button->setIconSize(QSize(12,12));
+
+  QAction *close_action = new QAction
+                   (QIcon (":/actions/icons/widget-close.png"), "", this );
+  close_action-> setToolTip (tr ("Hide widget"));
+  connect (close_action, SIGNAL (triggered (bool)),
+           this, SLOT (change_visibility (bool)));
+  QToolButton *close_button = new QToolButton (this);
+  close_button->setDefaultAction (close_action);
+  close_button->setFocusPolicy(Qt::NoFocus);
+  close_button->setIconSize(QSize(12,12));
+
+  QHBoxLayout *h_layout = new QHBoxLayout ();
+  h_layout->addStretch (100);
+  h_layout->addWidget (dock_button);
+  h_layout->addWidget (close_button);
+  h_layout->setSpacing (0);
+  h_layout->setContentsMargins (6,0,0,0);
+
+  QWidget *title_widget = new QWidget ();
+  title_widget->setLayout (h_layout);
+  setTitleBarWidget (title_widget);
+
+  // copy & paste handling
+  connect (p, SIGNAL (copyClipboard_signal ()), this, SLOT (copyClipboard ()));
+  connect (p, SIGNAL (pasteClipboard_signal()), this, SLOT (pasteClipboard ()));
+}
+
+octave_dock_widget::~octave_dock_widget ()
+{
+  // save state of this dock-widget
+  bool floating = false;
+  bool visible;
+  QString name = objectName ();
+  QSettings *settings = resource_manager::get_settings ();
+
+  settings->beginGroup ("DockWidgets");
+
+  if (!parent ())
+    { // widget is floating, save actual floating geometry
+      floating = true;
+      settings->setValue (name+"_floating_geometry", saveGeometry ());
+    }
+  else  // not floating save docked (normal) geometry
+    settings->setValue (name, saveGeometry ());
+
+  visible = isVisible ();
+  settings->setValue (name+"Floating", floating);  // store floating state
+  settings->setValue (name+"Visible", visible);    // store visibility
+
+  settings->endGroup ();
+  settings->sync ();
+}
+
+// connect signal visibility changed to related slot (called from main-window)
+void
+octave_dock_widget::connect_visibility_changed (void)
+{
+  connect (this, SIGNAL (visibilityChanged (bool)),
+           this, SLOT (handle_visibility (bool)));
+  emit active_changed (isVisible ());  // emit once for init of window menu
+}
+
+
+// set the title in the dockwidgets title bar
+void
+octave_dock_widget::set_title (const QString& title)
+{
+  QHBoxLayout* h_layout =
+      static_cast<QHBoxLayout *> (titleBarWidget ()->layout ());
+  QLabel *label = new QLabel (title);
+  h_layout->insertWidget (0,label);
+  setWindowTitle (title);
+}
+
+// make the widget floating
+void
+octave_dock_widget::make_window ()
+{
+  QSettings *settings = resource_manager::get_settings ();
+
+  // save the docking area for later redocking
+  // FIXME: dockWidgetArea always returns 2
+  settings->setValue ("DockWidgets/" + objectName () + "_dock_area",
+                      _parent->dockWidgetArea (this));
+  settings->sync ();
+
+  // remove parent and adjust the (un)dock icon
+  setParent (0, Qt::Window);
+  _dock_action->setIcon (QIcon (":/actions/icons/widget-dock.png"));
+  _dock_action->setToolTip (tr ("Dock widget"));
+
+  // restore the last geometry when floating
+  restoreGeometry (settings->value
+          ("DockWidgets/" + objectName ()+"_floating_geometry").toByteArray ());
+}
+
+// dock the widget
+void
+octave_dock_widget::make_widget (bool dock)
+{
+  QSettings *settings = resource_manager::get_settings ();
+
+  // save last floating geometry
+  settings->setValue ("DockWidgets/" + objectName () + "_floating_geometry",
+                      saveGeometry ());
+  settings->sync ();
+
+  if (dock)
+    { // add widget to last saved docking area (dock=true is default)
+      int area = settings->value ("DockWidgets/" + objectName () + "_dock_area",
+                                   Qt::TopDockWidgetArea).toInt ();
+      _parent->addDockWidget (static_cast<Qt::DockWidgetArea> (area), this);
+
+      // FIXME: restoreGeometry is ignored for docked widgets and its child widget
+      // restoreGeometry (settings->value
+      //        ("DockWidgets/" + objectName ()).toByteArray ());
+    }
+  else  // only reparent, no docking
+    setParent (_parent);
+
+  // adjust the (un)dock icon
+  _dock_action->setIcon (QIcon (":/actions/icons/widget-undock.png"));
+  _dock_action->setToolTip (tr ("Undock widget"));
+}
+
+// slot for (un)dock action
+void
+octave_dock_widget::change_floating (bool)
+{
+  if (parent())
+    {
+      make_window ();
+      focus ();
+    }
+  else
+    make_widget ();
+}
+
+// slot for hiding the widget
+void
+octave_dock_widget::change_visibility (bool)
+{
+  setVisible (false);
+  emit active_changed (false);
+}
+
+// get focus widget
+QWidget *
+octave_dock_widget::focusWidget ()
+{
+    QWidget * w = QApplication::focusWidget ();
+    if(w && w->focusProxy ()) w = w->focusProxy ();
+    return w;
+}
--- a/libgui/src/octave-dock-widget.h
+++ b/libgui/src/octave-dock-widget.h
@@ -25,6 +25,9 @@
 
 #include <QDockWidget>
 #include <QSettings>
+#include <QIcon>
+#include <QMainWindow>
+#include <QMouseEvent>
 
 class octave_dock_widget : public QDockWidget
 {
@@ -32,27 +35,13 @@
 
 public:
 
-  octave_dock_widget (QWidget *p)
-    : QDockWidget (p)
-  {
-    connect (this, SIGNAL (visibilityChanged (bool)),
-             this, SLOT (handle_visibility_changed (bool)));
-
-    connect (this, SIGNAL (topLevelChanged (bool)),
-             this, SLOT (top_level_changed (bool)));
+  octave_dock_widget (QWidget *p = 0);
+  virtual ~octave_dock_widget ();
 
-    connect (p, SIGNAL (settings_changed (const QSettings*)),
-             this, SLOT (notice_settings (const QSettings*)));
-  }
-
-  virtual ~octave_dock_widget () { }
-
-  virtual void connect_visibility_changed (void)
-  {
-    connect (this, SIGNAL (visibilityChanged (bool)),
-             this, SLOT (handle_visibility (bool)));
-  }
-
+  virtual void connect_visibility_changed (void);
+  void make_window (void);
+  void make_widget (bool dock=true);
+  void set_title (const QString&);
 
 signals:
 
@@ -69,6 +58,8 @@
     QDockWidget::closeEvent (e);
   }
 
+  QWidget * focusWidget();
+
 public slots:
 
   virtual void focus (void)
@@ -91,6 +82,8 @@
   {
   }
 
+  QMainWindow *main_win () { return _parent; }
+
 protected slots:
 
   /** Slot to steer changing visibility from outside. */
@@ -99,18 +92,24 @@
     if (visible)
       emit active_changed (true);
   }
-
-  /** Slot when floating property changes */
-  virtual void top_level_changed (bool floating)
+  /** slots to handle copy & paste */
+  virtual void copyClipboard ()
+  {
+  }
+  virtual void pasteClipboard ()
   {
-    if (floating)
-      {
-        // Make a window from the widget when floating and make it
-        // visible again since setWindowFlags hides it.
-        setWindowFlags (Qt::Window);
-        show();
-      }
   }
+
+private slots:
+
+  void change_floating (bool);
+  void change_visibility (bool);
+
+private:
+
+  QMainWindow *_parent;  // store the parent since we are reparenting to 0
+  QAction *_dock_action;
+
 };
 
 #endif
--- a/libgui/src/octave-gui.cc
+++ b/libgui/src/octave-gui.cc
@@ -105,10 +105,11 @@
       else
         {
           // install translators for the gui and qt text
-          QTranslator gui_translator, qt_translator;
-          resource_manager::config_translators (&gui_translator,&qt_translator);
-          application.installTranslator (&qt_translator);
-          application.installTranslator (&gui_translator);
+          QTranslator gui_tr, qt_tr, qsci_tr;
+          resource_manager::config_translators (&qt_tr,&qsci_tr,&gui_tr);
+          application.installTranslator (&qt_tr);
+          application.installTranslator (&qsci_tr);
+          application.installTranslator (&gui_tr);
 
           // update network-settings
           resource_manager::update_network_settings ();
@@ -126,9 +127,7 @@
 
           // create main window, read settings, and show window
           main_window w;
-          w.read_settings ();  // get widget settings after construction
-                               // but before showing
-          w.show ();
+          w.read_settings ();  // get widget settings and window layout
           w.focus_command_window ();
           w.connect_visibility_changed (); // connect signals for changes in
                                            // visibility not before w is shown
--- a/libgui/src/octave-qt-link.cc
+++ b/libgui/src/octave-qt-link.cc
@@ -491,3 +491,17 @@
 
   return ok;
 }
+
+void
+octave_qt_link::do_show_preferences ()
+{
+  emit show_preferences_signal ();
+}
+
+void
+octave_qt_link::do_show_doc (const std::string& file)
+{
+  emit show_doc_signal (QString::fromStdString (file));
+}
+
+
--- a/libgui/src/octave-qt-link.h
+++ b/libgui/src/octave-qt-link.h
@@ -121,6 +121,9 @@
 
   static bool file_in_path (const std::string& file, const std::string& dir);
 
+  void do_show_preferences (void);
+
+  void do_show_doc (const std::string& file);
 private:
 
   // No copying!
@@ -166,6 +169,10 @@
 
   void insert_debugger_pointer_signal (const QString&, int);
   void delete_debugger_pointer_signal (const QString&, int);
+
+  void show_preferences_signal (void);
+
+  void show_doc_signal (const QString &file);
 };
 
 #endif
--- a/libgui/src/qtinfo/parser.cc
+++ b/libgui/src/qtinfo/parser.cc
@@ -1,21 +1,28 @@
-/* Copyright (C) 2009 P.L. Lucas
- * Copyright (C) 2012 Jacob Dawid <jacob.dawid@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- */
+/*
+
+Copyright (C) 2009 P. L. Lucas
+Copyright (C) 2012 Jacob Dawid
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+// Author: P. L. Lucas
+// Author: Jacob Dawid <jacob.dawid@gmail.com>
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -172,9 +179,29 @@
 parser::get_next_node (QIODevice *io)
 {
   QString text;
+  QByteArray line, line_buffer;
+  char c;
+  int i;
+
   while (!io->atEnd ())
     {
-      QByteArray line = io->readLine ();
+      io->getChar (&c);
+      if (c)
+        { // first char is not equal 0
+          io->ungetChar (c);
+          line = io->readLine ();
+        }
+      else
+        { // 0 was read -> image -> text length changes
+          line_buffer = io->readLine ();  // image tag that is not needed
+          line = io->readLine ();         // firsts line of text message
+          for (i=1; i<line_buffer.size ()+6; i++)  // correct the size
+            line.insert (line.size ()-1,QByteArray(" "));   // by adding blanks
+        }
+
+      if (line.at (0) == '"' && line.size () == 5)  // end of image construct
+        line = " ";
+
       if (line.at(0) == 31)
         {
           break;
@@ -334,7 +361,9 @@
       info_to_html (text1);
       info_to_html (text2);
 
-      text = text1 + "<a name='" + anchor + "' /><img src=':/actions/icons/stop.png'>" + text2;
+      text = text1 + "<a name='" + anchor
+                   + "'/><img src=':/actions/icons/redled.png'><br>&nbsp;"
+                   + text2;
     }
   else
     {
@@ -364,7 +393,9 @@
   text.append (navigationLinks);
   text.prepend ("<html><body>\n");
   text.append ("</body></html>\n");
+
   return text;
+
 }
 
 void
@@ -585,3 +616,24 @@
   results.append ("</body></html>");
   return results;
 }
+
+QString 
+parser::find_ref (const QString &ref_name)
+{
+  QString text = "";
+
+  QHash<QString,node_position>::iterator it;
+  for (it=_ref_map.begin ();it!=_ref_map.end ();++it)
+    {
+      QString k = it.key ();
+      node_position p = it.value ();
+
+      if (k == "XREF" + ref_name)
+        {
+          // found ref, so return its name
+          text = "XREF" + ref_name;
+        }
+    }
+  return text;
+}
+
--- a/libgui/src/qtinfo/parser.h
+++ b/libgui/src/qtinfo/parser.h
@@ -1,21 +1,28 @@
-/* Copyright (C) 2009 P.L. Lucas
- * Copyright (C) 2012 Jacob Dawid <jacob.dawid@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- */
+/*
+
+Copyright (C) 2009 P.L. Lucas
+Copyright (C) 2012 Jacob Dawid
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+// Author: P. L. Lucas
+// Author: Jacob Dawid <jacob.dawid@gmail.com>
 
 #include <QStringList>
 #include <QIODevice>
@@ -50,6 +57,8 @@
   QString search_node (const QString& node);
   QString global_search (const QString& text, int maxFounds);
 
+  QString find_ref (const QString &name);
+
   /** Checks if this node is reference. If node is reference, it will be returned its position
     * in text, else  it will be returned -1.
     */
--- a/libgui/src/qtinfo/webinfo.cc
+++ b/libgui/src/qtinfo/webinfo.cc
@@ -1,21 +1,28 @@
-/* Copyright (C) 2009 P.L. Lucas
- * Copyright (C) 2012 Jacob Dawid <jacob.dawid@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- */
+/*
+
+Copyright (C) 2009 P. L. Lucas
+Copyright (C) 2012 Jacob Dawid
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+// Author: P. L. Lucas
+// Author: Jacob Dawid <jacob.dawid@gmail.com>
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -24,6 +31,8 @@
 #include "webinfo.h"
 #include <QVBoxLayout>
 #include <QHBoxLayout>
+#include <QApplication>
+#include <QClipboard>
 
 #include "file-ops.h"
 #include "help.h"
@@ -84,6 +93,7 @@
   resize (500, 300);
 
   set_info_path (QString::fromStdString (Vinfo_file));
+
 }
 
 void
@@ -181,6 +191,24 @@
 }
 
 void
+webinfo::load_ref (const QString &ref_name)
+{
+  QString text = _parser.find_ref (ref_name);
+  if (text.length () > 0)
+    {
+      load_node (text);
+    }
+  else
+    {
+      // not found
+     load_node("Top");
+    }
+
+   if (_text_browser)
+     _text_browser->setFocus(); 
+}
+
+void
 webinfo::search ()
 {
   if (_search_check_box->isChecked ())
@@ -211,3 +239,30 @@
   _text_browser->setFont (_font_web);
 }
 
+void
+webinfo::copyClipboard ()
+{
+  if (_search_line_edit->hasFocus () && _search_line_edit->hasSelectedText ())
+    {
+      QClipboard *clipboard = QApplication::clipboard ();
+
+      clipboard->setText (_search_line_edit->selectedText ());
+    }
+  if (_text_browser->hasFocus ())
+    {
+      _text_browser->copy ();
+    }
+}
+
+void
+webinfo::pasteClipboard ()
+{
+  if (_search_line_edit->hasFocus ())
+    {
+      QClipboard *clipboard = QApplication::clipboard ();
+      QString str =  clipboard->text ();
+      if (str.length () > 0) 
+        _search_line_edit->insert (str);
+    }
+}
+
--- a/libgui/src/qtinfo/webinfo.h
+++ b/libgui/src/qtinfo/webinfo.h
@@ -1,21 +1,28 @@
-/* Copyright (C) 2009 P.L. Lucas
- * Copyright (C) 2012 Jacob Dawid <jacob.dawid@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- */
+/*
+
+Copyright (C) 2009 P. L. Lucas
+Copyright (C) 2012 Jacob Dawid
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+// Author: P. L. Lucas
+// Author: 2012 Jacob Dawid <jacob.dawid@gmail.com>
 
 #include <QTextBrowser>
 #include "parser.h"
@@ -33,6 +40,8 @@
   webinfo (QWidget *parent = 0);
   void set_info_path (const QString& info_path);
   void load_node (const QString& node_name);
+ 
+  void load_ref (const QString &ref_name); 
 
 public slots:
   void link_clicked (const QUrl& link);
@@ -42,6 +51,9 @@
   void zoom_in ();
   void zoom_out ();
 
+  void copyClipboard ();
+  void pasteClipboard ();
+
 private:
   QTextBrowser        *_text_browser;
   QTabBar             *_tab_bar;
--- a/libgui/src/resource-manager.cc
+++ b/libgui/src/resource-manager.cc
@@ -83,17 +83,31 @@
 }
 
 void
-resource_manager::config_translators (QTranslator *qt_tr,QTranslator *gui_tr)
+resource_manager::config_translators (QTranslator *qt_tr,
+                                      QTranslator *qsci_tr,
+                                      QTranslator *gui_tr)
 {
+  bool loaded;
+
+  QString qt_trans_dir = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
   QSettings *settings = resource_manager::get_settings ();
   // FIXME -- what should happen if settings is 0?
+
   // get the locale from the settings
   QString language = settings->value ("language","SYSTEM").toString ();
   if (language == "SYSTEM")
       language = QLocale::system().name();    // get system wide locale
+
   // load the translator file for qt strings
-  qt_tr->load("qt_" + language,
-              QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+  loaded = qt_tr->load("qt_" + language, qt_trans_dir);
+  if (!loaded) // try lower case
+    qt_tr->load("qt_" + language.toLower (), qt_trans_dir);
+
+  // load the translator file for qscintilla settings
+  loaded = qsci_tr->load("qscintilla_" + language, qt_trans_dir);
+  if (!loaded) // try lower case
+    qsci_tr->load("qscintilla_" + language.toLower (), qt_trans_dir);
+
   // load the translator file for gui strings
   gui_tr->load (language, get_gui_translation_dir ());
 }
@@ -649,7 +663,6 @@
       "dec2bin "
       "dec2hex "
       "deconv "
-      "default_save_options "
       "del2 "
       "delaunay "
       "delaunay3 "
@@ -681,6 +694,7 @@
       "do_braindead_shortcircuit_evaluation "
       "do_string_escapes "
       "doc "
+      "doc_cache_create "
       "doc_cache_file "
       "dos "
       "dot "
@@ -851,7 +865,6 @@
       "gcd "
       "gcf "
       "ge "
-      "gen_doc_cache "
       "genpath "
       "genvarname "
       "geocdf "
@@ -920,6 +933,7 @@
       "history "
       "history_control "
       "history_file "
+      "history_save "
       "history_size "
       "history_timestamp_format_string "
       "hold "
@@ -1375,8 +1389,9 @@
       "rcond "
       "rdivide "
       "re_read_readline_init_file "
-      "read_readline_init_file "
       "readdir "
+      "readline_re_read_init_file "
+      "readline_read_init_file "
       "readlink "
       "real "
       "reallog "
@@ -1434,6 +1449,7 @@
       "runlength "
       "runtests "
       "save "
+      "save_default_options "
       "save_header_format_string "
       "save_precision "
       "saveas "
@@ -1441,7 +1457,6 @@
       "saveimage "
       "saveobj "
       "savepath "
-      "saving_history "
       "scanf "
       "scatter "
       "scatter3 "
--- a/libgui/src/resource-manager.h
+++ b/libgui/src/resource-manager.h
@@ -68,7 +68,7 @@
 
   static QString get_gui_translation_dir (void);
 
-  static void config_translators (QTranslator*, QTranslator*);
+  static void config_translators (QTranslator*, QTranslator*, QTranslator*);
 
   static void update_network_settings (void)
   {
--- a/libgui/src/resource.qrc
+++ b/libgui/src/resource.qrc
@@ -11,6 +11,7 @@
         <file>icons/filesave.png</file>
         <file>icons/fileprint.png</file>
         <file>icons/folder_new.png</file>
+        <file>icons/home.png</file>
         <file>icons/ok.png</file>
         <file>icons/redo.png</file>
         <file>icons/reload.png</file>
@@ -55,5 +56,8 @@
         <file>icons/graphic_logo_HistoryDockWidget.png</file>
         <file>icons/graphic_logo_WorkspaceView.png</file>
         <file>icons/graphic_logo_DocumentationDockWidget.png</file>
+        <file>icons/widget-close.png</file>
+        <file>icons/widget-dock.png</file>
+        <file>icons/widget-undock.png</file>
     </qresource>
 </RCC>
--- a/libgui/src/settings-dialog.cc
+++ b/libgui/src/settings-dialog.cc
@@ -136,9 +136,9 @@
   QStringList items;
   items << QString("0") << QString("1") << QString("2");
   ui->terminal_cursorType->addItems(items);
-  ui->terminal_cursorType->setItemText (0, "IBeam Cursor");
-  ui->terminal_cursorType->setItemText (1, "Block Cursor");
-  ui->terminal_cursorType->setItemText (2, "Underline Cursor");
+  ui->terminal_cursorType->setItemText (0, tr ("IBeam Cursor"));
+  ui->terminal_cursorType->setItemText (1, tr ("Block Cursor"));
+  ui->terminal_cursorType->setItemText (2, tr ("Underline Cursor"));
 
   if (cursorType == "ibeam")
     ui->terminal_cursorType->setCurrentIndex (0);
@@ -267,7 +267,7 @@
             select_font[i]->setEditText (lexer->description (0));
           font_size[i]->setRange (-4,4);
           font_size[i]->setValue (actual_font.pointSize ()-default_size);
-          font_size[i]->setToolTip (tr ("Difference to the defalt size"));
+          font_size[i]->setToolTip (tr ("Difference to the default size"));
           if (lexer->paper (styles[i]) == default_color)
             bg_color[i] = new color_picker (dummy_color);
           else
--- a/libgui/src/settings-dialog.ui
+++ b/libgui/src/settings-dialog.ui
@@ -153,7 +153,7 @@
             <item>
              <widget class="QRadioButton" name="general_icon_graphic">
               <property name="text">
-               <string>Graphic  icons</string>
+               <string>Graphic icons</string>
               </property>
              </widget>
             </item>
@@ -919,7 +919,6 @@
           <property name="title">
            <string>Terminal Colors</string>
           </property>
-          <zorder>verticalSpacer_3</zorder>
          </widget>
         </item>
         <item>
--- a/libgui/src/terminal-dock-widget.cc
+++ b/libgui/src/terminal-dock-widget.cc
@@ -35,7 +35,7 @@
 
   setObjectName ("TerminalDockWidget");
   setWindowIcon (QIcon(":/actions/icons/logo.png"));
-  setWindowTitle (tr ("Command Window"));
+  set_title (tr ("Command Window"));
 
   setWidget (terminal);
 }
--- a/libgui/src/workspace-view.cc
+++ b/libgui/src/workspace-view.cc
@@ -44,7 +44,7 @@
 {
   setObjectName ("WorkspaceView");
   setWindowIcon (QIcon (":/actions/icons/logo.png"));
-  setWindowTitle (tr ("Workspace"));
+  set_title (tr ("Workspace"));
   setStatusTip (tr ("View the variables in the active workspace."));
 
   view->setWordWrap (false);
@@ -266,3 +266,11 @@
     }
   setToolTip (tool_tip);
 }
+
+void
+workspace_view::copyClipboard ()
+{
+  if (view->hasFocus ())
+    handle_contextmenu_copy ();
+}
+
--- a/libgui/src/workspace-view.h
+++ b/libgui/src/workspace-view.h
@@ -69,6 +69,8 @@
 
   void handle_model_changed (void);
 
+  void copyClipboard();
+
 private:
 
   void relay_contextmenu_command (const QString& cmdname);
--- a/libinterp/Makefile.am
+++ b/libinterp/Makefile.am
@@ -33,9 +33,7 @@
   -I$(srcdir)/octave-value \
   -I$(srcdir)/operators \
   -Iparse-tree -I$(srcdir)/parse-tree \
-  -Iinterp-core -I$(srcdir)/interp-core \
-  -Iinterpfcn -I$(srcdir)/interpfcn \
-  -Icorefcn \
+  -Icorefcn -I$(srcdir)/corefcn \
   -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu
 
 AM_CFLAGS += $(WARN_CFLAGS)
@@ -48,11 +46,11 @@
 ## $(DEF_FILES), and building those requires all the sources
 ## (except builtins.cc) to be available.
 BUILT_SOURCES = \
-  interp-core/mxarray.h \
-  interp-core/oct-errno.cc \
-  interpfcn/defaults.h \
-  interpfcn/graphics-props.cc \
-  interpfcn/graphics.h \
+  corefcn/mxarray.h \
+  corefcn/oct-errno.cc \
+  corefcn/defaults.h \
+  corefcn/graphics-props.cc \
+  corefcn/graphics.h \
   operators/ops.cc \
   parse-tree/lex.cc \
   parse-tree/oct-gperf.h \
@@ -71,10 +69,10 @@
 ## Files that are created during build process and installed,
 ## BUT not distributed in tarball.
 BUILT_NODISTFILES = \
-  interp-core/mxarray.h \
-  interp-core/oct-errno.cc \
-  interpfcn/defaults.h \
-  interpfcn/graphics.h \
+  corefcn/mxarray.h \
+  corefcn/oct-errno.cc \
+  corefcn/defaults.h \
+  corefcn/graphics.h \
   builtin-defun-decls.h \
   operators/ops.cc \
   oct-conf.h \
@@ -103,7 +101,7 @@
   $(BUILT_DISTFILES)
 
 octinclude_HEADERS = \
-  interpfcn/graphics-props.cc \
+  corefcn/graphics-props.cc \
   parse-tree/oct-gperf.h \
   builtins.h \
   builtin-defun-decls.h \
@@ -112,13 +110,12 @@
   $(PARSE_TREE_INC) \
   $(PARSER_INC) \
   $(OPERATORS_INC) \
-  $(INTERP_CORE_INC) \
-  $(INTERPFCN_INC)
+  $(COREFCN_INC)
 
 nodist_octinclude_HEADERS = \
-  interp-core/mxarray.h \
-  interpfcn/defaults.h \
-  interpfcn/graphics.h \
+  corefcn/mxarray.h \
+  corefcn/defaults.h \
+  corefcn/graphics.h \
   oct-conf.h \
   version.h
 
@@ -127,8 +124,6 @@
   $(OCTAVE_VALUE_SRC) \
   $(PARSE_TREE_SRC) \
   $(PARSER_SRC) \
-  $(INTERP_CORE_SRC) \
-  $(INTERPFCN_SRC) \
   $(COREFCN_SRC)
 
 noinst_LTLIBRARIES =
@@ -137,8 +132,6 @@
 include octave-value/module.mk
 include operators/module.mk
 include template-inst/module.mk
-include interp-core/module.mk
-include interpfcn/module.mk
 include corefcn/module.mk
 include dldfcn/module.mk
 
@@ -161,10 +154,10 @@
   $(TEMPLATE_INST_SRC)
 
 nodist_liboctinterp_la_SOURCES = \
-  interp-core/mxarray.h \
-  interp-core/oct-errno.cc \
-  interpfcn/defaults.h \
-  interpfcn/graphics.h \
+  corefcn/mxarray.h \
+  corefcn/oct-errno.cc \
+  corefcn/defaults.h \
+  corefcn/graphics.h \
   operators/ops.cc \
   builtin-defun-decls.h \
   builtins.cc \
@@ -181,8 +174,6 @@
   octave-value/liboctave-value.la \
   parse-tree/libparse-tree.la \
   parse-tree/libparser.la \
-  interp-core/libinterp-core.la \
-  interpfcn/libinterpfcn.la \
   corefcn/libcorefcn.la \
   $(top_builddir)/liboctave/liboctave.la \
   $(LIBOCTINTERP_LINK_DEPS)
@@ -365,7 +356,7 @@
 
 CLEANFILES = \
   $(DLDFCN_PKG_ADD_FILE) \
-  interpfcn/graphics-props.cc \
+  corefcn/graphics-props.cc \
   parse-tree/oct-parse.output
 
 DISTCLEANFILES = \
rename from libinterp/interp-core/Cell.cc
rename to libinterp/corefcn/Cell.cc
rename from libinterp/interp-core/Cell.h
rename to libinterp/corefcn/Cell.h
rename from libinterp/interp-core/action-container.h
rename to libinterp/corefcn/action-container.h
--- a/libinterp/corefcn/bitfcns.cc
+++ b/libinterp/corefcn/bitfcns.cc
@@ -567,9 +567,15 @@
 @deftypefn  {Built-in Function} {} bitmax ()\n\
 @deftypefnx {Built-in Function} {} bitmax (\"double\")\n\
 @deftypefnx {Built-in Function} {} bitmax (\"single\")\n\
+@deftypefnx {Built-in Function} {} flintmax (@dots{})\n\
 Return the largest integer that can be represented within a floating point\n\
 value.  The default class is \"double\", but \"single\" is a valid option.\n\
-On IEEE-754 compatible systems, @code{bitmax} is @w{@math{2^{53} - 1}}.\n\
+On IEEE-754 compatible systems, @code{bitmax} is @w{@math{2^{53} - 1}} for\n\
+\"double\" and @w{@math{2^{24} -1}} for \"single\".\n\
+\n\
+@code{flintmax} for FLoating point INTeger MAXimum is an alias for\n\
+@code{bitmax}.\n\
+@seealso{intmax, realmax, realmin}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -594,6 +600,8 @@
   return retval;
 }
 
+DEFALIAS(flintmax, bitmax)
+
 DEFUN (intmax, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} intmax (@var{type})\n\
rename from libinterp/interp-core/c-file-ptr-stream.cc
rename to libinterp/corefcn/c-file-ptr-stream.cc
rename from libinterp/interp-core/c-file-ptr-stream.h
rename to libinterp/corefcn/c-file-ptr-stream.h
--- a/libinterp/corefcn/cellfun.cc
+++ b/libinterp/corefcn/cellfun.cc
@@ -133,6 +133,13 @@
         result(count) = f_args.elem (count).is_bool_type ();
       retval(0) = result;
     }
+  else if (name == "isnumeric")
+    {
+      boolNDArray result (f_args.dims ());
+      for (octave_idx_type  count= 0; count < k; count++)
+        result(count) = f_args.elem (count).is_numeric_type ();
+      retval(0) = result;
+    }
   else if (name == "isreal")
     {
       boolNDArray result (f_args.dims ());
@@ -154,7 +161,7 @@
         result(count) = static_cast<double> (f_args.elem (count).ndims ());
       retval(0) = result;
     }
-  else if (name == "prodofsize" || name == "numel")
+  else if (name == "numel" || name == "prodofsize")
     {
       NDArray result (f_args.dims ());
       for (octave_idx_type count = 0; count < k; count++)
@@ -278,6 +285,9 @@
 @item islogical\n\
 Return 1 for logical elements.\n\
 \n\
+@item isnumeric\n\
+Return 1 for numeric elements.\n\
+\n\
 @item isreal\n\
 Return 1 for real elements.\n\
 \n\
@@ -778,7 +788,7 @@
 %! assert (A, [true, false, true, false]);
 
 %% First input argument can be the special string "isreal",
-%% "isempty", "islogical", "length", "ndims" or "prodofsize"
+%% "isempty", "islogical", "isnumeric", "length", "ndims" or "prodofsize"
 %!test
 %! A = cellfun ("isreal", {true, 0.1, {}, i*2, [], "abc"});
 %! assert (A, [true, true, false, false, true, true]);
@@ -789,6 +799,9 @@
 %! A = cellfun ("islogical", {true, 0.1, false, i*2, [], "abc"});
 %! assert (A, [true, false, true, false, false, false]);
 %!test
+%! A = cellfun ("isnumeric", {true, 0.1, false, i*2, [], "abc"});
+%! assert (A, [false, true, false, true, true, false]);
+%!test
 %! A = cellfun ("length", {true, 0.1, false, i*2, [], "abc"});
 %! assert (A, [1, 1, 1, 1, 0, 3]);
 %!test
@@ -989,6 +1002,7 @@
 %!assert (cellfun ("sin", {0,1}), sin ([0,1]))
 %!assert (cellfun ("isempty", {1,[]}), [false,true])
 %!assert (cellfun ("islogical", {false,pi}), [true,false])
+%!assert (cellfun ("isnumeric", {false,pi,struct()}), [false,true,false])
 %!assert (cellfun ("isreal", {1i,1}), [false,true])
 %!assert (cellfun ("length", {zeros(2,2),1}), [2,1])
 %!assert (cellfun ("prodofsize", {zeros(2,2),1}), [4,1])
rename from libinterp/interp-core/comment-list.cc
rename to libinterp/corefcn/comment-list.cc
rename from libinterp/interp-core/comment-list.h
rename to libinterp/corefcn/comment-list.h
rename from libinterp/interp-core/cutils.c
rename to libinterp/corefcn/cutils.c
rename from libinterp/interp-core/cutils.h
rename to libinterp/corefcn/cutils.h
--- a/libinterp/corefcn/dassl.cc
+++ b/libinterp/corefcn/dassl.cc
@@ -558,8 +558,11 @@
 %! assert (x, y, tol);
 
 %!test
+%! old_tol = dassl_options ("absolute tolerance");
 %! dassl_options ("absolute tolerance", eps);
 %! assert (dassl_options ("absolute tolerance") == eps);
+%! ## Restore old value of tolerance
+%! dassl_options ("absolute tolerance", old_tol);
 
 %!error dassl_options ("foo", 1, 2)
 */
rename from libinterp/interpfcn/data.cc
rename to libinterp/corefcn/data.cc
--- a/libinterp/interpfcn/data.cc
+++ b/libinterp/corefcn/data.cc
@@ -3342,6 +3342,11 @@
   return retval;
 }
 
+/*
+%% Debian bug #706376
+%!assert (isempty (speye(2^16)), false)
+*/
+
 DEFUN (isnumeric, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} isnumeric (@var{x})\n\
rename from libinterp/interpfcn/data.h
rename to libinterp/corefcn/data.h
rename from libinterp/interpfcn/debug.cc
rename to libinterp/corefcn/debug.cc
--- a/libinterp/interpfcn/debug.cc
+++ b/libinterp/corefcn/debug.cc
@@ -609,7 +609,8 @@
 DEFUN (dbstop, args, ,
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\")\n\
-@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line}, @dots{})\n\
+@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line})\n\
+@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line1}, @var{line2}, @dots{})\n\
 Set a breakpoint in function @var{func}.\n\
 \n\
 Arguments are\n\
@@ -654,6 +655,7 @@
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {} dbclear (\"@var{func}\")\n\
 @deftypefnx {Built-in Function} {} dbclear (\"@var{func}\", @var{line}, @dots{})\n\
+@deftypefnx {Built-in Function} {} dbclear (@var{line}, @dots{})\n\
 Delete a breakpoint in the function @var{func}.\n\
 \n\
 Arguments are\n\
@@ -661,7 +663,8 @@
 @table @var\n\
 @item func\n\
 Function name as a string variable.  When already in debug\n\
-mode this should be left out and only the line should be given.\n\
+mode this argument should be omitted and only the line number should be\n\
+given.\n\
 \n\
 @item line\n\
 Line number from which to remove a breakpoint.  Multiple\n\
@@ -1033,6 +1036,80 @@
   return retval;
 }
 
+DEFUN (dblist, args, ,
+  "-*- texinfo -*-\n\
+@deftypefn  {Command} {} dblist\n\
+@deftypefnx {Command} {} dblist @var{n}\n\
+In debugging mode, list @var{n} lines of the function being debugged\n\
+centered around the the current line to be executed.  If unspecified @var{n}\n\
+defaults to 10 (+/- 5 lines)\n\
+@seealso{dbwhere, dbtype}\n\
+@end deftypefn")
+{
+  octave_value retval;
+
+  int n = 10;
+
+  if (args.length () == 1)
+    {
+      octave_value arg = args(0);
+
+      if (arg.is_string ())
+        {
+          std::string s_arg = arg.string_value ();
+
+          n = atoi (s_arg.c_str ());
+        }
+      else
+        n = args(0).int_value ();
+
+      if (n < 0)
+        error ("dblist: N must be a non-negative integer");
+    }
+
+  octave_user_code *dbg_fcn = get_user_code ();
+
+  if (dbg_fcn)
+    {
+      bool have_file = true;
+
+      std::string name = dbg_fcn->fcn_file_name ();
+
+      if (name.empty ())
+        {
+          have_file = false;
+          name = dbg_fcn->name ();
+        }
+
+      int l = octave_call_stack::caller_user_code_line ();
+
+      if (l > 0)
+        {
+          if (have_file)
+            {
+              int l_min = std::max (l - n/2, 0);
+              int l_max = l + n/2;
+              do_dbtype (octave_stdout, dbg_fcn->name (), l_min, l-1);
+
+              std::string line = get_file_line (name, l);
+              if (! line.empty ())
+                octave_stdout << l << "-->\t" << line << std::endl;
+
+              do_dbtype (octave_stdout, dbg_fcn->name (), l+1, l_max);
+            }
+        }
+      else
+        {
+          octave_stdout << "dblist: unable to determine source code line"
+                        << std::endl;
+        }
+    }
+  else
+    error ("dblist: must be inside a user function to use dblist\n");
+
+  return retval;
+}
+
 static octave_value_list
 do_dbstack (const octave_value_list& args, int nargout, std::ostream& os)
 {
rename from libinterp/interpfcn/debug.h
rename to libinterp/corefcn/debug.h
rename from libinterp/interpfcn/defaults.cc
rename to libinterp/corefcn/defaults.cc
--- a/libinterp/interpfcn/defaults.cc
+++ b/libinterp/corefcn/defaults.cc
@@ -479,6 +479,7 @@
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
 variable value is restored when exiting the function.\n\
+\n\
 @seealso{edit_history}\n\
 @end deftypefn")
 {
@@ -511,6 +512,8 @@
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
 variable value is restored when exiting the function.\n\
+\n\
+@seealso{IMAGE_PATH, OCTAVE_HOME}\n\
 @end deftypefn")
 {
   octave_value retval = SET_NONEMPTY_INTERNAL_STRING_VARIABLE (EXEC_PATH);
@@ -544,6 +547,8 @@
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
 variable value is restored when exiting the function.\n\
+\n\
+@seealso{EXEC_PATH, OCTAVE_HOME}\n\
 @end deftypefn")
 {
   return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (IMAGE_PATH);
@@ -565,6 +570,8 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} OCTAVE_HOME ()\n\
 Return the name of the top-level Octave installation directory.\n\
+\n\
+@seealso{EXEC_PATH, IMAGE_PATH}\n\
 @end deftypefn")
 {
   octave_value retval;
rename from libinterp/interpfcn/defaults.in.h
rename to libinterp/corefcn/defaults.in.h
rename from libinterp/interp-core/defun-dld.h
rename to libinterp/corefcn/defun-dld.h
rename from libinterp/interp-core/defun-int.h
rename to libinterp/corefcn/defun-int.h
rename from libinterp/interpfcn/defun.cc
rename to libinterp/corefcn/defun.cc
rename from libinterp/interpfcn/defun.h
rename to libinterp/corefcn/defun.h
rename from libinterp/interpfcn/dirfns.cc
rename to libinterp/corefcn/dirfns.cc
--- a/libinterp/interpfcn/dirfns.cc
+++ b/libinterp/corefcn/dirfns.cc
@@ -563,6 +563,7 @@
 @table @code\n\
 @item *\n\
 matches any string, including the null string,\n\
+\n\
 @item ?\n\
 matches any single character, and\n\
 \n\
@@ -627,7 +628,7 @@
 %! if (mkdir (tmpdir))
 %!   cwd = pwd;
 %!   cd (tmpdir);
-%!   if strcmp (canonicalize_file_name (pwd), canonicalize_file_name (tmpdir))
+%!   if (strcmp (canonicalize_file_name (pwd), canonicalize_file_name (tmpdir)))
 %!     a = 0;
 %!     for n = 1:5
 %!       save (filename{n}, "a");
rename from libinterp/interpfcn/dirfns.h
rename to libinterp/corefcn/dirfns.h
rename from libinterp/interp-core/display.cc
rename to libinterp/corefcn/display.cc
rename from libinterp/interp-core/display.h
rename to libinterp/corefcn/display.h
rename from libinterp/interp-core/dynamic-ld.cc
rename to libinterp/corefcn/dynamic-ld.cc
rename from libinterp/interp-core/dynamic-ld.h
rename to libinterp/corefcn/dynamic-ld.h
--- a/libinterp/corefcn/ellipj.cc
+++ b/libinterp/corefcn/ellipj.cc
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2001 Leopoldo Cerbaro <redbliss@libero.it>
+// Author: Leopoldo Cerbaro <redbliss@libero.it>
 
 This file is part of Octave.
 
@@ -149,9 +149,9 @@
 @var{m} must conform and the results will be the same size.\n\
 \n\
 The value of @var{u} may be complex.\n\
-The value of @var{m} must be 0 <= m <= 1.\n\
+The value of @var{m} must be 0 @leq{} m @leq{} 1.\n\
 \n\
-@var{tol} is currently ignored (@sc{Matlab} uses this to allow faster,\n\
+@var{tol} is currently ignored (@sc{matlab} uses this to allow faster,\n\
 less accurate approximation).\n\
 \n\
 If requested, @var{err} contains the following status information\n\
@@ -160,6 +160,7 @@
 @enumerate 0\n\
 @item\n\
 Normal return.\n\
+\n\
 @item\n\
 Error---no computation, algorithm termination condition not met,\n\
 return @code{NaN}.\n\
rename from libinterp/interpfcn/error.cc
rename to libinterp/corefcn/error.cc
--- a/libinterp/interpfcn/error.cc
+++ b/libinterp/corefcn/error.cc
@@ -1069,6 +1069,27 @@
 @end group\n\
 @end example\n\
 \n\
+A null string (\"\") input to @code{error} will be ignored and the code\n\
+will continue running as if the statement were a NOP@.  This is for\n\
+compatibility with @sc{matlab}.  It also makes it possible to write code such\n\
+as\n\
+\n\
+@example\n\
+@group\n\
+err_msg = \"\";\n\
+if (CONDITION 1)\n\
+  err_msg = \"CONDITION 1 found\";\n\
+elseif (CONDITION2)\n\
+  err_msg = \"CONDITION 2 found\";\n\
+@dots{}\n\
+endif\n\
+error (err_msg);\n\
+@end group\n\
+@end example\n\
+\n\
+@noindent\n\
+which will only stop execution if an error has been found.\n\
+\n\
 Implementation Note: For compatibility with @sc{matlab}, escape\n\
 sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\
 regardless of whether @var{template} has been defined within single quotes\n\
@@ -1215,7 +1236,7 @@
 The optional message identifier allows users to enable or disable\n\
 warnings tagged by @var{id}.  A message identifier is of the form\n\
 \"NAMESPACE:WARNING-NAME\".  Octave's own warnings use the \"Octave\"\n\
-namespace (@pxref{doc-warning_ids}).  The special identifier @samp{\"all\"}\n\
+namespace (@pxref{XREFwarning_ids}).  The special identifier @samp{\"all\"}\n\
 may be used to set the state of all warnings.\n\
 \n\
 If the first argument is @samp{\"on\"} or @samp{\"off\"}, set the state\n\
rename from libinterp/interpfcn/error.h
rename to libinterp/corefcn/error.h
rename from libinterp/interp-core/event-queue.h
rename to libinterp/corefcn/event-queue.h
rename from libinterp/interpfcn/file-io.cc
rename to libinterp/corefcn/file-io.cc
--- a/libinterp/interpfcn/file-io.cc
+++ b/libinterp/corefcn/file-io.cc
@@ -1139,7 +1139,7 @@
 \n\
 In the second form, read from @var{fid} according to @var{template},\n\
 with each conversion specifier in @var{template} corresponding to a\n\
-single scalar return value.  This form is more `C-like', and also\n\
+single scalar return value.  This form is more ``C-like'', and also\n\
 compatible with previous versions of Octave.  The number of successful\n\
 conversions is returned in @var{count}\n\
 @ifclear OCTAVE_MANUAL\n\
rename from libinterp/interpfcn/file-io.h
rename to libinterp/corefcn/file-io.h
rename from libinterp/interp-core/gl-render.cc
rename to libinterp/corefcn/gl-render.cc
--- a/libinterp/interp-core/gl-render.cc
+++ b/libinterp/corefcn/gl-render.cc
@@ -755,28 +755,37 @@
                                    int xyz, int ha, int va,
                                    int& wmax, int& hmax)
 {
-  int n = std::min (ticklabels.numel (), ticks.numel ());
-
-  for (int i = 0; i < n; i++)
+  int nticks  = ticks.numel ();
+  int nlabels = ticklabels.numel ();
+
+  if (nlabels == 0)
+    return;
+
+  for (int i = 0; i < nticks; i++)
     {
       double val = ticks(i);
 
       if (lim1 <= val && val <= lim2)
         {
           Matrix b;
-          // FIXME: as tick text is transparent, shouldn't be
+
+          std::string label (ticklabels(i % nlabels));
+          label.erase (0, label.find_first_not_of (" "));
+          label = label.substr (0, label.find_last_not_of (" ")+1);
+
+          // FIXME: as tick text is transparent, shouldn't it be
           //        drawn after axes object, for correct rendering?
           if (xyz == 0) // X
             {
-              b = render_text (ticklabels(i), val, p1, p2, ha, va);
+              b = render_text (label, val, p1, p2, ha, va);
             }
           else if (xyz == 1) // Y
             {
-              b = render_text (ticklabels(i), p1, val, p2, ha, va);
+              b = render_text (label, p1, val, p2, ha, va);
             }
           else if (xyz == 2) // Z
             {
-              b = render_text (ticklabels(i), p1, p2, val, ha, va);
+              b = render_text (label, p1, p2, val, ha, va);
             }
 
           wmax = std::max (wmax, static_cast<int> (b(2)));
rename from libinterp/interp-core/gl-render.h
rename to libinterp/corefcn/gl-render.h
rename from libinterp/interp-core/gl2ps-renderer.cc
rename to libinterp/corefcn/gl2ps-renderer.cc
rename from libinterp/interp-core/gl2ps-renderer.h
rename to libinterp/corefcn/gl2ps-renderer.h
rename from libinterp/interp-core/gl2ps.c
rename to libinterp/corefcn/gl2ps.c
rename from libinterp/interp-core/gl2ps.h
rename to libinterp/corefcn/gl2ps.h
rename from libinterp/interpfcn/graphics.cc
rename to libinterp/corefcn/graphics.cc
--- a/libinterp/interpfcn/graphics.cc
+++ b/libinterp/corefcn/graphics.cc
@@ -2062,29 +2062,29 @@
 /*
 ## test set ticklabels for compatibility
 %!test
-%! set (gcf (), "visible", "off")
-%! set (gca (), "xticklabel", [0, 0.2, 0.4, 0.6, 0.8, 1])
+%! set (gcf (), "visible", "off");
+%! set (gca (), "xticklabel", [0, 0.2, 0.4, 0.6, 0.8, 1]);
 %! xticklabel = get (gca (), "xticklabel");
-%! assert (class (xticklabel), "char")
-%! assert (size (xticklabel), [6, 3])
+%! assert (class (xticklabel), "char");
+%! assert (size (xticklabel), [6, 3]);
 %!test
-%! set (gcf (), "visible", "off")
-%! set (gca (), "xticklabel", "0|0.2|0.4|0.6|0.8|1")
+%! set (gcf (), "visible", "off");
+%! set (gca (), "xticklabel", "0|0.2|0.4|0.6|0.8|1");
 %! xticklabel = get (gca (), "xticklabel");
-%! assert (class (xticklabel), "char")
-%! assert (size (xticklabel), [6, 3])
+%! assert (class (xticklabel), "char");
+%! assert (size (xticklabel), [6, 3]);
 %!test
-%! set (gcf (), "visible", "off")
-%! set (gca (), "xticklabel", ["0 "; "0.2"; "0.4"; "0.6"; "0.8"; "1 "])
+%! set (gcf (), "visible", "off");
+%! set (gca (), "xticklabel", ["0 "; "0.2"; "0.4"; "0.6"; "0.8"; "1 "]);
 %! xticklabel = get (gca (), "xticklabel");
-%! assert (class (xticklabel), "char")
-%! assert (size (xticklabel), [6, 3])
-%!xtest
-%! set (gcf (), "visible", "off")
-%! set (gca (), "xticklabel", {"0", "0.2", "0.4", "0.6", "0.8", "1"})
+%! assert (class (xticklabel), "char");
+%! assert (size (xticklabel), [6, 3]);
+%!test
+%! set (gcf (), "visible", "off");
+%! set (gca (), "xticklabel", {"0", "0.2", "0.4", "0.6", "0.8", "1"});
 %! xticklabel = get (gca (), "xticklabel");
-%! assert (class (xticklabel), "cell")
-%! assert (size (xticklabel), [6, 1])
+%! assert (class (xticklabel), "cell");
+%! assert (size (xticklabel), [6, 1]);
 */
 
 /*
@@ -2102,28 +2102,28 @@
 %!test
 %! markchanged = @(h, foobar, name) set (h, "userdata", [get(h,"userdata"); {name}]);
 %! figure (1, "visible", "off")
-%! clf ()
+%! clf ();
 %! h = line ();
-%! set (h, "userdata", {})
-%! addlistener (h, "color", {markchanged, "color"})
-%! addlistener (h, "linewidth", {markchanged, "linewidth"})
+%! set (h, "userdata", {});
+%! addlistener (h, "color", {markchanged, "color"});
+%! addlistener (h, "linewidth", {markchanged, "linewidth"});
 %! # "linewidth" first
 %! props.linewidth = 2;
 %! props.color = "r";
 %! set (h, props);
-%! assert (get (h, "userdata"), fieldnames (props))
+%! assert (get (h, "userdata"), fieldnames (props));
 %! clear props
-%! clf ()
+%! clf ();
 %! h = line ();
-%! set (h, "userdata", {})
-%! addlistener (h, "color", {markchanged, "color"})
-%! addlistener (h, "linewidth", {markchanged, "linewidth"})
+%! set (h, "userdata", {});
+%! addlistener (h, "color", {markchanged, "color"});
+%! addlistener (h, "linewidth", {markchanged, "linewidth"});
 %! # "color" first
 %! props.color = "r";
 %! props.linewidth = 2;
 %! set (h, props);
-%! assert (get (h, "userdata"), fieldnames (props))
-%! close (1)
+%! assert (get (h, "userdata"), fieldnames (props));
+%! close (1);
 */
 
 // Set a property to a value or to its (factory) default value.
@@ -3748,25 +3748,25 @@
 %!test
 %! figure (1, "visible", "off");
 %! set (1, "paperunits", "inches");
-%! set (1, "papersize", [5, 4])
+%! set (1, "papersize", [5, 4]);
 %! set (1, "paperunits", "points");
-%! assert (get (1, "papersize"), [5, 4] * 72, 1)
+%! assert (get (1, "papersize"), [5, 4] * 72, 1);
 %! papersize = get (gcf, "papersize");
 %! set (1, "papersize", papersize + 1);
-%! set (1, "papersize", papersize)
-%! assert (get (1, "papersize"), [5, 4] * 72, 1)
-%! close (1)
+%! set (1, "papersize", papersize);
+%! assert (get (1, "papersize"), [5, 4] * 72, 1);
+%! close (1);
 %!test
 %! figure (1, "visible", "off");
 %! set (1, "paperunits", "inches");
-%! set (1, "papersize", [5, 4])
+%! set (1, "papersize", [5, 4]);
 %! set (1, "paperunits", "centimeters");
-%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72)
+%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72);
 %! papersize = get (gcf, "papersize");
 %! set (1, "papersize", papersize + 1);
-%! set (1, "papersize", papersize)
-%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72)
-%! close (1)
+%! set (1, "papersize", papersize);
+%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72);
+%! close (1);
 */
 
 void
@@ -4007,211 +4007,49 @@
 void
 axes::properties::sync_positions (void)
 {
-  Matrix ref_linset = looseinset.get ().matrix_value ();
-  if (autopos_tag_is ("subplot"))
-    {
-      graphics_object parent_obj = gh_manager::get_object (get_parent ());
-      if (parent_obj.isa ("figure"))
-        {
-           // FIXME: temporarily changed units should be protected
-           //        from interrupts
-           std::string fig_units = parent_obj.get ("units").string_value ();
-           parent_obj.set ("units", "pixels");
-
-           Matrix ref_outbox = outerposition.get ().matrix_value ();
-           ref_outbox(2) += ref_outbox(0);
-           ref_outbox(3) += ref_outbox(1);
-
-           // Find those subplots that are left, right, bottom and top aligned
-           // with the current subplot
-           Matrix kids = parent_obj.get_properties ().get_children ();
-           std::vector<octave_value> aligned;
-           std::vector<bool> l_aligned, b_aligned, r_aligned, t_aligned;
-           for (octave_idx_type i = 0; i < kids.numel (); i++)
-             {
-               graphics_object go = gh_manager::get_object (kids(i));
-               if (go.isa ("axes"))
-                 {
-                   axes::properties& props =
-                     dynamic_cast<axes::properties&> (go.get_properties ());
-                   if (props.autopos_tag_is ("subplot"))
-                     {
-                       Matrix outpos = go.get ("outerposition").matrix_value ();
-                       bool l_align = (std::abs (outpos(0)-ref_outbox(0)) < 1e-15);
-                       bool b_align = (std::abs (outpos(1)-ref_outbox(1)) < 1e-15);
-                       bool r_align = (std::abs (outpos(0)+outpos(2)-ref_outbox(2)) < 1e-15);
-                       bool t_align = (std::abs (outpos(1)+outpos(3)-ref_outbox(3)) < 1e-15);
-                       if (l_align || b_align || r_align || t_align)
-                         {
-                           aligned.push_back (kids(i));
-                           l_aligned.push_back (l_align);
-                           b_aligned.push_back (b_align);
-                           r_aligned.push_back (r_align);
-                           t_aligned.push_back (t_align);
-                           // FIXME: the temporarily deleted tags should be
-                           //        protected from interrupts
-                           props.set_autopos_tag ("none");
-                         }
-                     }
-                 }
-             }
-           // Determine a minimum box which aligns the subplots
-           Matrix ref_box (1, 4, 0.);
-           ref_box(2) = 1.;
-           ref_box(3) = 1.;
-           for (size_t i = 0; i < aligned.size (); i++)
-             {
-               graphics_object go = gh_manager::get_object (aligned[i]);
-               axes::properties& props =
-                 dynamic_cast<axes::properties&> (go.get_properties ());
-               Matrix linset = props.get_looseinset ().matrix_value ();
-               if (l_aligned[i])
-                 linset(0) = std::min (0., linset(0)-0.01);
-               if (b_aligned[i])
-                 linset(1) = std::min (0., linset(1)-0.01);
-               if (r_aligned[i])
-                 linset(2) = std::min (0., linset(2)-0.01);
-               if (t_aligned[i])
-                 linset(3) = std::min (0., linset(3)-0.01);
-               props.set_looseinset (linset);
-               Matrix pos = props.get_position ().matrix_value ();
-               if (l_aligned[i])
-                 ref_box(0) = std::max (ref_box(0), pos(0));
-               if (b_aligned[i])
-                 ref_box(1) = std::max (ref_box(1), pos(1));
-               if (r_aligned[i])
-                 ref_box(2) = std::min (ref_box(2), pos(0)+pos(2));
-               if (t_aligned[i])
-                 ref_box(3) = std::min (ref_box(3), pos(1)+pos(3));
-             }
-           // Set common looseinset values for all aligned subplots and
-           // revert their tag values
-           for (size_t i = 0; i < aligned.size (); i++)
-             {
-               graphics_object go = gh_manager::get_object (aligned[i]);
-               axes::properties& props =
-                 dynamic_cast<axes::properties&> (go.get_properties ());
-               Matrix outpos = props.get_outerposition ().matrix_value ();
-               Matrix linset = props.get_looseinset ().matrix_value ();
-               if (l_aligned[i])
-                 linset(0) = (ref_box(0)-outpos(0))/outpos(2);
-               if (b_aligned[i])
-                 linset(1) = (ref_box(1)-outpos(1))/outpos(3);
-               if (r_aligned[i])
-                 linset(2) = (outpos(0)+outpos(2)-ref_box(2))/outpos(2);
-               if (t_aligned[i])
-                 linset(3) = (outpos(1)+outpos(3)-ref_box(3))/outpos(3);
-               props.set_looseinset (linset);
-               props.set_autopos_tag ("subplot");
-             }
-           parent_obj.set ("units", fig_units);
-        }
-    }
-  else
-    sync_positions (ref_linset);
-}
-
-void
-axes::properties::sync_positions (const Matrix& linset)
-{
+  // First part is equivalent to `update_tightinset ()'
+  caseless_str old_units = get_units ();
+  set_units ("normalized");
   Matrix pos = position.get ().matrix_value ();
   Matrix outpos = outerposition.get ().matrix_value ();
-  double lratio = linset(0);
-  double bratio = linset(1);
-  double wratio = 1-linset(0)-linset(2);
-  double hratio = 1-linset(1)-linset(3);
-  if (activepositionproperty.is ("outerposition"))
-    {
-      pos = outpos;
-      pos(0) = outpos(0)+lratio*outpos(2);
-      pos(1) = outpos(1)+bratio*outpos(3);
-      pos(2) = wratio*outpos(2);
-      pos(3) = hratio*outpos(3);
-
-      position = pos;
-      update_transform ();
-      Matrix tightpos = calc_tightbox (pos);
-
-      double thrshldx = 0.005*outpos(2);
-      double thrshldy = 0.005*outpos(3);
-      double minsizex = 0.2*outpos(2);
-      double minsizey = 0.2*outpos(3);
-      bool updatex = true, updatey = true;
-      for (int i = 0; i < 10; i++)
-        {
-          double dt;
-          bool modified = false;
-          dt = outpos(0)+outpos(2)-tightpos(0)-tightpos(2);
-          if (dt < -thrshldx && updatex)
-            {
-              pos(2) += dt;
-              modified = true;
-            }
-          dt = outpos(1)+outpos(3)-tightpos(1)-tightpos(3);
-          if (dt < -thrshldy && updatey)
-            {
-              pos(3) += dt;
-              modified = true;
-            }
-          dt = outpos(0)-tightpos(0);
-          if (dt > thrshldx && updatex)
-            {
-              pos(0) += dt;
-              pos(2) -= dt;
-              modified = true;
-            }
-          dt = outpos(1)-tightpos(1);
-          if (dt > thrshldy && updatey)
-            {
-              pos(1) += dt;
-              pos(3) -= dt;
-              modified = true;
-            }
-
-          // Note: checking limit for minimum axes size
-          if (pos(2) < minsizex)
-            {
-              pos(0) -= 0.5*(minsizex-pos(2));
-              pos(2) = minsizex;
-              updatex = false;
-            }
-          if (pos(3) < minsizey)
-            {
-              pos(1) -= 0.5*(minsizey-pos(3));
-              pos(3) = minsizey;
-              updatey = false;
-            }
-
-          if (modified)
-            {
-              position = pos;
-              update_transform ();
-              tightpos = calc_tightbox (pos);
-            }
-          else
-            break;
-        }
-    }
+  Matrix tightpos = calc_tightbox (pos);
+  Matrix tinset (1, 4, 1.0);
+  tinset(0) = pos(0)-tightpos(0);
+  tinset(1) = pos(1)-tightpos(1);
+  tinset(2) = tightpos(0)+tightpos(2)-pos(0)-pos(2);
+  tinset(3) = tightpos(1)+tightpos(3)-pos(1)-pos(3);
+  tightinset = tinset;
+  set_units (old_units);
+  update_transform ();
+  // Changes to tightinset may result in changes to the inactive
+  // position property
+  if (activepositionproperty.is ("position"))
+    update_position ();
   else
-    {
-      update_transform ();
-
-      outpos(0) = pos(0)-pos(2)*lratio/wratio;
-      outpos(1) = pos(1)-pos(3)*bratio/hratio;
-      outpos(2) = pos(2)/wratio;
-      outpos(3) = pos(3)/hratio;
-
-      outerposition = calc_tightbox (outpos);
-    }
-
-  Matrix inset (1, 4, 1.0);
-  inset(0) = pos(0)-outpos(0);
-  inset(1) = pos(1)-outpos(1);
-  inset(2) = outpos(0)+outpos(2)-pos(0)-pos(2);
-  inset(3) = outpos(1)+outpos(3)-pos(1)-pos(3);
-
-  tightinset = inset;
-}
+    update_outerposition ();
+}
+
+/*
+%!xtest
+%! unwind_protect
+%!   hf = figure (gcf (), "__graphics_toolkit__", "fltk", "visible", "off");
+%!   clf;
+%!   subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
+%!   hax = findall (gcf (), "type", "axes");
+%!   positions = cell2mat (get (hax, "position"));
+%!   outerpositions = cell2mat (get (hax, "outerposition"));
+%!   looseinsets = cell2mat (get (hax, "looseinset"));
+%!   tightinsets = cell2mat (get (hax, "tightinset"));
+%!   subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
+%!   hax = findall (gcf (), "type", "axes");
+%!   assert (cell2mat (get (hax, "position")), positions)
+%!   assert (cell2mat (get (hax, "outerposition")), outerpositions)
+%!   assert (cell2mat (get (hax, "looseinset")), looseinsets)
+%!   assert (cell2mat (get (hax, "tightinset")), tightinsets)
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+*/
 
 void
 axes::properties::set_text_child (handle_property& hp,
@@ -4318,7 +4156,7 @@
 {
   box = "on";
   colororder = default_colororder ();
-  dataaspectratio = Matrix (1, 3, 1.0);
+  // Note: dataspectratio will be set through update_aspectratios
   dataaspectratiomode = "auto";
   layer = "bottom";
 
@@ -4332,10 +4170,13 @@
   cl(1) = 1;
   clim = cl;
 
+  alim = tlim;
+
   xlimmode = "auto";
   ylimmode = "auto";
   zlimmode = "auto";
   climmode = "auto";
+  alimmode = "auto";
 
   xgrid = "off";
   ygrid = "off";
@@ -4349,12 +4190,18 @@
   xtickmode = "auto";
   ytickmode = "auto";
   ztickmode = "auto";
+  xminortick = "off";
+  yminortick = "off";
+  zminortick = "off";
   xticklabel = "";
   yticklabel = "";
   zticklabel = "";
   xticklabelmode = "auto";
   yticklabelmode = "auto";
   zticklabelmode = "auto";
+
+  interpreter = "none";
+
   color = color_values ("white");
   xcolor = color_values ("black");
   ycolor = color_values ("black");
@@ -4368,56 +4215,55 @@
   yaxislocation = "left";
   xaxislocation = "bottom";
 
-  // Note: camera properties will be set through update_transform
+  Matrix tview (1, 2, 0.0);
+  tview(1) = 90;
+  view = tview;
+
+  __hold_all__ = "off";
+  nextplot = "replace";
+
+  ambientlightcolor = Matrix (1, 3, 1.0);
+
+  // Note: camera properties (not mode) will be set in update_transform
   camerapositionmode = "auto";
   cameratargetmode = "auto";
   cameraupvectormode = "auto";
   cameraviewanglemode = "auto";
-  plotboxaspectratio = Matrix (1, 3, 1.0);
+
   drawmode = "normal";
+
+  fontangle = "normal";
+  fontname = OCTAVE_DEFAULT_FONTNAME;
+  fontsize = 10;
+  fontunits = "points";
+  fontweight = "normal";
+
   gridlinestyle = ":";
   linestyleorder = "-";
   linewidth = 0.5;
   minorgridlinestyle = ":";
-  // Note: plotboxaspectratio will be set through update_aspectratiors
+
+  // Note: plotboxaspectratio will be set through update_aspectratios
   plotboxaspectratiomode = "auto";
   projection = "orthographic";
+
   tickdir = "in";
   tickdirmode = "auto";
   ticklength = default_axes_ticklength ();
+
   tightinset = Matrix (1, 4, 0.0);
 
   sx = "linear";
   sy = "linear";
   sz = "linear";
 
-  Matrix tview (1, 2, 0.0);
-  tview(1) = 90;
-  view = tview;
-
   visible = "on";
-  nextplot = "replace";
-
+
+  // Replace preserves Position and Units properties
   if (mode != "replace")
     {
-      fontangle = "normal";
-      fontname = OCTAVE_DEFAULT_FONTNAME;
-      fontsize = 10;
-      fontunits = "points";
-      fontweight = "normal";
-
-      Matrix touterposition (1, 4, 0.0);
-      touterposition(2) = 1;
-      touterposition(3) = 1;
-      outerposition = touterposition;
-
+      outerposition = default_axes_outerposition ();
       position = default_axes_position ();
-
-      Matrix tlooseinset = default_axes_position ();
-      tlooseinset(2) = 1-tlooseinset(0)-tlooseinset(2);
-      tlooseinset(3) = 1-tlooseinset(1)-tlooseinset(3);
-      looseinset = tlooseinset;
-
       activepositionproperty = "outerposition";
     }
 
@@ -4477,7 +4323,7 @@
   adopt (title.handle_value ());
 
   update_transform ();
-
+  sync_positions ();
   override_defaults (obj);
 }
 
@@ -5085,16 +4931,16 @@
 %!demo
 %! clf;
 %! subplot (2,1,1);
-%! plot (rand (3));
-%! xlabel xlabel;
-%! ylabel ylabel;
-%! title title;
+%!  plot (rand (3));
+%!  xlabel xlabel;
+%!  ylabel ylabel;
+%!  title title;
 %! subplot (2,1,2);
-%! plot (rand (3));
-%! set (gca, "ticklength", get (gca, "ticklength") * 2, "tickdir", "out");
-%! xlabel xlabel;
-%! ylabel ylabel;
-%! title title;
+%!  plot (rand (3));
+%!  set (gca, "ticklength", get (gca, "ticklength") * 2, "tickdir", "out");
+%!  xlabel xlabel;
+%!  ylabel ylabel;
+%!  title title;
 */
 
 static bool updating_xlabel_position = false;
@@ -5485,8 +5331,7 @@
       double min_pos = octave_Inf;
       double max_neg = -octave_Inf;
       get_children_limits (minval, maxval, min_pos, max_neg, kids, limit_type);
-      if (!xisinf (minval) && !xisnan (minval)
-          && !xisinf (maxval) && !xisnan (maxval))
+      if (xfinite (minval) && xfinite (maxval))
         {
           limits(0) = minval;
           limits(1) = maxval;
@@ -5738,106 +5583,101 @@
 }
 
 static octave_value
-convert_ticklabel_string(const octave_value& val)
+convert_ticklabel_string (const octave_value& val)
 {
   octave_value retval = val;
 
-  if (!val.is_cellstr ())
-    {
-      string_vector str;
-      if (val.is_float_type () || val.is_integer_type ())
+  if (val.is_cellstr ())
+    {
+      // Always return a column vector for Matlab Compatibility
+      if (val.columns () > 1)
+        retval = val.reshape (dim_vector (val.numel (), 1));
+    }
+  else
+    {
+      string_vector sv;
+      if (val.is_numeric_type ())
         {
           NDArray data = val.array_value ();
-          std::ostringstream s;
-          s.precision (5);
+          std::ostringstream oss;
+          oss.precision (5);
           for (octave_idx_type i = 0; i < val.numel (); i++)
             {
-              s.str("");
-              s << data(i);
-              str.append (s.str());
+              oss.str ("");
+              oss << data(i);
+              sv.append (oss.str ());
             }
         }
       else if (val.is_string () && val.rows () == 1)
         {
-          std::string tmpstr(val.string_value ());
-          char separator = '|';
-          size_t pos = 0;
-          while (true)
-            {
-              size_t new_pos = tmpstr.find_first_of (separator, pos);
-
-              if (new_pos == std::string::npos)
-                {
-                  std::string tmp = tmpstr.substr (pos);
-                  str.append(tmp);
-                  break;
-                }
-              else
-                {
-                  std::string tmp = tmpstr.substr (pos, new_pos - pos);
-                  str.append (tmp);
-                }
-              pos = new_pos + 1;
-            }
+          std::string valstr = val.string_value ();
+          std::istringstream iss (valstr);
+          std::string tmpstr;
+
+          // Split string with delimiter '|'
+          while (std::getline (iss, tmpstr, '|'))
+            sv.append (tmpstr);
+          
+          // If string ends with '|' Matlab appends a null string
+          if (*valstr.rbegin () == '|')
+            sv.append (std::string (""));
         }
       else
         return retval;
 
-      charMatrix ch(str);
-      for (octave_idx_type i = 0; i < ch.numel(); i++)
-        if (ch(i) == 0)
-          ch(i) = ' ';
-      retval = octave_value(ch);
-
-    }
+      charMatrix chmat (sv, ' ');
+
+      retval = octave_value (chmat);
+    }
+
   return retval;
 }
 
 void
-axes::properties::set_xticklabel(const octave_value& v)
+axes::properties::set_xticklabel (const octave_value& v)
 {
   if (!error_state)
     {
-      if (xticklabel.set(convert_ticklabel_string(v), false))
-        {
-          set_xticklabelmode("manual");
-          xticklabel.run_listeners(POSTSET);
-          mark_modified();
+      if (xticklabel.set (convert_ticklabel_string (v), false))
+        {
+          set_xticklabelmode ("manual");
+          xticklabel.run_listeners (POSTSET);
+          mark_modified ();
         }
       else
-        set_xticklabelmode("manual");
-    }
-}
-
-void
-axes::properties::set_yticklabel(const octave_value& v)
+        set_xticklabelmode ("manual");
+    }
+}
+
+void
+axes::properties::set_yticklabel (const octave_value& v)
 {
   if (!error_state)
     {
-      if (yticklabel.set(convert_ticklabel_string(v), false))
-        {
-          set_yticklabelmode("manual");
-          yticklabel.run_listeners(POSTSET);
-          mark_modified();
+      if (yticklabel.set (convert_ticklabel_string (v), false))
+        {
+          set_yticklabelmode ("manual");
+          yticklabel.run_listeners (POSTSET);
+          mark_modified ();
         }
       else
-        set_yticklabelmode("manual");
-    }
-}
-
-void
-axes::properties::set_zticklabel(const octave_value& v)
+        set_yticklabelmode ("manual");
+    }
+}
+
+void
+axes::properties::set_zticklabel (const octave_value& v)
 {
   if (!error_state)
     {
-      if (zticklabel.set(convert_ticklabel_string(v), false))
-        {
-          set_zticklabelmode("manual");
-          zticklabel.run_listeners(POSTSET);
-          mark_modified();
+      if (zticklabel.set (convert_ticklabel_string (v), false))
+        {
+          set_zticklabelmode ("manual");
+          zticklabel.run_listeners (POSTSET);
+          mark_modified ();
         }
       else
-        set_zticklabelmode("manual");
+        set_zticklabelmode ("manual");
     }
 }
 
@@ -5864,6 +5704,7 @@
   position.set (octave_value (convert_position (get_position ().matrix_value (), old_units, new_units, parent_bb)), false);
   outerposition.set (octave_value (convert_position (get_outerposition ().matrix_value (), old_units, new_units, parent_bb)), false);
   tightinset.set (octave_value (convert_position (get_tightinset ().matrix_value (), old_units, new_units, parent_bb)), false);
+  looseinset.set (octave_value (convert_position (get_looseinset ().matrix_value (), old_units, new_units, parent_bb)), false);
 }
 
 void
@@ -5971,16 +5812,16 @@
                   const array_property& data)
 {
   double val = data.min_val ();
-  if (! (xisinf (val) || xisnan (val)) && val < min_val)
+  if (xfinite (val) && val < min_val)
     min_val = val;
   val = data.max_val ();
-  if (! (xisinf (val) || xisnan (val)) && val > max_val)
+  if (xfinite (val) && val > max_val)
     max_val = val;
   val = data.min_pos ();
-  if (! (xisinf (val) || xisnan (val)) && val > 0 && val < min_pos)
+  if (xfinite (val) && val > 0 && val < min_pos)
     min_pos = val;
   val = data.max_neg ();
-  if (! (xisinf (val) || xisnan (val)) && val < 0 && val > max_neg)
+  if (xfinite (val) && val < 0 && val > max_neg)
     max_neg = val;
 }
 */
@@ -5999,19 +5840,19 @@
           double val;
 
           val = m(0);
-          if (! (xisinf (val) || xisnan (val)) && val < min_val)
+          if (xfinite (val) && val < min_val)
             min_val = val;
 
           val = m(1);
-          if (! (xisinf (val) || xisnan (val)) && val > max_val)
+          if (xfinite (val) && val > max_val)
             max_val = val;
 
           val = m(2);
-          if (! (xisinf (val) || xisnan (val)) && val > 0 && val < min_pos)
+          if (xfinite (val) && val > 0 && val < min_pos)
             min_pos = val;
 
           val = m(3);
-          if (! (xisinf (val) || xisnan (val)) && val < 0 && val > max_neg)
+          if (xfinite (val) && val < 0 && val > max_neg)
             max_neg = val;
         }
     }
@@ -6346,13 +6187,16 @@
       double val = ticks(i);
       if (limits(0) <= val && val <= limits(1))
         {
+          std::string label (ticklabels(i));
+          label.erase (0, label.find_first_not_of (" "));
+          label = label.substr (0, label.find_last_not_of (" ")+1);
 #ifdef HAVE_FREETYPE
-          ext = text_renderer.get_extent (ticklabels(i));
+          ext = text_renderer.get_extent (label);
           wmax = std::max (wmax, ext(0));
           hmax = std::max (hmax, ext(1));
 #else
-          //FIXME: find a better approximation
-          int len = ticklabels(i).length ();
+          // FIXME: find a better approximation
+          int len = label.length ();
           wmax = std::max (wmax, 0.5*fontsize*len);
           hmax = fontsize;
 #endif
@@ -6473,16 +6317,16 @@
   if (limits.numel () == 4) \
     { \
       val = limits(0); \
-      if (! (xisinf (val) || xisnan (val))) \
+      if (xfinite (val)) \
         min_val = val; \
       val = limits(1); \
-      if (! (xisinf (val) || xisnan (val))) \
+      if (xfinite (val)) \
         max_val = val; \
       val = limits(2); \
-      if (! (xisinf (val) || xisnan (val))) \
+      if (xfinite (val)) \
         min_pos = val; \
       val = limits(3); \
-      if (! (xisinf (val) || xisnan (val))) \
+      if (xfinite (val)) \
         max_neg = val; \
     } \
   else \
@@ -7072,6 +6916,8 @@
   xinitialize (xproperties.get_xlabel ());
   xinitialize (xproperties.get_ylabel ());
   xinitialize (xproperties.get_zlabel ());
+
+  xproperties.sync_positions ();
 }
 
 // ---------------------------------------------------------------------
@@ -7458,16 +7304,16 @@
   if (limits.numel () == 4)
     {
       val = limits(0);
-      if (! (xisinf (val) || xisnan (val)))
+      if (xfinite (val))
         min_val = val;
       val = limits(1);
-      if (! (xisinf (val) || xisnan (val)))
+      if (xfinite (val))
         max_val = val;
       val = limits(2);
-      if (! (xisinf (val) || xisnan (val)))
+      if (xfinite (val))
         min_pos = val;
       val = limits(3);
-      if (! (xisinf (val) || xisnan (val)))
+      if (xfinite (val))
         max_neg = val;
     }
   else
@@ -8587,6 +8433,7 @@
 elements of @var{pv} will be set in all handles in @var{h} independent of\n\
 the dimensions of @var{pv}.\n\
 @end itemize\n\
+@seealso{get}\n\
 @end deftypefn")
 {
   gh_manager::auto_lock guard;
@@ -8694,11 +8541,13 @@
 
 DEFUN (get, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} get (@var{h}, @var{p})\n\
-Return the named property @var{p} from the graphics handle @var{h}.\n\
-If @var{p} is omitted, return the complete property list for @var{h}.\n\
-If @var{h} is a vector, return a cell array including the property\n\
+@deftypefn  {Built-in Function} {@var{val} =} get (@var{h})\n\
+@deftypefnx {Built-in Function} {@var{val} =} get (@var{h}, @var{p})\n\
+Return the value of the named property @var{p} from the graphics handle\n\
+@var{h}.  If @var{p} is omitted, return the complete property list for\n\
+@var{h}.  If @var{h} is a vector, return a cell array including the property\n\
 values or lists respectively.\n\
+@seealso{set}\n\
 @end deftypefn")
 {
   gh_manager::auto_lock guard;
@@ -9935,7 +9784,7 @@
 A string property.  @var{arg} contains the default string value.\n\
 \n\
 @item any\n\
-An un-typed property.  This kind of property can hold any octave\n\
+An @nospell{un-typed} property.  This kind of property can hold any octave\n\
 value.  @var{args} contains the default value.\n\
 \n\
 @item radio\n\
rename from libinterp/interpfcn/graphics.in.h
rename to libinterp/corefcn/graphics.in.h
--- a/libinterp/interpfcn/graphics.in.h
+++ b/libinterp/corefcn/graphics.in.h
@@ -47,7 +47,7 @@
 #include "txt-render.h"
 #include "txt-eng-ft.h"
 
-// FIXME -- maybe this should be a configure option?
+// FIXME: maybe this should be a configure option?
 // Matlab defaults to "Helvetica", but that causes problems for many
 // gnuplot users.
 #if !defined (OCTAVE_DEFAULT_FONTNAME)
@@ -578,8 +578,8 @@
   enum desired_enum { string_t, cell_t };
 
   string_array_property (const std::string& s, const graphics_handle& h,
-                  const std::string& val = "", const char& sep = '|',
-                  const desired_enum& typ = string_t)
+                         const std::string& val = "", const char& sep = '|',
+                         const desired_enum& typ = string_t)
     : base_property (s, h), desired_type (typ), separator (sep), str ()
     {
       size_t pos = 0;
@@ -601,8 +601,8 @@
     }
 
   string_array_property (const std::string& s, const graphics_handle& h,
-                  const Cell& c, const char& sep = '|',
-                  const desired_enum& typ = string_t)
+                         const Cell& c, const char& sep = '|',
+                         const desired_enum& typ = string_t)
     : base_property (s, h), desired_type (typ), separator (sep), str ()
     {
       if (c.is_cellstr ())
@@ -660,13 +660,14 @@
 protected:
   bool do_set (const octave_value& val)
     {
-      if (val.is_string ())
+      if (val.is_string () && val.rows () == 1)
         {
           bool replace = false;
           std::string new_str = val.string_value ();
           string_vector strings;
           size_t pos = 0;
 
+          // Split single string on delimiter (usually '|')
           while (pos != std::string::npos)
             {
               size_t new_pos = new_str.find_first_of (separator, pos);
@@ -702,6 +703,30 @@
               return true;
             }
         }
+      else if (val.is_string ())  // multi-row character matrix
+        {
+          bool replace = false;
+          charMatrix chm = val.char_matrix_value ();
+          octave_idx_type nel = chm.rows ();
+          string_vector strings (nel);
+
+          if (nel != str.numel ())
+            replace = true;
+          for (octave_idx_type i = 0; i < nel; i++)
+            {
+              strings[i] = chm.row_as_string (i);
+              if (!replace && strings[i] != str[i])
+                replace = true;
+            }
+
+          desired_type = string_t;
+
+          if (replace)
+            {
+              str = strings;
+              return true;
+            }
+        }
       else if (val.is_cellstr ())
         {
           bool replace = false;
@@ -1459,7 +1484,7 @@
 
       if (validate (tmp))
         {
-          // FIXME -- should we check for actual data change?
+          // FIXME: should we check for actual data change?
           if (! is_equal (tmp))
             {
               data = tmp;
@@ -2337,7 +2362,7 @@
 
 private:
 
-  // FIXME -- default toolkit should be configurable.
+  // FIXME: default toolkit should be configurable.
 
   gtk_manager (void)
     : dtk ("gnuplot"), available_toolkits (), loaded_toolkits () { }
@@ -2604,22 +2629,22 @@
 
   static property_list::pval_map_type factory_defaults (void);
 
-  // FIXME -- these functions should be generated automatically by the
-  // genprops.awk script.
+  // FIXME: these functions should be generated automatically by the
+  //        genprops.awk script.
   //
   // EMIT_BASE_PROPERTIES_GET_FUNCTIONS
 
+  virtual octave_value get_alim (void) const { return octave_value (); }
+  virtual octave_value get_clim (void) const { return octave_value (); }
   virtual octave_value get_xlim (void) const { return octave_value (); }
   virtual octave_value get_ylim (void) const { return octave_value (); }
   virtual octave_value get_zlim (void) const { return octave_value (); }
-  virtual octave_value get_clim (void) const { return octave_value (); }
-  virtual octave_value get_alim (void) const { return octave_value (); }
-
+
+  virtual bool is_aliminclude (void) const { return false; }
+  virtual bool is_climinclude (void) const { return false; }
   virtual bool is_xliminclude (void) const { return false; }
   virtual bool is_yliminclude (void) const { return false; }
   virtual bool is_zliminclude (void) const { return false; }
-  virtual bool is_climinclude (void) const { return false; }
-  virtual bool is_aliminclude (void) const { return false; }
 
   bool is_handle_visible (void) const;
 
@@ -2655,13 +2680,12 @@
     bool_property selectionhighlight , "on"
     string_property tag s , ""
     string_property type frs , ty
+    handle_property uicontextmenu , graphics_handle ()
     any_property userdata , Matrix ()
     bool_property visible , "on"
-    // additional (octave-specific) properties
+    // additional (Octave-specific) properties
     bool_property __modified__ s , "on"
     graphics_handle __myhandle__ fhrs , mh
-    // FIXME -- should this really be here?
-    handle_property uicontextmenu , graphics_handle ()
   END_PROPERTIES
 
 protected:
@@ -3086,11 +3110,17 @@
 
   operator bool (void) const { return rep->valid_object (); }
 
-  // FIXME -- these functions should be generated automatically by the
-  // genprops.awk script.
+  // FIXME: these functions should be generated automatically by the
+  //        genprops.awk script.
   //
   // EMIT_GRAPHICS_OBJECT_GET_FUNCTIONS
 
+  octave_value get_alim (void) const
+  { return get_properties ().get_alim (); }
+
+  octave_value get_clim (void) const
+  { return get_properties ().get_clim (); }
+
   octave_value get_xlim (void) const
   { return get_properties ().get_xlim (); }
 
@@ -3100,11 +3130,11 @@
   octave_value get_zlim (void) const
   { return get_properties ().get_zlim (); }
 
-  octave_value get_clim (void) const
-  { return get_properties ().get_clim (); }
-
-  octave_value get_alim (void) const
-  { return get_properties ().get_alim (); }
+  bool is_aliminclude (void) const
+  { return get_properties ().is_aliminclude (); }
+
+  bool is_climinclude (void) const
+  { return get_properties ().is_climinclude (); }
 
   bool is_xliminclude (void) const
   { return get_properties ().is_xliminclude (); }
@@ -3115,12 +3145,6 @@
   bool is_zliminclude (void) const
   { return get_properties ().is_zliminclude (); }
 
-  bool is_climinclude (void) const
-  { return get_properties ().is_climinclude (); }
-
-  bool is_aliminclude (void) const
-  { return get_properties ().is_aliminclude (); }
-
   bool is_handle_visible (void) const
   { return get_properties ().is_handle_visible (); }
 
@@ -3163,14 +3187,22 @@
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
-    // FIXME -- it seems strange to me that the diary, diaryfile,
-    // echo, format, formatspacing, language, and recursionlimit
-    // properties are here.  WTF do they have to do with graphics?
+    // FIXME: it seems strange to me that the diary, diaryfile,
+    // echo, errormessage, format, formatspacing, language, and
+    // recursionlimit properties are here.
+    // WTF do they have to do with graphics?
     // Also note that these properties (and the monitorpositions,
     // pointerlocation, and pointerwindow properties) are not yet used
     // by Octave, so setting them will have no effect, and changes
     // made elswhere (say, the diary or format functions) will not
     // cause these properties to be updated.
+    // ANSWER: Matlab defines these properties and uses them in
+    // the same way that Octave uses an internal static variable to
+    // keep track of state.  set (0, "echo", "on") is equivalent
+    // to Octave's echo ("on").  Maybe someday we can connect callbacks
+    // that actually call Octave's own functions for this.
+
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (root_figure, root)
       handle_property callbackobject Sr , graphics_handle ()
@@ -3179,12 +3211,14 @@
       bool_property diary , "off"
       string_property diaryfile , "diary"
       bool_property echo , "off"
-      radio_property format , "+|bank|bit|debug|hex|long|longe|longeng|longg|native-bit|native-hex|rational|{short}|shorte|shorteng|shortg"
-      radio_property formatspacing , "{loose}|compact"
+      string_property errormessage , ""
+      string_property fixedwidthfontname , "Courier"
+      radio_property format , "+|bank|bit|hex|long|longe|longeng|longg|native-bit|native-hex|none|rational|{short}|shorte|shorteng|shortg"
+      radio_property formatspacing , "compact|{loose}"
       string_property language , "ascii"
       array_property monitorpositions , Matrix (1, 4, 0)
       array_property pointerlocation , Matrix (1, 2, 0)
-      double_property pointerwindow , 0.0
+      double_property pointerwindow r , 0.0
       double_property recursionlimit , 256.0
       double_property screendepth r , default_screendepth ()
       double_property screenpixelsperinch r , default_screenpixelsperinch ()
@@ -3369,17 +3403,15 @@
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (figure)
-      any_property __plot_stream__ h , Matrix ()
-      bool_property __enhanced__ h , "on"
-      radio_property nextplot , "new|{add}|replacechildren|replace"
+      array_property alphamap , Matrix (64, 1, 1)
+      callback_property buttondownfcn , Matrix ()
       callback_property closerequestfcn , "closereq"
+      color_property color , color_property (color_values (1, 1, 1), radio_values ("none"))
+      array_property colormap , jet_colormap ()
       handle_property currentaxes S , graphics_handle ()
-      array_property colormap , jet_colormap ()
-      radio_property paperorientation U , "{portrait}|landscape|rotated"
-      color_property color , color_property (color_values (1, 1, 1), radio_values ("none"))
-      array_property alphamap , Matrix (64, 1, 1)
       string_property currentcharacter r , ""
       handle_property currentobject r , graphics_handle ()
       array_property currentpoint r , Matrix (2, 1, 0)
@@ -3393,13 +3425,15 @@
       radio_property menubar , "none|{figure}"
       double_property mincolormap , 64
       string_property name , ""
+      radio_property nextplot , "new|{add}|replacechildren|replace"
       bool_property numbertitle , "on"
       array_property outerposition s , Matrix (1, 4, -1.0)
-      radio_property paperunits Su , "{inches}|centimeters|normalized|points"
+      radio_property paperorientation U , "{portrait}|landscape|rotated"
       array_property paperposition , default_figure_paperposition ()
       radio_property paperpositionmode , "auto|{manual}"
       array_property papersize U , default_figure_papersize ()
       radio_property papertype SU , "{usletter}|uslegal|a0|a1|a2|a3|a4|a5|b0|b1|b2|b3|b4|b5|arch-a|arch-b|arch-c|arch-d|arch-e|a|b|c|d|e|tabloid|<custom>"
+      radio_property paperunits Su , "{inches}|centimeters|normalized|points"
       radio_property pointer , "crosshair|fullcrosshair|{arrow}|ibeam|watch|topl|topr|botl|botr|left|top|right|bottom|circle|cross|fleur|custom|hand"
       array_property pointershapecdata , Matrix (16, 16, 0)
       array_property pointershapehotspot , Matrix (1, 2, 0)
@@ -3414,16 +3448,20 @@
       callback_property windowbuttondownfcn , Matrix ()
       callback_property windowbuttonmotionfcn , Matrix ()
       callback_property windowbuttonupfcn , Matrix ()
-      callback_property windowbuttonwheelfcn , Matrix ()
+      callback_property windowkeypressfcn , Matrix ()
+      callback_property windowkeyreleasefcn , Matrix ()
+      callback_property windowscrollwheelfcn , Matrix ()
       radio_property windowstyle , "{normal}|modal|docked"
       string_property wvisual , ""
       radio_property wvisualmode , "{auto}|manual"
       string_property xdisplay , ""
       string_property xvisual , ""
       radio_property xvisualmode , "{auto}|manual"
-      callback_property buttondownfcn , Matrix ()
+      // Octave-specific properties
+      bool_property __enhanced__ h , "on"
       string_property __graphics_toolkit__ s , "gnuplot"
       any_property __guidata__ h , Matrix ()
+      any_property __plot_stream__ h , Matrix ()
     END_PROPERTIES
 
   protected:
@@ -3638,6 +3676,8 @@
         update_axes_layout ();
       }
 
+    void sync_positions (void);
+
     void update_autopos (const std::string& elem_type);
     void update_xlabel_position (void);
     void update_ylabel_position (void);
@@ -3738,80 +3778,29 @@
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
-
-    // properties which are not in matlab: interpreter
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (axes)
-      array_property position u , default_axes_position ()
+      radio_property activepositionproperty , "{outerposition}|position"
+      row_vector_property alim m , default_lim ()
+      radio_property alimmode , "{auto}|manual"
+      color_property ambientlightcolor , color_values (1, 1, 1)
       bool_property box , "on"
+      array_property cameraposition m , Matrix (1, 3, 0.0)
+      radio_property camerapositionmode , "{auto}|manual"
+      array_property cameratarget m , Matrix (1, 3, 0.0)
+      radio_property cameratargetmode , "{auto}|manual"
+      array_property cameraupvector m , Matrix ()
+      radio_property cameraupvectormode , "{auto}|manual"
+      double_property cameraviewangle m , 10.0
+      radio_property cameraviewanglemode , "{auto}|manual"
+      row_vector_property clim m , default_lim ()
+      radio_property climmode al , "{auto}|manual"
+      color_property color , color_property (color_values (1, 1, 1), radio_values ("none"))
       array_property colororder , default_colororder ()
+      array_property currentpoint , Matrix (2, 3, 0.0)
       array_property dataaspectratio mu , Matrix (1, 3, 1.0)
       radio_property dataaspectratiomode u , "{auto}|manual"
-      radio_property layer u , "{bottom}|top"
-      row_vector_property xlim mu , default_lim ()
-      row_vector_property ylim mu , default_lim ()
-      row_vector_property zlim mu , default_lim ()
-      row_vector_property clim m , default_lim ()
-      row_vector_property alim m , default_lim ()
-      radio_property xlimmode al , "{auto}|manual"
-      radio_property ylimmode al , "{auto}|manual"
-      radio_property zlimmode al , "{auto}|manual"
-      radio_property climmode al , "{auto}|manual"
-      radio_property alimmode    , "{auto}|manual"
-      handle_property xlabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
-      handle_property ylabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
-      handle_property zlabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
-      handle_property title SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
-      bool_property xgrid , "off"
-      bool_property ygrid , "off"
-      bool_property zgrid , "off"
-      bool_property xminorgrid , "off"
-      bool_property yminorgrid , "off"
-      bool_property zminorgrid , "off"
-      row_vector_property xtick mu , default_axes_tick ()
-      row_vector_property ytick mu , default_axes_tick ()
-      row_vector_property ztick mu , default_axes_tick ()
-      radio_property xtickmode u , "{auto}|manual"
-      radio_property ytickmode u , "{auto}|manual"
-      radio_property ztickmode u , "{auto}|manual"
-      bool_property xminortick , "off"
-      bool_property yminortick , "off"
-      bool_property zminortick , "off"
-      // FIXME -- should be kind of string array.
-      any_property xticklabel S , ""
-      any_property yticklabel S , ""
-      any_property zticklabel S , ""
-      radio_property xticklabelmode u , "{auto}|manual"
-      radio_property yticklabelmode u , "{auto}|manual"
-      radio_property zticklabelmode u , "{auto}|manual"
-      radio_property interpreter , "tex|{none}|latex"
-      color_property color , color_property (color_values (1, 1, 1), radio_values ("none"))
-      color_property xcolor , color_values (0, 0, 0)
-      color_property ycolor , color_values (0, 0, 0)
-      color_property zcolor , color_values (0, 0, 0)
-      radio_property xscale alu , "{linear}|log"
-      radio_property yscale alu , "{linear}|log"
-      radio_property zscale alu , "{linear}|log"
-      radio_property xdir u , "{normal}|reverse"
-      radio_property ydir u , "{normal}|reverse"
-      radio_property zdir u , "{normal}|reverse"
-      radio_property yaxislocation u , "{left}|right|zero"
-      radio_property xaxislocation u , "{bottom}|top|zero"
-      array_property view u , Matrix ()
-      bool_property __hold_all__ h , "off"
-      radio_property nextplot , "new|add|replacechildren|{replace}"
-      array_property outerposition u , default_axes_outerposition ()
-      radio_property activepositionproperty , "{outerposition}|position"
-      color_property ambientlightcolor , color_values (1, 1, 1)
-      array_property cameraposition m , Matrix (1, 3, 0.0)
-      array_property cameratarget m , Matrix (1, 3, 0.0)
-      array_property cameraupvector m , Matrix ()
-      double_property cameraviewangle m , 10.0
-      radio_property camerapositionmode , "{auto}|manual"
-      radio_property cameratargetmode , "{auto}|manual"
-      radio_property cameraupvectormode , "{auto}|manual"
-      radio_property cameraviewanglemode , "{auto}|manual"
-      array_property currentpoint , Matrix (2, 3, 0.0)
       radio_property drawmode , "{normal}|fast"
       radio_property fontangle u , "{normal}|italic|oblique"
       string_property fontname u , OCTAVE_DEFAULT_FONTNAME
@@ -3819,18 +3808,75 @@
       radio_property fontunits SU , "{points}|normalized|inches|centimeters|pixels"
       radio_property fontweight u , "{normal}|light|demi|bold"
       radio_property gridlinestyle , "-|--|{:}|-.|none"
+      // NOTE: interpreter is not a Matlab axis property, but it makes
+      //       more sense to have it so that axis ticklabels can use it.
+      radio_property interpreter , "tex|{none}|latex"
+      radio_property layer u , "{bottom}|top"
       string_array_property linestyleorder , "-"
       double_property linewidth , 0.5
       radio_property minorgridlinestyle , "-|--|{:}|-.|none"
+      radio_property nextplot , "add|replacechildren|{replace}"
+      array_property outerposition u , default_axes_outerposition ()
       array_property plotboxaspectratio mu , Matrix (1, 3, 1.0)
       radio_property plotboxaspectratiomode u , "{auto}|manual"
+      array_property position u , default_axes_position ()
       radio_property projection , "{orthographic}|perpective"
       radio_property tickdir mu , "{in}|out"
       radio_property tickdirmode u , "{auto}|manual"
       array_property ticklength u , default_axes_ticklength ()
       array_property tightinset r , Matrix (1, 4, 0.0)
-      // FIXME -- uicontextmenu should be moved here.
+      handle_property title SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
+      // FIXME: uicontextmenu should be moved here.
       radio_property units SU , "{normalized}|inches|centimeters|points|pixels|characters"
+      array_property view u , Matrix ()
+      radio_property xaxislocation u , "{bottom}|top|zero"
+      color_property xcolor , color_values (0, 0, 0)
+      radio_property xdir u , "{normal}|reverse"
+      bool_property xgrid , "off"
+      handle_property xlabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
+      row_vector_property xlim mu , default_lim ()
+      radio_property xlimmode al , "{auto}|manual"
+      bool_property xminorgrid , "off"
+      bool_property xminortick , "off"
+      radio_property xscale alu , "{linear}|log"
+      row_vector_property xtick mu , default_axes_tick ()
+      // FIXME: should be kind of string array.
+      any_property xticklabel S , ""
+      radio_property xticklabelmode u , "{auto}|manual"
+      radio_property xtickmode u , "{auto}|manual"
+      radio_property yaxislocation u , "{left}|right|zero"
+      color_property ycolor , color_values (0, 0, 0)
+      radio_property ydir u , "{normal}|reverse"
+      bool_property ygrid , "off"
+      handle_property ylabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
+      row_vector_property ylim mu , default_lim ()
+      radio_property ylimmode al , "{auto}|manual"
+      bool_property yminorgrid , "off"
+      bool_property yminortick , "off"
+      radio_property yscale alu , "{linear}|log"
+      row_vector_property ytick mu , default_axes_tick ()
+      any_property yticklabel S , ""
+      radio_property yticklabelmode u , "{auto}|manual"
+      radio_property ytickmode u , "{auto}|manual"
+      color_property zcolor , color_values (0, 0, 0)
+      radio_property zdir u , "{normal}|reverse"
+      bool_property zgrid , "off"
+      handle_property zlabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
+      row_vector_property zlim mu , default_lim ()
+      radio_property zlimmode al , "{auto}|manual"
+      bool_property zminorgrid , "off"
+      bool_property zminortick , "off"
+      radio_property zscale alu , "{linear}|log"
+      row_vector_property ztick mu , default_axes_tick ()
+      any_property zticklabel S , ""
+      radio_property zticklabelmode u , "{auto}|manual"
+      radio_property ztickmode u , "{auto}|manual"
+      // Octave-specific properties
+      bool_property __hold_all__ h , "off"
+      // hidden properties for alignment of subplots
+      radio_property autopos_tag h , "{none}|subplot"
+      // hidden properties for inset
+      array_property looseinset hu , Matrix (1, 4, 0.0)
       // hidden properties for transformation computation
       array_property x_viewtransform h , Matrix (4, 4, 0.0)
       array_property x_projectiontransform h , Matrix (4, 4, 0.0)
@@ -3841,10 +3887,6 @@
       row_vector_property xmtick h , Matrix ()
       row_vector_property ymtick h , Matrix ()
       row_vector_property zmtick h , Matrix ()
-      // hidden properties for inset
-      array_property looseinset hu , Matrix (1, 4, 0.0)
-      // hidden properties for alignment of subplots
-      radio_property autopos_tag h , "{none}|subplot"
    END_PROPERTIES
 
   protected:
@@ -3967,22 +4009,85 @@
     void update_fontangle (void) { update_font (); }
     void update_fontweight (void) { update_font (); }
 
-    void sync_positions (const Matrix& linset);
-    void sync_positions (void);
-
     void update_outerposition (void)
     {
       set_activepositionproperty ("outerposition");
-      sync_positions ();
+      caseless_str old_units = get_units ();
+      set_units ("normalized");
+      Matrix outerbox = outerposition.get ().matrix_value ();
+      Matrix innerbox = position.get ().matrix_value ();
+      Matrix linset = looseinset.get ().matrix_value ();
+      Matrix tinset = tightinset.get ().matrix_value ();
+      outerbox(2) = outerbox(2) + outerbox(0);
+      outerbox(3) = outerbox(3) + outerbox(1);
+      innerbox(0) = outerbox(0) + std::max (linset(0), tinset(0));
+      innerbox(1) = outerbox(1) + std::max (linset(1), tinset(1));
+      innerbox(2) = outerbox(2) - std::max (linset(2), tinset(2));
+      innerbox(3) = outerbox(3) - std::max (linset(3), tinset(3));
+      innerbox(2) = innerbox(2) - innerbox(0);
+      innerbox(3) = innerbox(3) - innerbox(1);
+      position = innerbox;
+      set_units (old_units);
+      update_transform ();
     }
 
     void update_position (void)
     {
       set_activepositionproperty ("position");
-      sync_positions ();
+      caseless_str old_units = get_units ();
+      set_units ("normalized");
+      Matrix outerbox = outerposition.get ().matrix_value ();
+      Matrix innerbox = position.get ().matrix_value ();
+      Matrix linset = looseinset.get ().matrix_value ();
+      Matrix tinset = tightinset.get ().matrix_value ();
+      innerbox(2) = innerbox(2) + innerbox(0);
+      innerbox(3) = innerbox(3) + innerbox(1);
+      outerbox(0) = innerbox(0) - std::max (linset(0), tinset(0));
+      outerbox(1) = innerbox(1) - std::max (linset(1), tinset(1));
+      outerbox(2) = innerbox(2) + std::max (linset(2), tinset(2));
+      outerbox(3) = innerbox(3) + std::max (linset(3), tinset(3));
+      outerbox(2) = outerbox(2) - outerbox(0);
+      outerbox(3) = outerbox(3) - outerbox(1);
+      outerposition = outerbox;
+      set_units (old_units);
+      update_transform ();
     }
 
-    void update_looseinset (void) { sync_positions (); }
+    void update_looseinset (void)
+      {
+        caseless_str old_units = get_units ();
+        set_units ("normalized");
+        Matrix innerbox = position.get ().matrix_value ();
+        innerbox(2) = innerbox(2) + innerbox(0);
+        innerbox(3) = innerbox(3) + innerbox(1);
+        Matrix outerbox = outerposition.get ().matrix_value ();
+        outerbox(2) = outerbox(2) + outerbox(0);
+        outerbox(3) = outerbox(3) + outerbox(1);
+        Matrix linset = looseinset.get ().matrix_value ();
+        Matrix tinset = tightinset.get ().matrix_value ();
+        if (activepositionproperty.is ("position"))
+          {
+            outerbox(0) = innerbox(0) - std::max (linset(0), tinset(0));
+            outerbox(1) = innerbox(1) - std::max (linset(1), tinset(1));
+            outerbox(2) = innerbox(2) + std::max (linset(2), tinset(2));
+            outerbox(3) = innerbox(3) + std::max (linset(3), tinset(3));
+            outerbox(2) = outerbox(2) - outerbox(0);
+            outerbox(3) = outerbox(3) - outerbox(1);
+            outerposition = outerbox;
+          }
+        else
+          {
+            innerbox(0) = outerbox(0) + std::max (linset(0), tinset(0));
+            innerbox(1) = outerbox(1) + std::max (linset(1), tinset(1));
+            innerbox(2) = outerbox(2) - std::max (linset(2), tinset(2));
+            innerbox(3) = outerbox(3) - std::max (linset(3), tinset(3));
+            innerbox(2) = innerbox(2) - innerbox(0);
+            innerbox(3) = innerbox(3) - innerbox(1);
+            position = innerbox;
+          }
+        set_units (old_units);
+        update_transform ();
+      }
 
     double calc_tick_sep (double minval, double maxval);
     void calc_ticks_and_lims (array_property& lims, array_property& ticks, array_property& mticks,
@@ -4119,7 +4224,7 @@
   {
     octave_value retval;
 
-    // FIXME -- finish this.
+    // FIXME: finish this.
     if (name.compare ("default", 7))
       retval = get_default (name.substr (7));
     else
@@ -4165,26 +4270,28 @@
   public:
     // See the genprops.awk script for an explanation of the
     // properties declarations.
-
-    // properties which are not in matlab: interpreter
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (line)
-      row_vector_property xdata u , default_data ()
-      row_vector_property ydata u , default_data ()
-      row_vector_property zdata u , Matrix ()
-      string_property xdatasource , ""
-      string_property ydatasource , ""
-      string_property zdatasource , ""
       color_property color , color_values (0, 0, 0)
+      string_property displayname , ""
+      radio_property erasemode , "{normal}|none|xor|background"
+      // FIXME: interpreter is not a property of Matlab line objects.
+      //        Octave uses this for legend() with the string displayname.
+      radio_property interpreter , "{tex}|none|latex"
       radio_property linestyle , "{-}|--|:|-.|none"
       double_property linewidth , 0.5
-      radio_property marker , "{none}|s|o|x|+|.|*|<|>|v|^|d|p|h|@"
+      radio_property marker , "{none}|+|o|*|.|x|s|d|^|v|>|<|p|h"
       color_property markeredgecolor , "{auto}|none"
       color_property markerfacecolor , "auto|{none}"
       double_property markersize , 6
-      radio_property interpreter , "{tex}|none|latex"
-      string_property displayname , ""
-      radio_property erasemode , "{normal}|none|xor|background"
+      row_vector_property xdata u , default_data ()
+      string_property xdatasource , ""
+      row_vector_property ydata u , default_data ()
+      string_property ydatasource , ""
+      row_vector_property zdata u , Matrix ()
+      string_property zdatasource , ""
+
       // hidden properties for limit computation
       row_vector_property xlim hlr , Matrix ()
       row_vector_property ylim hlr , Matrix ()
@@ -4267,28 +4374,29 @@
     // properties declarations.
 
     BEGIN_PROPERTIES (text)
-      text_label_property string u , ""
-      radio_property units u , "{data}|pixels|normalized|inches|centimeters|points"
-      array_property position smu , Matrix (1, 3, 0.0)
-      double_property rotation mu , 0
-      radio_property horizontalalignment mu , "{left}|center|right"
+      color_property backgroundcolor , "{none}"
       color_property color u , color_values (0, 0, 0)
+      string_property displayname , ""
+      color_property edgecolor , "{none}"
+      bool_property editing , "off"
+      radio_property erasemode , "{normal}|none|xor|background"
+      array_property extent rG , Matrix (1, 4, 0.0)
+      radio_property fontangle u , "{normal}|italic|oblique"
       string_property fontname u , OCTAVE_DEFAULT_FONTNAME
       double_property fontsize u , 10
-      radio_property fontangle u , "{normal}|italic|oblique"
+      radio_property fontunits , "inches|centimeters|normalized|{points}|pixels"
       radio_property fontweight u , "light|{normal}|demi|bold"
+      radio_property horizontalalignment mu , "{left}|center|right"
       radio_property interpreter u , "{tex}|none|latex"
-      color_property backgroundcolor , "{none}"
-      string_property displayname , ""
-      color_property edgecolor , "{none}"
-      radio_property erasemode , "{normal}|none|xor|background"
-      bool_property editing , "off"
-      radio_property fontunits , "inches|centimeters|normalized|{points}|pixels"
       radio_property linestyle , "{-}|--|:|-.|none"
       double_property linewidth , 0.5
       double_property margin , 1
+      array_property position smu , Matrix (1, 3, 0.0)
+      double_property rotation mu , 0
+      text_label_property string u , ""
+      radio_property units u , "{data}|pixels|normalized|inches|centimeters|points"
       radio_property verticalalignment mu , "top|cap|{middle}|baseline|bottom"
-      array_property extent rG , Matrix (1, 4, 0.0)
+
       // hidden properties for limit computation
       row_vector_property xlim hlr , Matrix ()
       row_vector_property ylim hlr , Matrix ()
@@ -4358,7 +4466,7 @@
     void update_font (void);
     void update_string (void) { request_autopos (); update_text_extent (); }
     void update_rotation (void) { update_text_extent (); }
-    void update_color (void) { update_font (); }
+    void update_color (void) { update_font (); update_text_extent (); }
     void update_fontname (void) { update_font (); update_text_extent (); }
     void update_fontsize (void) { update_font (); update_text_extent (); }
     void update_fontangle (void) { update_font (); update_text_extent (); }
@@ -4402,6 +4510,11 @@
   class OCTINTERP_API properties : public base_properties
   {
   public:
+    bool is_aliminclude (void) const
+      { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); }
+    std::string get_aliminclude (void) const
+      { return aliminclude.current_value (); }
+
     bool is_climinclude (void) const
       { return (climinclude.is_on () && cdatamapping.is ("scaled")); }
     std::string get_climinclude (void) const
@@ -4411,19 +4524,25 @@
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (image)
+      array_property alphadata u , Matrix ()
+      radio_property alphadatamapping al , "none|direct|{scaled}"
+      array_property cdata u , Matrix ()
+      radio_property cdatamapping al , "scaled|{direct}"
+      radio_property erasemode , "{normal}|none|xor|background"
       row_vector_property xdata u , Matrix ()
       row_vector_property ydata u , Matrix ()
-      array_property cdata u , Matrix ()
-      radio_property cdatamapping al , "{scaled}|direct"
       // hidden properties for limit computation
+      row_vector_property alim hlr , Matrix ()
+      row_vector_property clim hlr , Matrix ()
       row_vector_property xlim hlr , Matrix ()
       row_vector_property ylim hlr , Matrix ()
-      row_vector_property clim hlr , Matrix ()
+      bool_property aliminclude hlg , "on"
+      bool_property climinclude hlg , "on"
       bool_property xliminclude hl , "on"
       bool_property yliminclude hl , "on"
-      bool_property climinclude hlg , "on"
     END_PROPERTIES
 
   protected:
@@ -4443,6 +4562,22 @@
       }
 
   private:
+    void update_alphadata (void)
+      {
+        if (alphadatamapping_is ("scaled"))
+          set_alim (alphadata.get_limits ());
+        else
+          alim = alphadata.get_limits ();
+      }
+
+    void update_cdata (void)
+      {
+        if (cdatamapping_is ("scaled"))
+          set_clim (cdata.get_limits ());
+        else
+          clim = cdata.get_limits ();
+      }
+
     void update_xdata (void)
     {
       Matrix limits = xdata.get_limits ();
@@ -4463,14 +4598,6 @@
       set_ylim (limits);
     }
 
-    void update_cdata (void)
-      {
-        if (cdatamapping_is ("scaled"))
-          set_clim (cdata.get_limits ());
-        else
-          clim = cdata.get_limits ();
-      }
-
     float pixel_size (octave_idx_type dim, const Matrix limits)
     {
       octave_idx_type l = dim - 1;
@@ -4529,64 +4656,68 @@
   public:
     octave_value get_color_data (void) const;
 
-    bool is_climinclude (void) const
-      { return (climinclude.is_on () && cdatamapping.is ("scaled")); }
-    std::string get_climinclude (void) const
-      { return climinclude.current_value (); }
-
     bool is_aliminclude (void) const
       { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); }
     std::string get_aliminclude (void) const
       { return aliminclude.current_value (); }
 
+    bool is_climinclude (void) const
+      { return (climinclude.is_on () && cdatamapping.is ("scaled")); }
+    std::string get_climinclude (void) const
+      { return climinclude.current_value (); }
+
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (patch)
-      array_property xdata u , Matrix ()
-      array_property ydata u , Matrix ()
-      array_property zdata u , Matrix ()
+      radio_property alphadatamapping l , "none|{scaled}|direct"
+      double_property ambientstrength , 0.3
+      radio_property backfacelighting , "unlit|lit|{reverselit}"
       array_property cdata u , Matrix ()
       radio_property cdatamapping l , "{scaled}|direct"
+      double_property diffusestrength , 0.6
+      string_property displayname , ""
+      double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp"))
+      color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))
+      radio_property edgelighting , "{none}|flat|gouraud|phong"
+      radio_property erasemode , "{normal}|background|xor|none"
+      double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp"))
+      color_property facecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))
+      radio_property facelighting , "{none}|flat|gouraud|phong"
       array_property faces , Matrix ()
       array_property facevertexalphadata , Matrix ()
       array_property facevertexcdata , Matrix ()
-      array_property vertices , Matrix ()
-      array_property vertexnormals , Matrix ()
-      radio_property normalmode , "{auto}|manual"
-      color_property facecolor , color_property (color_values (0, 0, 0), radio_values ("flat|none|interp"))
-      double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp"))
-      radio_property facelighting , "flat|{none}|gouraud|phong"
-      color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("flat|none|interp"))
-      double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp"))
-      radio_property edgelighting , "{none}|flat|gouraud|phong"
-      radio_property backfacelighting , "{reverselit}|unlit|lit"
-      double_property ambientstrength , 0.3
-      double_property diffusestrength , 0.6
-      double_property specularstrength , 0.6
-      double_property specularexponent , 10.0
-      double_property specularcolorreflectance , 1.0
-      radio_property erasemode , "{normal}|background|xor|none"
+      // FIXME: interpreter is not a property of a Matlab patch.
+      //        Octave uses this for legend() with the string displayname.
+      radio_property interpreter , "{tex}|none|latex"
       radio_property linestyle , "{-}|--|:|-.|none"
       double_property linewidth , 0.5
-      radio_property marker , "{none}|s|o|x|+|.|*|<|>|v|^|d|p|h|@"
-      color_property markeredgecolor , "{auto}|none|flat"
-      color_property markerfacecolor , "auto|{none}|flat"
+      radio_property marker , "{none}|+|o|*|.|x|s|d|^|v|>|<|p|h"
+      color_property markeredgecolor , "none|{auto}|flat"
+      color_property markerfacecolor , "{none}|auto|flat"
       double_property markersize , 6
-      radio_property interpreter , "{tex}|none|latex"
-      string_property displayname , ""
-      radio_property alphadatamapping l , "none|{scaled}|direct"
+      radio_property normalmode , "{auto}|manual"
+      double_property specularcolorreflectance , 1.0
+      double_property specularexponent , 10.0
+      double_property specularstrength , 0.6
+      array_property vertexnormals , Matrix ()
+      array_property vertices , Matrix ()
+      array_property xdata u , Matrix ()
+      array_property ydata u , Matrix ()
+      array_property zdata u , Matrix ()
+
       // hidden properties for limit computation
+      row_vector_property alim hlr , Matrix ()
+      row_vector_property clim hlr , Matrix ()
       row_vector_property xlim hlr , Matrix ()
       row_vector_property ylim hlr , Matrix ()
       row_vector_property zlim hlr , Matrix ()
-      row_vector_property clim hlr , Matrix ()
-      row_vector_property alim hlr , Matrix ()
+      bool_property aliminclude hlg , "on"
+      bool_property climinclude hlg , "on"
       bool_property xliminclude hl , "on"
       bool_property yliminclude hl , "on"
       bool_property zliminclude hl , "on"
-      bool_property climinclude hlg , "on"
-      bool_property aliminclude hlg , "on"
     END_PROPERTIES
 
   protected:
@@ -4647,66 +4778,70 @@
   public:
     octave_value get_color_data (void) const;
 
-    bool is_climinclude (void) const
-      { return (climinclude.is_on () && cdatamapping.is ("scaled")); }
-    std::string get_climinclude (void) const
-      { return climinclude.current_value (); }
-
     bool is_aliminclude (void) const
       { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); }
     std::string get_aliminclude (void) const
       { return aliminclude.current_value (); }
 
+    bool is_climinclude (void) const
+      { return (climinclude.is_on () && cdatamapping.is ("scaled")); }
+    std::string get_climinclude (void) const
+      { return climinclude.current_value (); }
+
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (surface)
-      array_property xdata u , Matrix ()
-      array_property ydata u , Matrix ()
-      array_property zdata u , Matrix ()
-      array_property cdata u , Matrix ()
-      radio_property cdatamapping al , "{scaled}|direct"
-      string_property xdatasource , ""
-      string_property ydatasource , ""
-      string_property zdatasource , ""
-      string_property cdatasource , ""
-      color_property facecolor , "{flat}|none|interp|texturemap"
-      double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp"))
-      color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("flat|none|interp"))
-      radio_property linestyle , "{-}|--|:|-.|none"
-      double_property linewidth , 0.5
-      radio_property marker , "{none}|s|o|x|+|.|*|<|>|v|^|d|p|h|@"
-      color_property markeredgecolor , "{auto}|none"
-      color_property markerfacecolor , "auto|{none}"
-      double_property markersize , 6
-      radio_property interpreter , "{tex}|none|latex"
-      string_property displayname , ""
       array_property alphadata u , Matrix ()
       radio_property alphadatamapping l , "none|direct|{scaled}"
       double_property ambientstrength , 0.3
       radio_property backfacelighting , "unlit|lit|{reverselit}"
+      array_property cdata u , Matrix ()
+      radio_property cdatamapping al , "{scaled}|direct"
+      string_property cdatasource , ""
       double_property diffusestrength , 0.6
+      string_property displayname , ""
       double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp"))
+      color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))
       radio_property edgelighting , "{none}|flat|gouraud|phong"
       radio_property erasemode , "{normal}|none|xor|background"
+      double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp|texturemap"))
+      color_property facecolor , "none|{flat}|interp|texturemap"
       radio_property facelighting , "{none}|flat|gouraud|phong"
+      // FIXME: interpreter is not a Matlab surface property
+      //        Octave uses this for legend() with the string displayname.
+      radio_property interpreter , "{tex}|none|latex"
+      radio_property linestyle , "{-}|--|:|-.|none"
+      double_property linewidth , 0.5
+      radio_property marker , "{none}|+|o|*|.|x|s|d|^|v|>|<|p|h"
+      color_property markeredgecolor , "none|{auto}|flat"
+      color_property markerfacecolor , "{none}|auto|flat"
+      double_property markersize , 6
       radio_property meshstyle , "{both}|row|column"
       radio_property normalmode u , "{auto}|manual"
       double_property specularcolorreflectance , 1
       double_property specularexponent , 10
       double_property specularstrength , 0.9
       array_property vertexnormals u , Matrix ()
+      array_property xdata u , Matrix ()
+      string_property xdatasource , ""
+      array_property ydata u , Matrix ()
+      string_property ydatasource , ""
+      array_property zdata u , Matrix ()
+      string_property zdatasource , ""
+
       // hidden properties for limit computation
+      row_vector_property alim hlr , Matrix ()
+      row_vector_property clim hlr , Matrix ()
       row_vector_property xlim hlr , Matrix ()
       row_vector_property ylim hlr , Matrix ()
       row_vector_property zlim hlr , Matrix ()
-      row_vector_property clim hlr , Matrix ()
-      row_vector_property alim hlr , Matrix ()
+      bool_property aliminclude hlg , "on"
+      bool_property climinclude hlg , "on"
       bool_property xliminclude hl , "on"
       bool_property yliminclude hl , "on"
       bool_property zliminclude hl , "on"
-      bool_property climinclude hlg , "on"
-      bool_property aliminclude hlg , "on"
     END_PROPERTIES
 
   protected:
@@ -4728,7 +4863,21 @@
       }
 
   private:
-    void update_normals (void);
+    void update_alphadata (void)
+      {
+        if (alphadatamapping_is ("scaled"))
+          set_alim (alphadata.get_limits ());
+        else
+          alim = alphadata.get_limits ();
+      }
+
+    void update_cdata (void)
+      {
+        if (cdatamapping_is ("scaled"))
+          set_clim (cdata.get_limits ());
+        else
+          clim = cdata.get_limits ();
+      }
 
     void update_xdata (void)
       {
@@ -4748,21 +4897,7 @@
         set_zlim (zdata.get_limits ());
       }
 
-    void update_cdata (void)
-      {
-        if (cdatamapping_is ("scaled"))
-          set_clim (cdata.get_limits ());
-        else
-          clim = cdata.get_limits ();
-      }
-
-    void update_alphadata (void)
-      {
-        if (alphadatamapping_is ("scaled"))
-          set_alim (alphadata.get_limits ());
-        else
-          alim = alphadata.get_limits ();
-      }
+    void update_normals (void);
 
     void update_normalmode (void)
       { update_normals (); }
@@ -4813,21 +4948,23 @@
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (hggroup)
       string_property displayname , ""
       radio_property erasemode , "{normal}|none|xor|background"
+
       // hidden properties for limit computation
+      row_vector_property alim hr , Matrix ()
+      row_vector_property clim hr , Matrix ()
       row_vector_property xlim hr , Matrix ()
       row_vector_property ylim hr , Matrix ()
       row_vector_property zlim hr , Matrix ()
-      row_vector_property clim hr , Matrix ()
-      row_vector_property alim hr , Matrix ()
+      bool_property aliminclude h , "on"
+      bool_property climinclude h , "on"
       bool_property xliminclude h , "on"
       bool_property yliminclude h , "on"
       bool_property zliminclude h , "on"
-      bool_property climinclude h , "on"
-      bool_property aliminclude h , "on"
     END_PROPERTIES
 
   private:
@@ -4886,6 +5023,7 @@
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (uimenu)
       any_property __object__ , Matrix ()
@@ -4897,6 +5035,7 @@
       string_property label , ""
       double_property position , 9
       bool_property separator , "off"
+      // Octave-specific properties
       string_property fltk_label h , ""
     END_PROPERTIES
 
@@ -4935,6 +5074,7 @@
   public:
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (uicontextmenu)
       any_property __object__ , Matrix ()
@@ -4986,6 +5126,7 @@
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (uicontrol)
       any_property __object__ , Matrix ()
@@ -5001,7 +5142,7 @@
       radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels"
       radio_property fontweight u , "light|{normal}|demi|bold"
       color_property foregroundcolor , color_values (0, 0, 0)
-      radio_property horizontalalignment , "{left}|center|right"
+      radio_property horizontalalignment , "left|{center}|right"
       callback_property keypressfcn , Matrix ()
       double_property listboxtop , 1
       double_property max , 1
@@ -5078,6 +5219,7 @@
 
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (uipanel)
       any_property __object__ , Matrix ()
@@ -5139,6 +5281,7 @@
   public:
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (uitoolbar)
       any_property __object__ , Matrix ()
@@ -5227,6 +5370,7 @@
   public:
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (uipushtool)
       any_property __object__ , Matrix ()
@@ -5277,6 +5421,7 @@
   public:
     // See the genprops.awk script for an explanation of the
     // properties declarations.
+    // Programming note: Keep property list sorted if new ones are added.
 
     BEGIN_PROPERTIES (uitoggletool)
       any_property __object__ , Matrix ()
rename from libinterp/interp-core/gripes.cc
rename to libinterp/corefcn/gripes.cc
--- a/libinterp/interp-core/gripes.cc
+++ b/libinterp/corefcn/gripes.cc
@@ -236,3 +236,11 @@
   warning_with_id ("Octave:matlab-incompatible",
                    "potential Matlab compatibility problem: comparing complex numbers");
 }
+
+void
+gripe_disabled_feature (const std::string& func, const std::string& feature,
+                        const std::string& pkg /*="Octave"*/)
+{
+  error ("%s: support for %s was disabled when %s was built",
+         func.c_str (), feature.c_str (), pkg.c_str ());
+}
rename from libinterp/interp-core/gripes.h
rename to libinterp/corefcn/gripes.h
--- a/libinterp/interp-core/gripes.h
+++ b/libinterp/corefcn/gripes.h
@@ -127,4 +127,7 @@
 extern OCTINTERP_API void
 gripe_warn_complex_cmp (void);
 
+extern OCTINTERP_API void
+gripe_disabled_feature (const std::string& func, const std::string& feature,
+                        const std::string& pkg="Octave");
 #endif
rename from libinterp/interpfcn/help.cc
rename to libinterp/corefcn/help.cc
--- a/libinterp/interpfcn/help.cc
+++ b/libinterp/corefcn/help.cc
@@ -935,7 +935,6 @@
   return h;
 }
 
-
 DEFUN (built_in_docstrings_file, args, nargout,
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{val} =} built_in_docstrings_file ()\n\
@@ -943,9 +942,16 @@
 @deftypefnx {Built-in Function} {} built_in_docstrings_file (@var{new_val}, \"local\")\n\
 Query or set the internal variable that specifies the name of the\n\
 file containing docstrings for built-in Octave functions.\n\
+The default value is\n\
+@file{@var{octave-home}/share/octave/@var{version}/etc/built-in-docstrings},\n\
+in which @var{octave-home} is the root directory of the Octave installation,\n\
+and @var{version} is the Octave version number.\n\
+The default value may be overridden by the environment variable\n\
+@w{@env{OCTAVE_BUILT_IN_DOCSTRINGS_FILE}}, or the command line argument\n\
+@samp{--built-in-docstrings-file FNAME}.\n\
 \n\
-Note that this variable is only used when Octave is initializing itself,\n\
-so setting it will have no effect.\n\
+Note: This variable is only used when Octave is initializing itself.\n\
+Modifying it during a running session of Octave will have no effect.\n\
 @end deftypefn")
 {
   return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (built_in_docstrings_file);
@@ -1390,12 +1396,12 @@
 and @var{version} is the Octave version number.\n\
 The default value may be overridden by the environment variable\n\
 @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument\n\
-@samp{--doc-cache-file NAME}.\n\
+@samp{--doc-cache-file FNAME}.\n\
 \n\
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
 variable value is restored when exiting the function.\n\
-@seealso{lookfor, info_program, doc, help, makeinfo_program}\n\
+@seealso{doc_cache_create, lookfor, info_program, doc, help, makeinfo_program}\n\
 @end deftypefn")
 {
   return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file);
@@ -1414,7 +1420,7 @@
 and @var{version} is the Octave version number.\n\
 The default value may be overridden by the environment variable\n\
 @w{@env{OCTAVE_TEXI_MACROS_FILE}}, or the command line argument\n\
-@samp{--texi-macros-file NAME}.\n\
+@samp{--texi-macros-file FNAME}.\n\
 \n\
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
@@ -1436,7 +1442,7 @@
 which @var{octave-home} is the root directory of the Octave installation.\n\
 The default value may be overridden by the environment variable\n\
 @w{@env{OCTAVE_INFO_FILE}}, or the command line argument\n\
-@samp{--info-file NAME}.\n\
+@samp{--info-file FNAME}.\n\
 \n\
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
rename from libinterp/interpfcn/help.h
rename to libinterp/corefcn/help.h
--- a/libinterp/corefcn/hess.cc
+++ b/libinterp/corefcn/hess.cc
@@ -60,6 +60,7 @@
 The Hessenberg decomposition is usually used as the first step in an\n\
 eigenvalue computation, but has other applications as well (see Golub,\n\
 Nash, and Van Loan, IEEE Transactions on Automatic Control, 1979).\n\
+@seealso{eig, chol, lu, qr, qz, schur, svd}\n\
 @end deftypefn")
 {
   octave_value_list retval;
rename from libinterp/interpfcn/hook-fcn.cc
rename to libinterp/corefcn/hook-fcn.cc
rename from libinterp/interpfcn/hook-fcn.h
rename to libinterp/corefcn/hook-fcn.h
rename from libinterp/interpfcn/input.cc
rename to libinterp/corefcn/input.cc
--- a/libinterp/interpfcn/input.cc
+++ b/libinterp/corefcn/input.cc
@@ -1065,15 +1065,16 @@
   return retval;
 }
 
-DEFUN (read_readline_init_file, args, ,
+DEFUN (readline_read_init_file, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} read_readline_init_file (@var{file})\n\
+@deftypefn {Built-in Function} {} readline_read_init_file (@var{file})\n\
 Read the readline library initialization file @var{file}.  If\n\
 @var{file} is omitted, read the default initialization file (normally\n\
 @file{~/.inputrc}).\n\
 \n\
 @xref{Readline Init File, , , readline, GNU Readline Library},\n\
 for details.\n\
+@seealso{readline_re_read_init_file}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -1095,12 +1096,13 @@
   return retval;
 }
 
-DEFUN (re_read_readline_init_file, args, ,
+DEFUN (readline_re_read_init_file, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} re_read_readline_init_file ()\n\
+@deftypefn {Built-in Function} {} readline_re_read_init_file ()\n\
 Re-read the last readline library initialization file that was read.\n\
 @xref{Readline Init File, , , readline, GNU Readline Library},\n\
 for details.\n\
+@seealso{readline_read_init_file}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -1128,8 +1130,8 @@
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn})\n\
 @deftypefnx {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn}, @var{data})\n\
-Add the named function or function handle @var{fcn} to the list of functions to call\n\
-periodically when Octave is waiting for input.  The function should\n\
+Add the named function or function handle @var{fcn} to the list of functions\n\
+to call periodically when Octave is waiting for input.  The function should\n\
 have the form\n\
 \n\
 @example\n\
@@ -1177,7 +1179,7 @@
 
 DEFUN (remove_input_event_hook, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} remove_input_event_hook (@var{name})\n\
+@deftypefn  {Built-in Function} {} remove_input_event_hook (@var{name})\n\
 @deftypefnx {Built-in Function} {} remove_input_event_hook (@var{fcn_id})\n\
 Remove the named function or function handle with the given identifier\n\
 from the list of functions to call periodically when Octave is waiting\n\
rename from libinterp/interpfcn/input.h
rename to libinterp/corefcn/input.h
rename from libinterp/interp-core/jit-ir.cc
rename to libinterp/corefcn/jit-ir.cc
--- a/libinterp/interp-core/jit-ir.cc
+++ b/libinterp/corefcn/jit-ir.cc
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 // defines required by llvm
 #define __STDC_LIMIT_MACROS
 #define __STDC_CONSTANT_MACROS
rename from libinterp/interp-core/jit-ir.h
rename to libinterp/corefcn/jit-ir.h
--- a/libinterp/interp-core/jit-ir.h
+++ b/libinterp/corefcn/jit-ir.h
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 #if !defined (octave_jit_ir_h)
 #define octave_jit_ir_h 1
 
rename from libinterp/interp-core/jit-typeinfo.cc
rename to libinterp/corefcn/jit-typeinfo.cc
--- a/libinterp/interp-core/jit-typeinfo.cc
+++ b/libinterp/corefcn/jit-typeinfo.cc
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 // defines required by llvm
 #define __STDC_LIMIT_MACROS
 #define __STDC_CONSTANT_MACROS
@@ -39,7 +41,11 @@
 #include <llvm/Function.h>
 #include <llvm/Instructions.h>
 #include <llvm/Intrinsics.h>
+#ifdef IRBUILDER_HEADER_IN_SUPPORT_DIR
 #include <llvm/Support/IRBuilder.h>
+#else
+#include <llvm/IRBuilder.h>
+#endif
 #include <llvm/Support/raw_os_ostream.h>
 
 #include "jit-ir.h"
@@ -577,10 +583,23 @@
                                           aname, module);
 
   if (sret ())
-    llvm_function->addAttribute (1, llvm::Attribute::StructRet);
+    {
+#ifdef FUNCTION_ADDATTRIBUTE_ARG_IS_ATTRIBUTES
+      llvm::AttrBuilder attr_builder;
+      attr_builder.addAttribute (llvm::Attributes::StructRet);
+      llvm::Attributes attrs = llvm::Attributes::get(context, attr_builder);
+      llvm_function->addAttribute (1, attrs);
+#else
+      llvm_function->addAttribute (1, llvm::Attribute::StructRet);
+#endif
+    }
 
   if (call_conv == jit_convention::internal)
+#ifdef FUNCTION_ADDFNATTR_ARG_IS_ATTRIBUTES
+    llvm_function->addFnAttr (llvm::Attributes::AlwaysInline);
+#else
     llvm_function->addFnAttr (llvm::Attribute::AlwaysInline);
+#endif
 }
 
 jit_function::jit_function (const jit_function& fn, jit_type *aresult,
@@ -683,7 +702,14 @@
 
   if (sret ())
     {
+#ifdef CALLINST_ADDATTRIBUTE_ARG_IS_ATTRIBUTES
+      llvm::AttrBuilder attr_builder;
+      attr_builder.addAttribute(llvm::Attributes::StructRet);
+      llvm::Attributes attrs = llvm::Attributes::get(context, attr_builder); 
+      callinst->addAttribute (1, attrs);
+#else
       callinst->addAttribute (1, llvm::Attribute::StructRet);
+#endif
       ret = builder.CreateLoad (sret_mem);
     }
 
rename from libinterp/interp-core/jit-typeinfo.h
rename to libinterp/corefcn/jit-typeinfo.h
--- a/libinterp/interp-core/jit-typeinfo.h
+++ b/libinterp/corefcn/jit-typeinfo.h
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 #if !defined (octave_jit_typeinfo_h)
 #define octave_jit_typeinfo_h 1
 
rename from libinterp/interp-core/jit-util.cc
rename to libinterp/corefcn/jit-util.cc
--- a/libinterp/interp-core/jit-util.cc
+++ b/libinterp/corefcn/jit-util.cc
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 // defines required by llvm
 #define __STDC_LIMIT_MACROS
 #define __STDC_CONSTANT_MACROS
rename from libinterp/interp-core/jit-util.h
rename to libinterp/corefcn/jit-util.h
--- a/libinterp/interp-core/jit-util.h
+++ b/libinterp/corefcn/jit-util.h
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 // Some utility classes and functions used throughout jit
 
 #if !defined (octave_jit_util_h)
rename from libinterp/interpfcn/load-path.cc
rename to libinterp/corefcn/load-path.cc
rename from libinterp/interpfcn/load-path.h
rename to libinterp/corefcn/load-path.h
rename from libinterp/interpfcn/load-save.cc
rename to libinterp/corefcn/load-save.cc
--- a/libinterp/interpfcn/load-save.cc
+++ b/libinterp/corefcn/load-save.cc
@@ -103,7 +103,7 @@
 
 // The default output format.  May be one of "binary", "text",
 // "mat-binary", or "hdf5".
-static std::string Vdefault_save_options = "-text";
+static std::string Vsave_default_options = "-text";
 
 // The output format for Octave core files.
 static std::string Voctave_core_file_options = "-binary";
@@ -1470,7 +1470,7 @@
 with corresponding names.\n\
 Valid options for the @code{save} command are listed in the following table.\n\
 Options that modify the output format override the format specified by\n\
-@code{default_save_options}.\n\
+@code{save_default_options}.\n\
 \n\
 If save is invoked using the functional form\n\
 \n\
@@ -1576,7 +1576,7 @@
 @noindent\n\
 saves the variable @samp{a} and all variables beginning with @samp{b} to\n\
 the file @file{data} in Octave's binary format.\n\
-@seealso{load, default_save_options, save_header_format_string, dlmread, csvread, fread}\n\
+@seealso{load, save_default_options, save_header_format_string, dlmread, csvread, fread}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -1600,7 +1600,7 @@
   bool use_zlib = false;
 
   // get default options
-  parse_save_options (Vdefault_save_options, format, append, save_as_floats,
+  parse_save_options (Vsave_default_options, format, append, save_as_floats,
                       use_zlib);
 
   // override from command line
@@ -1773,11 +1773,11 @@
   return SET_INTERNAL_VARIABLE (crash_dumps_octave_core);
 }
 
-DEFUN (default_save_options, args, nargout,
+DEFUN (save_default_options, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {@var{val} =} default_save_options ()\n\
-@deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val})\n\
-@deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, \"local\")\n\
+@deftypefn  {Built-in Function} {@var{val} =} save_default_options ()\n\
+@deftypefnx {Built-in Function} {@var{old_val} =} save_default_options (@var{new_val})\n\
+@deftypefnx {Built-in Function} {} save_default_options (@var{new_val}, \"local\")\n\
 Query or set the internal variable that specifies the default options\n\
 for the @code{save} command, and defines the default format.\n\
 Typical values include @code{\"-ascii\"}, @code{\"-text -zip\"}.\n\
@@ -1789,7 +1789,7 @@
 @seealso{save}\n\
 @end deftypefn")
 {
-  return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (default_save_options);
+  return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (save_default_options);
 }
 
 DEFUN (octave_core_file_limit, args, nargout,
rename from libinterp/interpfcn/load-save.h
rename to libinterp/corefcn/load-save.h
rename from libinterp/interp-core/ls-ascii-helper.cc
rename to libinterp/corefcn/ls-ascii-helper.cc
rename from libinterp/interp-core/ls-ascii-helper.h
rename to libinterp/corefcn/ls-ascii-helper.h
rename from libinterp/interp-core/ls-hdf5.cc
rename to libinterp/corefcn/ls-hdf5.cc
rename from libinterp/interp-core/ls-hdf5.h
rename to libinterp/corefcn/ls-hdf5.h
rename from libinterp/interp-core/ls-mat-ascii.cc
rename to libinterp/corefcn/ls-mat-ascii.cc
rename from libinterp/interp-core/ls-mat-ascii.h
rename to libinterp/corefcn/ls-mat-ascii.h
rename from libinterp/interp-core/ls-mat4.cc
rename to libinterp/corefcn/ls-mat4.cc
rename from libinterp/interp-core/ls-mat4.h
rename to libinterp/corefcn/ls-mat4.h
rename from libinterp/interp-core/ls-mat5.cc
rename to libinterp/corefcn/ls-mat5.cc
--- a/libinterp/interp-core/ls-mat5.cc
+++ b/libinterp/corefcn/ls-mat5.cc
@@ -877,14 +877,14 @@
         if (! is || error_state)
           goto data_read_error;
 
-        // Octave can handle both "/" and "\" as a directry seperator
-        // and so can ignore the seperator field of m0. I think the
+        // Octave can handle both "/" and "\" as a directory seperator
+        // and so can ignore the separator field of m0. I think the
         // sentinel field is also save to ignore.
-        Octave_map m0 = tc2.map_value ();
-        Octave_map m1 = m0.contents ("function_handle")(0).map_value ();
-        std::string ftype = m1.contents ("type")(0).string_value ();
-        std::string fname = m1.contents ("function")(0).string_value ();
-        std::string fpath = m1.contents ("file")(0).string_value ();
+        octave_scalar_map m0 = tc2.scalar_map_value ();
+        octave_scalar_map m1 = m0.contents ("function_handle").scalar_map_value ();
+        std::string ftype = m1.contents ("type").string_value ();
+        std::string fname = m1.contents ("function").string_value ();
+        std::string fpath = m1.contents ("file").string_value ();
 
         if (ftype == "simple" || ftype == "scopedfunction")
           {
@@ -894,7 +894,7 @@
             else
               {
                 std::string mroot =
-                  m0.contents ("matlabroot")(0).string_value ();
+                  m0.contents ("matlabroot").string_value ();
 
                 if ((fpath.length () >= mroot.length ()) &&
                     fpath.substr (0, mroot.length ()) == mroot &&
@@ -931,8 +931,7 @@
                       }
                     else
                       {
-                        // Next just search for it anywhere in the
-                        // system path
+                        // Next just search for it anywhere in the system path
                         string_vector names(3);
                         names(0) = fname + ".oct";
                         names(1) = fname + ".mex";
@@ -996,13 +995,13 @@
           }
         else if (ftype == "anonymous")
           {
-            Octave_map m2 = m1.contents ("workspace")(0).map_value ();
-            uint32NDArray MCOS = m2.contents ("MCOS")(0).uint32_array_value ();
+            octave_scalar_map m2 = m1.contents ("workspace").scalar_map_value ();
+            uint32NDArray MCOS = m2.contents ("MCOS").uint32_array_value ();
             octave_idx_type off = static_cast<octave_idx_type>(MCOS(4).double_value ());
-            m2 = subsys_ov.map_value ();
-            m2 = m2.contents ("MCOS")(0).map_value ();
-            tc2 = m2.contents ("MCOS")(0).cell_value ()(1 + off).cell_value ()(1);
-            m2 = tc2.map_value ();
+            m2 = subsys_ov.scalar_map_value ();
+            m2 = m2.contents ("MCOS").scalar_map_value ();
+            tc2 = m2.contents ("MCOS").cell_value ()(1 + off).cell_value ()(1);
+            m2 = tc2.scalar_map_value ();
 
             unwind_protect_safe frame;
 
@@ -1021,11 +1020,11 @@
               {
                 octave_value tmp;
 
-                for (Octave_map::iterator p0 = m2.begin () ;
+                for (octave_map::iterator p0 = m2.begin () ;
                      p0 != m2.end (); p0++)
                   {
                     std::string key = m2.key (p0);
-                    octave_value val = m2.contents (p0)(0);
+                    octave_value val = m2.contents (p0);
 
                     symbol_table::assign (key, val, local_scope, 0);
                   }
@@ -1066,7 +1065,7 @@
 
     case MAT_FILE_WORKSPACE_CLASS:
       {
-        Octave_map m (dim_vector (1, 1));
+        octave_map m (dim_vector (1, 1));
         int n_fields = 2;
         string_vector field (n_fields);
 
@@ -1074,8 +1073,8 @@
           {
             int32_t fn_type;
             int32_t fn_len;
-            if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) ||
-                !INT8(fn_type))
+            if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
+                || !INT8(fn_type))
               {
                 error ("load: invalid field name subelement");
                 goto data_read_error;
@@ -1164,7 +1163,7 @@
       // Fall-through
     case MAT_FILE_STRUCT_CLASS:
       {
-        Octave_map m (dims);
+        octave_map m (dims);
         int32_t fn_type;
         int32_t fn_len;
         int32_t field_name_length;
@@ -1172,10 +1171,9 @@
         // field name length subelement -- actually the maximum length
         // of a field name.  The Matlab docs promise this will always
         // be 32.  We read and use the actual value, on the theory
-        // that eventually someone will recognize that's a waste of
-        // space.
-        if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) ||
-            fn_type != miINT32)
+        // that eventually someone will recognize that's a waste of space.
+        if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
+            || fn_type != miINT32)
           {
             error ("load: invalid field name length subelement");
             goto data_read_error;
@@ -1189,8 +1187,8 @@
 
         // field name subelement.  The length of this subelement tells
         // us how many fields there are.
-        if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) ||
-            !INT8(fn_type))
+        if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
+            || !INT8(fn_type))
           {
             error ("load: invalid field name subelement");
             goto data_read_error;
@@ -1962,7 +1960,7 @@
             {
               double tmp = val[i];
 
-              if (! (xisnan (tmp) || xisinf (tmp))
+              if (xfinite (tmp)
                   && fabs (tmp) > std::numeric_limits<float>::max ())
                 {
                   too_large_for_float = true;
@@ -2237,7 +2235,7 @@
   else if (tc.is_map () || tc.is_inline_function () || tc.is_object ())
     {
       int fieldcnt = 0;
-      const Octave_map m = tc.map_value ();
+      const octave_map m = tc.map_value ();
       octave_idx_type nel = m.numel ();
 
       if (tc.is_inline_function ())
@@ -2250,7 +2248,7 @@
           ret += 8 + PAD (classlen > max_namelen ? max_namelen : classlen);
         }
 
-      for (Octave_map::const_iterator i = m.begin (); i != m.end (); i++)
+      for (octave_map::const_iterator i = m.begin (); i != m.end (); i++)
         fieldcnt++;
 
       ret += 16 + fieldcnt * (max_namelen + 1);
@@ -2259,7 +2257,7 @@
       for (octave_idx_type j = 0; j < nel; j++)
         {
 
-          for (Octave_map::const_iterator i = m.begin (); i != m.end (); i++)
+          for (octave_map::const_iterator i = m.begin (); i != m.end (); i++)
             {
               const Cell elts = m.contents (i);
 
@@ -2667,7 +2665,7 @@
           os.write (paddedname, paddedlength);
         }
 
-      Octave_map m;
+      octave_map m;
 
       if (tc.is_object () &&
           load_path::find_method (tc.class_name (), "saveobj") != std::string ())
rename from libinterp/interp-core/ls-mat5.h
rename to libinterp/corefcn/ls-mat5.h
rename from libinterp/interpfcn/ls-oct-ascii.cc
rename to libinterp/corefcn/ls-oct-ascii.cc
rename from libinterp/interpfcn/ls-oct-ascii.h
rename to libinterp/corefcn/ls-oct-ascii.h
rename from libinterp/interp-core/ls-oct-binary.cc
rename to libinterp/corefcn/ls-oct-binary.cc
rename from libinterp/interp-core/ls-oct-binary.h
rename to libinterp/corefcn/ls-oct-binary.h
rename from libinterp/interp-core/ls-utils.cc
rename to libinterp/corefcn/ls-utils.cc
rename from libinterp/interp-core/ls-utils.h
rename to libinterp/corefcn/ls-utils.h
--- a/libinterp/corefcn/lu.cc
+++ b/libinterp/corefcn/lu.cc
@@ -137,6 +137,7 @@
 is embedded into @var{U} to give a return value similar to the full case.\n\
 For both full and sparse matrices, @code{lu} loses the permutation\n\
 information.\n\
+@seealso{luupdate, chol, hess, qr, qz, schur, svd}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -635,7 +636,7 @@
 The matrix case is done as a sequence of rank-1 updates;\n\
 thus, for large enough k, it will be both faster and more accurate to\n\
 recompute the factorization from scratch.\n\
-@seealso{lu, qrupdate, cholupdate}\n\
+@seealso{lu, cholupdate, qrupdate}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
--- a/libinterp/corefcn/mappers.cc
+++ b/libinterp/corefcn/mappers.cc
@@ -1884,7 +1884,7 @@
 @deftypefn {Mapping Function} {} signbit (@var{x})\n\
 Return logical true if the value of @var{x} has its sign bit set.\n\
 Otherwise return logical false.  This behavior is consistent with the other\n\
-logical functions. See@ref{Logical Values}.  The behavior differs from the\n\
+logical functions.  See@ref{Logical Values}.  The behavior differs from the\n\
 C language function which returns non-zero if the sign bit is set.\n\
 \n\
 This is not the same as @code{x < 0.0}, because IEEE 754 floating point\n\
rename from libinterp/interp-core/matherr.c
rename to libinterp/corefcn/matherr.c
rename from libinterp/interp-core/mex.cc
rename to libinterp/corefcn/mex.cc
--- a/libinterp/interp-core/mex.cc
+++ b/libinterp/corefcn/mex.cc
@@ -3101,8 +3101,11 @@
   if (s && strlen (s) > 0)
     error ("%s: %s", mexFunctionName (), s);
   else
-    // Just set the error state; don't print msg.
-    error ("");
+    {
+      // For compatibility with Matlab, print an empty message.
+      // Octave's error routine requires a non-null input so use a SPACE.
+      error (" ");
+    }
 
   mex_context->abort ();
 }
@@ -3122,8 +3125,11 @@
       va_end (args);
     }
   else
-    // Just set the error state; don't print msg.
-    error ("");
+    {
+      // For compatibility with Matlab, print an empty message.
+      // Octave's error routine requires a non-null input so use a SPACE.
+      error (" ");
+    }
 
   mex_context->abort ();
 }
rename from libinterp/interp-core/mex.h
rename to libinterp/corefcn/mex.h
rename from libinterp/interp-core/mexproto.h
rename to libinterp/corefcn/mexproto.h
--- a/libinterp/corefcn/module.mk
+++ b/libinterp/corefcn/module.mk
@@ -1,5 +1,10 @@
 EXTRA_DIST += \
-  corefcn/module.mk
+  corefcn/module.mk \
+  corefcn/defaults.in.h \
+  corefcn/gl2ps.c \
+  corefcn/graphics.in.h \
+  corefcn/mxarray.in.h \
+  corefcn/oct-errno.in.cc
 
 ## Options functions for Fortran packages like LSODE, DASPK.
 ## These are generated automagically by configure and Perl.
@@ -24,7 +29,103 @@
 $(OPT_INC) : %.h : %.in
 	$(MAKE) -C $(top_builddir)/liboctave/numeric $(@F)
 
+JIT_INC = \
+  corefcn/jit-util.h \
+  corefcn/jit-typeinfo.h \
+  corefcn/jit-ir.h \
+  corefcn/pt-jit.h
+
+COREFCN_INC = \
+  corefcn/Cell.h \
+  corefcn/action-container.h \
+  corefcn/c-file-ptr-stream.h \
+  corefcn/comment-list.h \
+  corefcn/cutils.h \
+  corefcn/data.h \
+  corefcn/debug.h \
+  corefcn/defun-dld.h \
+  corefcn/defun-int.h \
+  corefcn/defun.h \
+  corefcn/dirfns.h \
+  corefcn/display.h \
+  corefcn/dynamic-ld.h \
+  corefcn/error.h \
+  corefcn/event-queue.h \
+  corefcn/file-io.h \
+  corefcn/gl-render.h \
+  corefcn/gl2ps-renderer.h \
+  corefcn/gl2ps.h \
+  corefcn/gripes.h \
+  corefcn/help.h \
+  corefcn/hook-fcn.h \
+  corefcn/input.h \
+  corefcn/load-path.h \
+  corefcn/load-save.h \
+  corefcn/ls-ascii-helper.h \
+  corefcn/ls-hdf5.h \
+  corefcn/ls-mat-ascii.h \
+  corefcn/ls-mat4.h \
+  corefcn/ls-mat5.h \
+  corefcn/ls-oct-ascii.h \
+  corefcn/ls-oct-binary.h \
+  corefcn/ls-utils.h \
+  corefcn/mex.h \
+  corefcn/mexproto.h \
+  corefcn/mxarray.in.h \
+  corefcn/oct-errno.h \
+  corefcn/oct-fstrm.h \
+  corefcn/oct-hdf5.h \
+  corefcn/oct-hist.h \
+  corefcn/oct-iostrm.h \
+  corefcn/oct-lvalue.h \
+  corefcn/oct-map.h \
+  corefcn/oct-obj.h \
+  corefcn/oct-prcstrm.h \
+  corefcn/oct-procbuf.h \
+  corefcn/oct-stdstrm.h \
+  corefcn/oct-stream.h \
+  corefcn/oct-strstrm.h \
+  corefcn/oct.h \
+  corefcn/octave-link.h \
+  corefcn/pager.h \
+  corefcn/pr-output.h \
+  corefcn/procstream.h \
+  corefcn/profiler.h \
+  corefcn/sighandlers.h \
+  corefcn/siglist.h \
+  corefcn/sparse-xdiv.h \
+  corefcn/sparse-xpow.h \
+  corefcn/symtab.h \
+  corefcn/sysdep.h \
+  corefcn/toplev.h \
+  interp-core/txt-render.h \
+  interp-core/txt-latex.h \
+  corefcn/txt-eng-ft.h \
+  corefcn/txt-eng.h \
+  corefcn/unwind-prot.h \
+  corefcn/utils.h \
+  corefcn/variables.h \
+  corefcn/workspace-element.h \
+  corefcn/xdiv.h \
+  corefcn/xnorm.h \
+  corefcn/xpow.h \
+  corefcn/zfstream.h \
+  $(JIT_INC)
+
+JIT_SRC = \
+  corefcn/jit-util.cc \
+  corefcn/jit-typeinfo.cc \
+  corefcn/jit-ir.cc \
+  corefcn/pt-jit.cc
+
+C_COREFCN_SRC = \
+  corefcn/cutils.c \
+  corefcn/matherr.c \
+  corefcn/siglist.c \
+  corefcn/xgl2ps.c
+
 COREFCN_SRC = \
+  corefcn/Cell.cc \
   corefcn/__contourc__.cc \
   corefcn/__dispatch__.cc \
   corefcn/__lin_interpn__.cc \
@@ -35,20 +136,31 @@
   corefcn/betainc.cc \
   corefcn/bitfcns.cc \
   corefcn/bsxfun.cc \
+  corefcn/c-file-ptr-stream.cc \
   corefcn/cellfun.cc \
   corefcn/colloc.cc \
+  corefcn/comment-list.cc \
   corefcn/conv2.cc \
   corefcn/daspk.cc \
   corefcn/dasrt.cc \
   corefcn/dassl.cc \
+  corefcn/data.cc \
+  corefcn/debug.cc \
+  corefcn/defaults.cc \
+  corefcn/defun.cc \
   corefcn/det.cc \
+  corefcn/dirfns.cc \
+  corefcn/display.cc \
   corefcn/dlmread.cc \
   corefcn/dot.cc \
+  corefcn/dynamic-ld.cc \
   corefcn/eig.cc \
   corefcn/ellipj.cc \
+  corefcn/error.cc \
   corefcn/fft.cc \
   corefcn/fft2.cc \
   corefcn/fftn.cc \
+  corefcn/file-io.cc \
   corefcn/filter.cc \
   corefcn/find.cc \
   corefcn/gammainc.cc \
@@ -57,11 +169,28 @@
   corefcn/getpwent.cc \
   corefcn/getrusage.cc \
   corefcn/givens.cc \
+  corefcn/gl-render.cc \
+  corefcn/gl2ps-renderer.cc \
+  corefcn/graphics.cc \
+  corefcn/gripes.cc \
+  corefcn/help.cc \
   corefcn/hess.cc \
   corefcn/hex2num.cc \
+  corefcn/hook-fcn.cc \
+  corefcn/input.cc \
   corefcn/inv.cc \
   corefcn/kron.cc \
+  corefcn/load-path.cc \
+  corefcn/load-save.cc \
   corefcn/lookup.cc \
+  corefcn/ls-ascii-helper.cc \
+  corefcn/ls-hdf5.cc \
+  corefcn/ls-mat-ascii.cc \
+  corefcn/ls-mat4.cc \
+  corefcn/ls-mat5.cc \
+  corefcn/ls-oct-ascii.cc \
+  corefcn/ls-oct-binary.cc \
+  corefcn/ls-utils.cc \
   corefcn/lsode.cc \
   corefcn/lu.cc \
   corefcn/luinc.cc \
@@ -69,9 +198,25 @@
   corefcn/matrix_type.cc \
   corefcn/max.cc \
   corefcn/md5sum.cc \
+  corefcn/mex.cc \
   corefcn/mgorth.cc \
   corefcn/nproc.cc \
+  corefcn/oct-fstrm.cc \
+  corefcn/oct-hist.cc \
+  corefcn/oct-iostrm.cc \
+  corefcn/oct-lvalue.cc \
+  corefcn/oct-map.cc \
+  corefcn/oct-obj.cc \
+  corefcn/oct-prcstrm.cc \
+  corefcn/oct-procbuf.cc \
+  corefcn/oct-stream.cc \
+  corefcn/oct-strstrm.cc \
+  corefcn/octave-link.cc \
+  corefcn/pager.cc \
   corefcn/pinv.cc \
+  corefcn/pr-output.cc \
+  corefcn/procstream.cc \
+  corefcn/profiler.cc \
   corefcn/quad.cc \
   corefcn/quadcc.cc \
   corefcn/qz.cc \
@@ -79,6 +224,9 @@
   corefcn/rcond.cc \
   corefcn/regexp.cc \
   corefcn/schur.cc \
+  corefcn/sighandlers.cc \
+  corefcn/sparse-xdiv.cc \
+  corefcn/sparse-xpow.cc \
   corefcn/sparse.cc \
   corefcn/spparms.cc \
   corefcn/sqrtm.cc \
@@ -88,10 +236,63 @@
   corefcn/sub2ind.cc \
   corefcn/svd.cc \
   corefcn/syl.cc \
+  corefcn/symtab.cc \
   corefcn/syscalls.cc \
+  corefcn/sysdep.cc \
   corefcn/time.cc \
+  corefcn/toplev.cc \
   corefcn/tril.cc \
-  corefcn/typecast.cc
+  interp-core/txt-render.cc \
+  interp-core/txt-latex.cc \
+  corefcn/txt-eng-ft.cc \
+  corefcn/typecast.cc \
+  corefcn/unwind-prot.cc \
+  corefcn/utils.cc \
+  corefcn/variables.cc \
+  corefcn/xdiv.cc \
+  corefcn/xnorm.cc \
+  corefcn/xpow.cc \
+  corefcn/zfstream.cc \
+  $(JIT_SRC) \
+  $(C_COREFCN_SRC)
+
+## FIXME: Automake does not support per-object rules.
+##        These rules could be emulated by creating a new convenience
+##        library and using per-library rules.  Or we can just live
+##        without the rule since there haven't been any problems. (09/18/2012)
+#display.df display.lo: CPPFLAGS += $(X11_FLAGS)
+
+## Special rules for sources which must be built before rest of compilation.
+
+## defaults.h and graphics.h must depend on Makefile.  Calling configure
+## may change default/config values.  However, calling configure will also
+## regenerate the Makefiles from Makefile.am and trigger the rules below.
+corefcn/defaults.h: corefcn/defaults.in.h Makefile
+	@$(do_subst_default_vals)
+
+corefcn/graphics.h: corefcn/graphics.in.h genprops.awk Makefile
+	$(AWK) -f $(srcdir)/genprops.awk $< > $@-t
+	mv $@-t $@
+
+corefcn/graphics-props.cc: corefcn/graphics.in.h genprops.awk Makefile
+	$(AWK) -v emit_graphics_props=1 -f $(srcdir)/genprops.awk $< > $@-t
+	mv $@-t $@
+
+corefcn/oct-errno.cc: corefcn/oct-errno.in.cc Makefile
+	if test -n "$(PERL)"; then \
+	  $(srcdir)/mk-errno-list --perl "$(PERL)" < $< > $@-t; \
+	elif test -n "$(PYTHON)"; then \
+	  $(srcdir)/mk-errno-list --python "$(PYTHON)" < $< > $@-t; \
+	else \
+	  $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \
+	fi
+	mv $@-t $@
+
+corefcn/mxarray.h: corefcn/mxarray.in.h Makefile
+	$(SED) < $< \
+	  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
+	  -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|" > $@-t
+	mv $@-t $@
 
 noinst_LTLIBRARIES += corefcn/libcorefcn.la
 
rename from libinterp/interp-core/mxarray.in.h
rename to libinterp/corefcn/mxarray.in.h
rename from libinterp/interp-core/oct-errno.h
rename to libinterp/corefcn/oct-errno.h
rename from libinterp/interp-core/oct-errno.in.cc
rename to libinterp/corefcn/oct-errno.in.cc
rename from libinterp/interp-core/oct-fstrm.cc
rename to libinterp/corefcn/oct-fstrm.cc
rename from libinterp/interp-core/oct-fstrm.h
rename to libinterp/corefcn/oct-fstrm.h
rename from libinterp/interp-core/oct-hdf5.h
rename to libinterp/corefcn/oct-hdf5.h
rename from libinterp/interpfcn/oct-hist.cc
rename to libinterp/corefcn/oct-hist.cc
--- a/libinterp/interpfcn/oct-hist.cc
+++ b/libinterp/corefcn/oct-hist.cc
@@ -755,8 +755,8 @@
 matching the current line to be removed from the history list before that\n\
 line is saved.  Any value not in the above list is ignored.  If\n\
 @code{history_control} is the empty string, all commands are saved on\n\
-the history list, subject to the value of @code{saving_history}.\n\
-@seealso{history_file, history_size, history_timestamp_format_string, saving_history}\n\
+the history list, subject to the value of @code{history_save}.\n\
+@seealso{history_file, history_size, history_timestamp_format_string, history_save}\n\
 @end deftypefn")
 {
   std::string old_history_control = command_history::histcontrol ();
@@ -779,7 +779,7 @@
 Query or set the internal variable that specifies how many entries\n\
 to store in the history file.  The default value is @code{1000},\n\
 but may be overridden by the environment variable @w{@env{OCTAVE_HISTSIZE}}.\n\
-@seealso{history_file, history_timestamp_format_string, saving_history}\n\
+@seealso{history_file, history_timestamp_format_string, history_save}\n\
 @end deftypefn")
 {
   int old_history_size = command_history::size ();
@@ -804,7 +804,7 @@
 file used to store command history.  The default value is\n\
 @file{~/.octave_hist}, but may be overridden by the environment\n\
 variable @w{@env{OCTAVE_HISTFILE}}.\n\
-@seealso{history_size, saving_history, history_timestamp_format_string}\n\
+@seealso{history_size, history_save, history_timestamp_format_string}\n\
 @end deftypefn")
 {
   std::string old_history_file = command_history::file ();
@@ -837,17 +837,17 @@
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
 variable value is restored when exiting the function.\n\
-@seealso{strftime, history_file, history_size, saving_history}\n\
+@seealso{strftime, history_file, history_size, history_save}\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (history_timestamp_format_string);
 }
 
-DEFUN (saving_history, args, nargout,
+DEFUN (history_save, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {@var{val} =} saving_history ()\n\
-@deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val})\n\
-@deftypefnx {Built-in Function} {} saving_history (@var{new_val}, \"local\")\n\
+@deftypefn  {Built-in Function} {@var{val} =} history_save ()\n\
+@deftypefnx {Built-in Function} {@var{old_val} =} history_save (@var{new_val})\n\
+@deftypefnx {Built-in Function} {} history_save (@var{new_val}, \"local\")\n\
 Query or set the internal variable that controls whether commands entered\n\
 on the command line are saved in the history file.\n\
 \n\
@@ -857,14 +857,14 @@
 @seealso{history_control, history_file, history_size, history_timestamp_format_string}\n\
 @end deftypefn")
 {
-  bool old_saving_history = ! command_history::ignoring_entries ();
+  bool old_history_save = ! command_history::ignoring_entries ();
 
-  bool tmp = old_saving_history;
+  bool tmp = old_history_save;
 
   octave_value retval = set_internal_variable (tmp, args, nargout,
-                                               "saving_history");
+                                               "history_save");
 
-  if (tmp != old_saving_history)
+  if (tmp != old_history_save)
     command_history::ignore_entries (! tmp);
 
   return retval;
rename from libinterp/interpfcn/oct-hist.h
rename to libinterp/corefcn/oct-hist.h
rename from libinterp/interp-core/oct-iostrm.cc
rename to libinterp/corefcn/oct-iostrm.cc
rename from libinterp/interp-core/oct-iostrm.h
rename to libinterp/corefcn/oct-iostrm.h
rename from libinterp/interp-core/oct-lvalue.cc
rename to libinterp/corefcn/oct-lvalue.cc
rename from libinterp/interp-core/oct-lvalue.h
rename to libinterp/corefcn/oct-lvalue.h
rename from libinterp/interp-core/oct-map.cc
rename to libinterp/corefcn/oct-map.cc
rename from libinterp/interp-core/oct-map.h
rename to libinterp/corefcn/oct-map.h
--- a/libinterp/interp-core/oct-map.h
+++ b/libinterp/corefcn/oct-map.h
@@ -473,8 +473,9 @@
 inline octave_map octave_value_extract<octave_map> (const octave_value& v)
   { return v.map_value (); }
 
-// The original Octave_map object. Octave_map and octave_map are convertible to
-// each other.
+// The original Octave_map object which is now deprecated.
+// It was fully deprecated in version 3.8 and should be removed in 3.12.
+// Octave_map and octave_map are convertible to each other.
 
 class
 OCTINTERP_API
@@ -654,6 +655,6 @@
       if (! contains (k))
         key_list.push_back (k);
     }
-};
+} GCC_ATTR_DEPRECATED;
 
 #endif
rename from libinterp/interp-core/oct-obj.cc
rename to libinterp/corefcn/oct-obj.cc
rename from libinterp/interp-core/oct-obj.h
rename to libinterp/corefcn/oct-obj.h
rename from libinterp/interp-core/oct-prcstrm.cc
rename to libinterp/corefcn/oct-prcstrm.cc
rename from libinterp/interp-core/oct-prcstrm.h
rename to libinterp/corefcn/oct-prcstrm.h
rename from libinterp/interp-core/oct-procbuf.cc
rename to libinterp/corefcn/oct-procbuf.cc
rename from libinterp/interp-core/oct-procbuf.h
rename to libinterp/corefcn/oct-procbuf.h
rename from libinterp/interp-core/oct-stdstrm.h
rename to libinterp/corefcn/oct-stdstrm.h
rename from libinterp/interp-core/oct-stream.cc
rename to libinterp/corefcn/oct-stream.cc
rename from libinterp/interp-core/oct-stream.h
rename to libinterp/corefcn/oct-stream.h
rename from libinterp/interp-core/oct-strstrm.cc
rename to libinterp/corefcn/oct-strstrm.cc
rename from libinterp/interp-core/oct-strstrm.h
rename to libinterp/corefcn/oct-strstrm.h
rename from libinterp/interp-core/oct.h
rename to libinterp/corefcn/oct.h
rename from libinterp/interpfcn/octave-link.cc
rename to libinterp/corefcn/octave-link.cc
--- a/libinterp/interpfcn/octave-link.cc
+++ b/libinterp/corefcn/octave-link.cc
@@ -255,7 +255,7 @@
 
               std::list<std::string>::iterator it = items_lst.begin ();
 
-              for (int idx = 0; idx < items_lst.size ()-2; idx++)
+              for (unsigned int idx = 0; idx < items_lst.size ()-2; idx++)
                 {
                   items.xelem (idx) = *it;
                   it++;
@@ -402,3 +402,36 @@
 
   return retval;
 }
+
+DEFUN (__octave_link_show_preferences__, , ,
+  "-*- texinfo -*-\n\
+@deftypefn {Built-in Function} {} __octave_link_show_preferences__ ()\n\
+Undocumented internal function.\n\
+@end deftypefn")
+{
+  octave_value retval;
+
+  retval = octave_link::show_preferences ();
+
+  return retval;
+}
+
+DEFUN (__octave_link_show_doc__, args, ,
+  "-*- texinfo -*-\n\
+@deftypefn {Built-in Function} {} __octave_link_show_doc__ ( @var{filename} )\n\
+Undocumented internal function.\n\
+@end deftypefn")
+{
+  octave_value retval;
+  std::string file;
+
+  if (args.length () >= 1)
+    file = args(0).string_value();
+
+  retval = octave_link::show_doc (file);
+
+  return retval;
+}
+
+
+
rename from libinterp/interpfcn/octave-link.h
rename to libinterp/corefcn/octave-link.h
--- a/libinterp/interpfcn/octave-link.h
+++ b/libinterp/corefcn/octave-link.h
@@ -307,6 +307,31 @@
     return instance_ok () ? instance->link_enabled : false;
   }
 
+  static bool
+  show_preferences ()
+  {
+    if (enabled ())
+      { 
+        instance->do_show_preferences ();
+        return true;
+      }
+    else
+      return false;
+  }
+
+  static bool 
+  show_doc (const std::string & file)
+  {
+    if (enabled ())
+      { 
+        instance->do_show_doc (file);
+        return true;
+      }
+    else
+      return false;
+ 
+  }
+
 private:
 
   static octave_link *instance;
@@ -425,6 +450,10 @@
 
   virtual void do_set_default_prompts (std::string& ps1, std::string& ps2,
                                        std::string& ps4) = 0;
+
+  virtual void do_show_preferences (void) = 0;
+
+  virtual void do_show_doc (const std::string &file) = 0;
 };
 
 #endif // OCTAVELINK_H
rename from libinterp/interpfcn/pager.cc
rename to libinterp/corefcn/pager.cc
rename from libinterp/interpfcn/pager.h
rename to libinterp/corefcn/pager.h
rename from libinterp/interpfcn/pr-output.cc
rename to libinterp/corefcn/pr-output.cc
--- a/libinterp/interpfcn/pr-output.cc
+++ b/libinterp/corefcn/pr-output.cc
@@ -493,7 +493,7 @@
     for (octave_idx_type i = 0; i < nr; i++)
       {
         double val = m(i,j);
-        if (xisinf (val) || xisnan (val))
+        if (! xfinite (val))
           continue;
 
         all_inf_or_nan = false;
@@ -522,7 +522,7 @@
     for (octave_idx_type i = 0; i < nr; i++)
       {
         double val = m(i,j);
-        if (xisinf (val) || xisnan (val))
+        if (xfinite (val))
           continue;
 
         all_inf_or_nan = false;
@@ -998,11 +998,9 @@
   double r_abs = rp < 0.0 ? -rp : rp;
   double i_abs = ip < 0.0 ? -ip : ip;
 
-  int r_x = (xisinf (rp) || xisnan (rp) || r_abs == 0.0)
-    ? 0 : num_digits (r_abs);
-
-  int i_x = (xisinf (ip) || xisnan (ip) || i_abs == 0.0)
-    ? 0 : num_digits (i_abs);
+  int r_x = (! xfinite (rp) || r_abs == 0.0) ? 0 : num_digits (r_abs);
+
+  int i_x = (! xfinite (ip) || i_abs == 0.0) ? 0 : num_digits (i_abs);
 
   int x_max, x_min;
 
rename from libinterp/interpfcn/pr-output.h
rename to libinterp/corefcn/pr-output.h
rename from libinterp/interp-core/procstream.cc
rename to libinterp/corefcn/procstream.cc
rename from libinterp/interp-core/procstream.h
rename to libinterp/corefcn/procstream.h
rename from libinterp/interpfcn/profiler.cc
rename to libinterp/corefcn/profiler.cc
rename from libinterp/interpfcn/profiler.h
rename to libinterp/corefcn/profiler.h
rename from libinterp/interp-core/pt-jit.cc
rename to libinterp/corefcn/pt-jit.cc
--- a/libinterp/interp-core/pt-jit.cc
+++ b/libinterp/corefcn/pt-jit.cc
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 #define __STDC_LIMIT_MACROS
 #define __STDC_CONSTANT_MACROS
 
@@ -38,9 +40,11 @@
 
 #ifdef HAVE_LLVM
 
-static bool Venable_jit_debugging = false;
+static bool Vdebug_jit = false;
 
-static bool Venable_jit_compiler = true;
+static bool Vjit_enable = true;
+
+static int Vjit_startcnt = 1000;
 
 #include <llvm/Analysis/CallGraph.h>
 #include <llvm/Analysis/Passes.h>
@@ -51,10 +55,18 @@
 #include <llvm/ExecutionEngine/JIT.h>
 #include <llvm/Module.h>
 #include <llvm/PassManager.h>
+#ifdef IRBUILDER_HEADER_IN_SUPPORT_DIR
 #include <llvm/Support/IRBuilder.h>
+#else
+#include <llvm/IRBuilder.h>
+#endif
 #include <llvm/Support/raw_os_ostream.h>
 #include <llvm/Support/TargetSelect.h>
+#ifdef HAVE_DATALAYOUT
+#include <llvm/DataLayout.h>
+#else
 #include <llvm/Target/TargetData.h>
+#endif
 #include <llvm/Transforms/IPO.h>
 #include <llvm/Transforms/Scalar.h>
 
@@ -1860,7 +1872,11 @@
   module_pass_manager->add (llvm::createAlwaysInlinerPass ());
 
   pass_manager = new llvm::FunctionPassManager (module);
-  pass_manager->add (new llvm::TargetData(*engine->getTargetData ()));
+#if HAVE_DATALAYOUT
+  pass_manager->add (new llvm::DataLayout (*engine->getDataLayout ()));
+#else
+  pass_manager->add (new llvm::TargetData (*engine->getTargetData ()));
+#endif
   pass_manager->add (llvm::createCFGSimplificationPass ());
   pass_manager->add (llvm::createBasicAliasAnalysisPass ());
   pass_manager->add (llvm::createPromoteMemoryToRegisterPass ());
@@ -1878,8 +1894,6 @@
 bool
 tree_jit::do_execute (tree_simple_for_command& cmd, const octave_value& bounds)
 {
-  const size_t MIN_TRIP_COUNT = 1000;
-
   size_t tc = trip_count (bounds);
   if (! tc || ! initialize () || ! enabled ())
     return false;
@@ -1890,7 +1904,7 @@
   jit_info *info = cmd.get_info ();
   if (! info || ! info->match (extra_vars))
     {
-      if (tc < MIN_TRIP_COUNT)
+      if (tc < static_cast<size_t> (Vjit_startcnt))
         return false;
 
       delete info;
@@ -1942,7 +1956,7 @@
   // Ideally, we should only disable JIT if there is a breakpoint in the code we
   // are about to run. However, we can't figure this out in O(1) time, so we
   // conservatively check for the existence of any breakpoints.
-  return Venable_jit_compiler && ! bp_table::have_breakpoints ()
+  return Vjit_enable && ! bp_table::have_breakpoints ()
     && ! Vdebug_on_interrupt && ! Vdebug_on_error;
 }
 
@@ -1963,13 +1977,13 @@
 void
 tree_jit::optimize (llvm::Function *fn)
 {
-  if (Venable_jit_debugging)
+  if (Vdebug_jit)
     llvm::verifyModule (*module);
 
   module_pass_manager->run (*module);
   pass_manager->run (*fn);
 
-  if (Venable_jit_debugging)
+  if (Vdebug_jit)
     {
       std::string error;
       llvm::raw_fd_ostream fout ("test.bc", error,
@@ -1998,7 +2012,7 @@
                        conv.get_variable_map ());
       infer.infer ();
 
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           jit_block_list& blocks = infer.get_blocks ();
           blocks.label ();
@@ -2019,7 +2033,7 @@
                                          factory.constants (), fcn,
                                          argument_types);
 
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           std::cout << "-------------------- raw function ";
           std::cout << "--------------------\n";
@@ -2067,7 +2081,7 @@
       llvm::Function *llvm_function = wrapper.to_llvm ();
       tjit.optimize (llvm_function);
 
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           std::cout << "-------------------- optimized and wrapped ";
           std::cout << "--------------------\n";
@@ -2083,7 +2097,7 @@
     {
       argument_types.clear ();
 
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           if (e.known ())
             std::cout << "jit fail: " << e.what () << std::endl;
@@ -2221,7 +2235,7 @@
 
       infer.infer ();
 
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           jit_block_list& blocks = infer.get_blocks ();
           blocks.label ();
@@ -2240,7 +2254,7 @@
     }
   catch (const jit_fail_exception& e)
     {
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           if (e.known ())
             std::cout << "jit fail: " << e.what () << std::endl;
@@ -2249,7 +2263,7 @@
 
   if (llvm_function)
     {
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           std::cout << "-------------------- llvm ir --------------------";
           std::cout << *llvm_function << std::endl;
@@ -2258,7 +2272,7 @@
 
       tjit.optimize (llvm_function);
 
-      if (Venable_jit_debugging)
+      if (Vdebug_jit)
         {
           std::cout << "-------------------- optimized llvm ir "
                     << "--------------------\n";
@@ -2280,412 +2294,70 @@
 
 #endif
 
-DEFUN (enable_jit_debugging, args, nargout,
+DEFUN (debug_jit, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {@var{val} =} enable_jit_debugging ()\n\
-@deftypefnx {Built-in Function} {@var{old_val} =} enable_jit_debugging (@var{new_val})\n\
-@deftypefnx {Built-in Function} {} enable_jit_debugging (@var{new_val}, \"local\")\n\
+@deftypefn  {Built-in Function} {@var{val} =} debug_jit ()\n\
+@deftypefnx {Built-in Function} {@var{old_val} =} debug_jit (@var{new_val})\n\
+@deftypefnx {Built-in Function} {} debug_jit (@var{new_val}, \"local\")\n\
 Query or set the internal variable that determines whether\n\
 debugging/tracing is enabled for Octave's JIT compiler.\n\
 \n\
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
 variable value is restored when exiting the function.\n\
-@seealso{enable_jit_compiler}\n\
+@seealso{jit_enable, jit_startcnt}\n\
 @end deftypefn")
 {
 #if defined (HAVE_LLVM)
-  return SET_INTERNAL_VARIABLE (enable_jit_debugging);
+  return SET_INTERNAL_VARIABLE (debug_jit);
 #else
-  warning ("enable_jit_debugging: JIT compiling not available in this version of Octave");
+  warning ("debug_jit: JIT compiling not available in this version of Octave");
   return octave_value ();
 #endif
 }
 
-DEFUN (enable_jit_compiler, args, nargout,
+DEFUN (jit_enable, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {@var{val} =} enable_jit_compiler ()\n\
-@deftypefnx {Built-in Function} {@var{old_val} =} enable_jit_compiler (@var{new_val})\n\
-@deftypefnx {Built-in Function} {} enable_jit_compiler (@var{new_val}, \"local\")\n\
+@deftypefn  {Built-in Function} {@var{val} =} jit_enable ()\n\
+@deftypefnx {Built-in Function} {@var{old_val} =} jit_enable (@var{new_val})\n\
+@deftypefnx {Built-in Function} {} jit_enable (@var{new_val}, \"local\")\n\
 Query or set the internal variable that enables Octave's JIT compiler.\n\
 \n\
 When called from inside a function with the \"local\" option, the variable is\n\
 changed locally for the function and any subroutines it calls.  The original\n\
 variable value is restored when exiting the function.\n\
-@seealso{enable_jit_debugging}\n\
+@seealso{jit_startcnt, debug_jit}\n\
 @end deftypefn")
 {
 #if defined (HAVE_LLVM)
-  return SET_INTERNAL_VARIABLE (enable_jit_compiler);
+  return SET_INTERNAL_VARIABLE (jit_enable);
 #else
-  warning ("enable_jit_compiler: JIT compiling not available in this version of Octave");
+  warning ("jit_enable: JIT compiling not available in this version of Octave");
   return octave_value ();
 #endif
 }
 
-/*
-Test some simple cases that compile.
-
-%!test
-%! for i=1:1e6
-%!   if i < 5
-%!     break
-%!   else
-%!     break
-%!   endif
-%! endfor
-%! assert (i, 1);
-
-%!test
-%! while 1
-%!   if 1
-%!     break
-%!  else
-%!    break
-%!  endif
-%! endwhile
-
-%!test
-%! for i=1:1e6
-%!   if i == 100
-%!     break
-%!   endif
-%! endfor
-%! assert (i, 100);
-
-%!test
-%! inc = 1e-5;
-%! result = 0;
-%! for ii = 0:inc:1
-%!   result = result + inc * (1/3 * ii * ii);
-%! endfor
-%! assert (abs (result - 1/9) < 1e-5);
-
-%!test
-%! inc = 1e-5;
-%! result = 0;
-%! for ii = 0:inc:1
-%!   # the ^ operator's result is complex
-%!   result = result + inc * (1/3 * ii ^ 2);
-%! endfor
-%! assert (abs (result - 1/9) < 1e-5);
-
-%!test
-%! temp = 1+1i;
-%! nan = NaN;
-%! while 1
-%!   temp = temp - 1i;
-%!   temp = temp * nan;
-%!   break;
-%! endwhile
-%! assert (imag (temp), 0);
-
-%!test
-%! temp = 1+1i;
-%! nan = NaN+1i;
-%! while 1
-%!   nan = nan - 1i;
-%!   temp = temp - 1i;
-%!   temp = temp * nan;
-%!   break;
-%! endwhile
-%! assert (imag (temp), 0);
-
-%!test
-%! temp = 1+1i;
-%! while 1
-%!   temp = temp * 5;
-%!   break;
-%! endwhile
-%! assert (temp, 5+5i);
-
-%!test
-%! nr = 1001;
-%! mat = zeros (1, nr);
-%! for i = 1:nr
-%!   mat(i) = i;
-%! endfor
-%! assert (mat == 1:nr);
-
-%!test
-%! nr = 1001;
-%! mat = 1:nr;
-%! mat(end) = 0; # force mat to a matrix
-%! total = 0;
-%! for i = 1:nr
-%!   total = mat(i) + total;
-%! endfor
-%! assert (sum (mat) == total);
-
-%!test
-%! nr = 1001;
-%! mat = [3 1 5];
-%! try
-%!   for i = 1:nr
-%!     if i > 500
-%!       result = mat(100);
-%!     else
-%!       result = i;
-%!     endif
-%!   endfor
-%! catch
-%! end
-%! assert (result == 500);
-
-%!function result = gen_test (n)
-%!  result = double (rand (1, n) > .01);
-%!endfunction
-
-%!function z = vectorized (A, K)
-%!  temp = ones (1, K);
-%!  z = conv (A, temp);
-%!  z = z > K-1;
-%!  z = conv (z, temp);
-%!  z = z(K:end-K+1);
-%!  z = z >= 1;
-%!endfunction
-
-%!function z = loopy (A, K)
-%!  z = A;
-%!  n = numel (A);
-%!  counter = 0;
-%!  for ii=1:n
-%!    if z(ii)
-%!      counter = counter + 1;
-%!    else
-%!      if counter > 0 && counter < K
-%!        z(ii-counter:ii-1) = 0;
-%!      endif
-%!      counter = 0;
-%!    endif
-%!  endfor
-%!
-%!  if counter > 0 && counter < K
-%!    z(end-counter+1:end) = 0;
-%!  endif
-%!endfunction
-
-%!test
-%! test_set = gen_test (10000);
-%! assert (all (vectorized (test_set, 3) == loopy (test_set, 3)));
-
-%!test
-%! niter = 1001;
-%! i = 0;
-%! while (i < niter)
-%!   i = i + 1;
-%! endwhile
-%! assert (i == niter);
-
-%!test
-%! niter = 1001;
-%! result = 0;
-%! m = [5 10];
-%! for i=1:niter
-%!   result = result + m(end);
-%! endfor
-%! assert (result == m(end) * niter);
-
-%!test
-%! ndim = 100;
-%! result = 0;
-%! m = zeros (ndim);
-%! m(:) = 1:ndim^2;
-%! i = 1;
-%! while (i <= ndim)
-%!   for j = 1:ndim
-%!     result = result + m(i, j);
-%!    endfor
-%!   i = i + 1;
-%! endwhile
-%! assert (result == sum (sum (m)));
-
-%!test
-%! ndim = 100;
-%! m = zeros (ndim);
-%! i = 1;
-%! while (i <= ndim)
-%!   for j = 1:ndim
-%!     m(i, j) = (j - 1) * ndim + i;
-%!   endfor
-%!   i = i + 1;
-%! endwhile
-%! m2 = zeros (ndim);
-%! m2(:) = 1:(ndim^2);
-%! assert (all (m == m2));
-
-%!test
-%! ndim = 2;
-%! m = zeros (ndim, ndim, ndim, ndim);
-%! result = 0;
-%! i0 = 1;
-%! while (i0 <= ndim)
-%!   for i1 = 1:ndim
-%!     for i2 = 1:ndim
-%!       for i3 = 1:ndim
-%!         m(i0, i1, i2, i3) = 1;
-%!         m(i0, i1, i2, i3, 1, 1, 1, 1, 1, 1) = 1;
-%!         result = result + m(i0, i1, i2, i3);
-%!       endfor
-%!     endfor
-%!   endfor
-%!   i0 = i0 + 1;
-%! endwhile
-%! expected = ones (ndim, ndim, ndim, ndim);
-%! assert (all (m == expected));
-%! assert (result == sum (expected (:)));
-
-%!function test_divide ()
-%! state = warning ("query", "Octave:divide-by-zero").state;
-%! unwind_protect
-%!   warning ("error", "Octave:divide-by-zero");
-%!   for i=1:1e5
-%!     a = 1;
-%!     a / 0;
-%!   endfor
-%! unwind_protect_cleanup
-%!   warning (state, "Octave:divide-by-zero");
-%! end_unwind_protect
-%!endfunction
-
-%!error <division by zero> test_divide ()
-
-%!test
-%! while 1
-%!   a = 0;
-%!   result = a / 1;
-%!   break;
-%! endwhile
-%! assert (result, 0);
-
-%!test
-%! m = zeros (2, 1001);
-%! for i=1:1001
-%!   m(end, i) = i;
-%!   m(end - 1, end - i + 1) = i;
-%! endfor
-%! m2 = zeros (2, 1001);
-%! m2(1, :) = fliplr (1:1001);
-%! m2(2, :) = 1:1001;
-%! assert (m, m2);
-
-%!test
-%! m = [1 2 3];
-%! for i=1:1001
-%!   m = sin (m);
-%!   break;
-%! endfor
-%! assert (m == sin ([1  2 3]));
-
-%!test
-%! i = 0;
-%! while i < 10
-%!   i += 1;
-%! endwhile
-%! assert (i == 10);
-
-%!test
-%! i = 0;
-%! while i < 10
-%!   a = ++i;
-%! endwhile
-%! assert (i == 10);
-%! assert (a == 10);
-%!test
-%! i = 0;
-%! while i < 10
-%!   a = i++;
-%! endwhile
-%! assert (i == 10);
-%! assert (a == 9);
-
-%!test
-%! num = 2;
-%! a = zeros (1, num);
-%! i = 1;
-%! while i <= num
-%!   a(i) = norm (eye (i));
-%!   ++i;
-%! endwhile
-%! assert (a, ones (1, num));
-
-%!function test_compute_idom ()
-%! while (li <= length (l1) && si <= length (s1))
-%!   if (l1 (li) < s1 (si))
-%!     if (li == si)
-%!       break;
-%!     endif;
-%!     li++;
-%!   else
-%!     si++;
-%!   endif;
-%! endwhile
-
-%!error test_compute_idom ()
-
-%!function x = test_overload (a)
-%!  while 1
-%!    x = a;
-%!    break;
-%!  endwhile
-%!endfunction
-
-%!assert (test_overload (1), 1);
-%!assert (test_overload ([1 2]), [1 2]);
-
-%!function a = bubble (a = [3 2 1])
-%!  swapped = 1;
-%!  n = length (a);
-%!  while (swapped)
-%!    swapped = 0;
-%!    for i = 1:n-1
-%!      if a(i) > a(i + 1)
-%!        swapped = 1;
-%!        temp = a(i);
-%!        a(i) = a(i + 1);
-%!        a(i + 1) = temp;
-%!      endif
-%!    endfor
-%!  endwhile
-%!endfunction
-
-%!assert (bubble (), [1 2 3]);
-
-%!test
-%! a = 0;
-%! b = 1;
-%! for i=1:1e3
-%!   for j=1:2
-%!     a = a + b;
-%!   endfor
-%! endfor
-%! assert (a, 2000);
-%! assert (b, 1);
-
-%!test
-%! a = [1+1i 1+2i];
-%! b = 0;
-%! while 1
-%!   b = a(1);
-%!   break;
-%! endwhile
-%! assert (b, a(1));
-
-%!function test_undef ()
-%!  for i=1:1e7
-%!    XXX;
-%!  endfor
-%!endfunction
-
-%!error <undefined near> (test_undef);
-
-%!shared id
-%! id = @(x) x;
-
-%!assert (id (1), 1);
-%!assert (id (1+1i), 1+1i)
-%!assert (id (1, 2), 1)
-%!error <undefined> (id ())
-
-
-*/
+DEFUN (jit_startcnt, args, nargout,
+  "-*- texinfo -*-\n\
+@deftypefn  {Built-in Function} {@var{val} =} jit_startcnt ()\n\
+@deftypefnx {Built-in Function} {@var{old_val} =} jit_startcnt (@var{new_val})\n\
+@deftypefnx {Built-in Function} {} jit_startcnt (@var{new_val}, \"local\")\n\
+Query or set the internal variable that determines whether JIT compilation\n\
+will take place for a specific loop.  Because compilation is a costly\n\
+operation it does not make sense to employ JIT when the loop count is low.\n\
+By default only loops with greater than 1000 iterations will be accelerated.\n\
+\n\
+When called from inside a function with the \"local\" option, the variable is\n\
+changed locally for the function and any subroutines it calls.  The original\n\
+variable value is restored when exiting the function.\n\
+@seealso{jit_enable, debug_jit}\n\
+@end deftypefn")
+{
+#if defined (HAVE_LLVM)
+  return SET_INTERNAL_VARIABLE_WITH_LIMITS (jit_startcnt, 1,
+                                            std::numeric_limits<int>::max ());
+#else
+  warning ("jit_enable: JIT compiling not available in this version of Octave");
+  return octave_value ();
+#endif
+}
rename from libinterp/interp-core/pt-jit.h
rename to libinterp/corefcn/pt-jit.h
--- a/libinterp/interp-core/pt-jit.h
+++ b/libinterp/corefcn/pt-jit.h
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 #if !defined (octave_tree_jit_h)
 #define octave_tree_jit_h 1
 
--- a/libinterp/corefcn/quadcc.cc
+++ b/libinterp/corefcn/quadcc.cc
@@ -1495,7 +1495,7 @@
 @end example\n\
 \n\
 @noindent\n\
-which uses the element-by-element `dot' form for all operators.\n\
+which uses the element-by-element ``dot'' form for all operators.\n\
 \n\
 @var{a} and @var{b} are the lower and upper limits of integration.  Either\n\
 or both limits may be infinite.  @code{quadcc} handles an inifinite limit\n\
--- a/libinterp/corefcn/qz.cc
+++ b/libinterp/corefcn/qz.cc
@@ -342,7 +342,7 @@
 \n\
 @table @var\n\
 @item opt\n\
-for ordering eigenvalues of the GEP pencil.  The leading block\n\
+for ordering eigenvalues of the @nospell{GEP} pencil.  The leading block\n\
 of the revised pencil contains all eigenvalues that satisfy:\n\
 \n\
 @table @asis\n\
@@ -367,9 +367,9 @@
 @end enumerate\n\
 \n\
 Note: @code{qz} performs permutation balancing, but not scaling\n\
-(@pxref{doc-balance}).  The order of output arguments was selected for\n\
+(@pxref{XREFbalance}).  The order of output arguments was selected for\n\
 compatibility with @sc{matlab}.\n\
-@seealso{balance, eig, schur}\n\
+@seealso{eig, balance, lu, chol, hess, qr, qzhess, schur, svd}\n\
 @end deftypefn")
 {
   octave_value_list retval;
--- a/libinterp/corefcn/regexp.cc
+++ b/libinterp/corefcn/regexp.cc
@@ -33,7 +33,7 @@
 #include "base-list.h"
 #include "oct-locbuf.h"
 #include "quit.h"
-#include "regexp.h"
+#include "lo-regexp.h"
 #include "str-vec.h"
 
 #include "defun.h"
@@ -70,6 +70,13 @@
               retval[i] = '\b';
               break;
 
+            // Translate \< and \> to PCRE word boundary
+            case '<': // begin word boundary
+            case '>': // end word boundary
+              retval[i] = '\\';
+              retval[++i] = 'b';
+              break;
+
 #if 0
 // FIXME : To be complete, we need to handle \oN, \o{N}.
 //         The PCRE library already handles \N where N
@@ -640,11 +647,18 @@
 In addition, the following escaped characters have special meaning.\n\
 \n\
 @table @code\n\
-@item \\b\n\
-Match a word boundary\n\
+\n\
+@item \\d\n\
+Match any digit\n\
 \n\
-@item \\B\n\
-Match within a word\n\
+@item \\D\n\
+Match any non-digit\n\
+\n\
+@item \\s\n\
+Match any whitespace character\n\
+\n\
+@item \\S\n\
+Match any non-whitespace character\n\
 \n\
 @item \\w\n\
 Match any word character\n\
@@ -658,17 +672,8 @@
 @item \\>\n\
 Match the end of a word\n\
 \n\
-@item \\s\n\
-Match any whitespace character\n\
-\n\
-@item \\S\n\
-Match any non-whitespace character\n\
-\n\
-@item \\d\n\
-Match any digit\n\
-\n\
-@item \\D\n\
-Match any non-digit\n\
+@item \\B\n\
+Match within a word\n\
 @end table\n\
 \n\
 Implementation Note: For compatibility with @sc{matlab}, ordinary escape\n\
@@ -1067,7 +1072,7 @@
 \n\
 Case insensitive regular expression string matching.  Search for @var{pat} in\n\
 @var{str} and return the positions and substrings of any matches, or empty\n\
-values if there are none.  @xref{doc-regexp,,regexp}, for details on the\n\
+values if there are none.  @xref{XREFregexp,,regexp}, for details on the\n\
 syntax of the search pattern.\n\
 @seealso{regexp}\n\
 @end deftypefn")
@@ -1279,7 +1284,7 @@
 Replace occurrences of pattern @var{pat} in @var{string} with @var{repstr}.\n\
 \n\
 The pattern is a regular expression as documented for @code{regexp}.\n\
-@xref{doc-regexp,,regexp}.\n\
+@xref{XREFregexp,,regexp}.\n\
 \n\
 The replacement string may contain @code{$i}, which substitutes\n\
 for the ith set of parentheses in the match string.  For example,\n\
@@ -1305,8 +1310,9 @@
 \n\
 Implementation Note: For compatibility with @sc{matlab}, ordinary escape\n\
 sequences (e.g., \"\\n\" => newline) are processed in both @var{pat}\n\
-and @var{repstr} regardless of whether they were defined within single quotes.  Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\
-\"\\\\n\") or use the @code{regexptranslate} function.\n\
+and @var{repstr} regardless of whether they were defined within single\n\
+quotes.  Use a second backslash to stop interpolation of the escape sequence\n\
+(e.g., \"\\\\n\") or use the @code{regexptranslate} function.\n\
 @seealso{regexp, regexpi, strrep}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/schur.cc
+++ b/libinterp/corefcn/schur.cc
@@ -123,7 +123,7 @@
 The Schur@tie{}decomposition is used to compute eigenvalues of a\n\
 square matrix, and has applications in the solution of algebraic\n\
 Riccati equations in control (see @code{are} and @code{dare}).\n\
-@seealso{rsf2csf}\n\
+@seealso{rsf2csf, lu, chol, hess, qr, qz, svd}\n\
 @end deftypefn")
 {
   octave_value_list retval;
rename from libinterp/interpfcn/sighandlers.cc
rename to libinterp/corefcn/sighandlers.cc
rename from libinterp/interpfcn/sighandlers.h
rename to libinterp/corefcn/sighandlers.h
rename from libinterp/interp-core/siglist.c
rename to libinterp/corefcn/siglist.c
rename from libinterp/interp-core/siglist.h
rename to libinterp/corefcn/siglist.h
rename from libinterp/interp-core/sparse-xdiv.cc
rename to libinterp/corefcn/sparse-xdiv.cc
rename from libinterp/interp-core/sparse-xdiv.h
rename to libinterp/corefcn/sparse-xdiv.h
rename from libinterp/interp-core/sparse-xpow.cc
rename to libinterp/corefcn/sparse-xpow.cc
rename from libinterp/interp-core/sparse-xpow.h
rename to libinterp/corefcn/sparse-xpow.h
--- a/libinterp/corefcn/svd.cc
+++ b/libinterp/corefcn/svd.cc
@@ -121,7 +121,7 @@
 If given a second argument, @code{svd} returns an economy-sized\n\
 decomposition, eliminating the unnecessary rows or columns of @var{U} or\n\
 @var{V}.\n\
-@seealso{svd_driver, svds, eig}\n\
+@seealso{svd_driver, svds, eig, lu, chol, hess, qr, qz}\n\
 @end deftypefn")
 {
   octave_value_list retval;
rename from libinterp/interpfcn/symtab.cc
rename to libinterp/corefcn/symtab.cc
rename from libinterp/interpfcn/symtab.h
rename to libinterp/corefcn/symtab.h
--- a/libinterp/interpfcn/symtab.h
+++ b/libinterp/corefcn/symtab.h
@@ -31,7 +31,7 @@
 #include <string>
 
 #include "glob-match.h"
-#include "regexp.h"
+#include "lo-regexp.h"
 
 class tree_argument_list;
 class octave_user_function;
rename from libinterp/interpfcn/sysdep.cc
rename to libinterp/corefcn/sysdep.cc
rename from libinterp/interpfcn/sysdep.h
rename to libinterp/corefcn/sysdep.h
rename from libinterp/interpfcn/toplev.cc
rename to libinterp/corefcn/toplev.cc
--- a/libinterp/interpfcn/toplev.cc
+++ b/libinterp/corefcn/toplev.cc
@@ -634,6 +634,9 @@
     }
   while (retval == 0);
 
+  if (retval == EOF)
+    retval = 0;
+
   return retval;
 }
 
@@ -751,7 +754,7 @@
   else
     {
       if (octave_exit)
-        (*octave_exit) (retval == EOF ? 0 : retval);
+        (*octave_exit) (retval);
     }
 }
 
rename from libinterp/interpfcn/toplev.h
rename to libinterp/corefcn/toplev.h
--- a/libinterp/interpfcn/toplev.h
+++ b/libinterp/corefcn/toplev.h
@@ -40,6 +40,7 @@
 
 #include "input.h"
 #include "oct-map.h"
+#include "symtab.h"
 
 
 typedef void (*octave_exit_func) (int);
--- a/libinterp/corefcn/tril.cc
+++ b/libinterp/corefcn/tril.cc
@@ -356,9 +356,9 @@
 The default value of @var{k} is zero, so that @code{triu} and\n\
 @code{tril} normally include the main diagonal as part of the result.\n\
 \n\
-If the value of @var{k} is nonzero integer, the selection of elements\
-starts at an offset of @var{k} diagonals above or below the main\
-diagonal; above for positive @var{k} and below for negative @var{k}.\
+If the value of @var{k} is nonzero integer, the selection of elements\n\
+starts at an offset of @var{k} diagonals above or below the main\n\
+diagonal; above for positive @var{k} and below for negative @var{k}.\n\
 \n\
 The absolute value of @var{k} must not be greater than the number of\n\
 sub-diagonals or super-diagonals.\n\
rename from libinterp/interp-core/txt-eng-ft.cc
rename to libinterp/corefcn/txt-eng-ft.cc
rename from libinterp/interp-core/txt-eng-ft.h
rename to libinterp/corefcn/txt-eng-ft.h
rename from libinterp/interp-core/txt-eng.h
rename to libinterp/corefcn/txt-eng.h
rename from libinterp/interp-core/txt-latex.cc
rename to libinterp/corefcn/txt-latex.cc
rename from libinterp/interp-core/txt-latex.h
rename to libinterp/corefcn/txt-latex.h
rename from libinterp/interp-core/txt-render.cc
rename to libinterp/corefcn/txt-render.cc
rename from libinterp/interp-core/txt-render.h
rename to libinterp/corefcn/txt-render.h
rename from libinterp/interp-core/unwind-prot.cc
rename to libinterp/corefcn/unwind-prot.cc
rename from libinterp/interp-core/unwind-prot.h
rename to libinterp/corefcn/unwind-prot.h
rename from libinterp/interpfcn/utils.cc
rename to libinterp/corefcn/utils.cc
rename from libinterp/interpfcn/utils.h
rename to libinterp/corefcn/utils.h
rename from libinterp/interpfcn/variables.cc
rename to libinterp/corefcn/variables.cc
--- a/libinterp/interpfcn/variables.cc
+++ b/libinterp/corefcn/variables.cc
@@ -36,7 +36,7 @@
 #include "oct-env.h"
 #include "file-ops.h"
 #include "glob-match.h"
-#include "regexp.h"
+#include "lo-regexp.h"
 #include "str-vec.h"
 
 #include <defaults.h>
rename from libinterp/interpfcn/variables.h
rename to libinterp/corefcn/variables.h
rename from libinterp/interpfcn/workspace-element.h
rename to libinterp/corefcn/workspace-element.h
rename from libinterp/interp-core/xdiv.cc
rename to libinterp/corefcn/xdiv.cc
rename from libinterp/interp-core/xdiv.h
rename to libinterp/corefcn/xdiv.h
rename from libinterp/interp-core/xgl2ps.c
rename to libinterp/corefcn/xgl2ps.c
rename from libinterp/interp-core/xnorm.cc
rename to libinterp/corefcn/xnorm.cc
rename from libinterp/interp-core/xnorm.h
rename to libinterp/corefcn/xnorm.h
rename from libinterp/interp-core/xpow.cc
rename to libinterp/corefcn/xpow.cc
rename from libinterp/interp-core/xpow.h
rename to libinterp/corefcn/xpow.h
rename from libinterp/interp-core/zfstream.cc
rename to libinterp/corefcn/zfstream.cc
rename from libinterp/interp-core/zfstream.h
rename to libinterp/corefcn/zfstream.h
--- a/libinterp/dldfcn/__init_fltk__.cc
+++ b/libinterp/dldfcn/__init_fltk__.cc
@@ -1219,7 +1219,7 @@
               int key_a = key2ascii (key);
               if (key_a && fp.get_keypressfcn ().is_defined ())
                 {
-                  Octave_map evt;
+                  octave_scalar_map evt;
                   evt.assign ("Character", octave_value (key_a));
                   evt.assign ("Key", octave_value (std::tolower (key_a)));
                   evt.assign ("Modifier", octave_value (modifier2cell ()));
@@ -1258,7 +1258,7 @@
               int key_a = key2ascii (key);
               if (key_a && fp.get_keyreleasefcn ().is_defined ())
                 {
-                  Octave_map evt;
+                  octave_scalar_map evt;
                   evt.assign ("Character", octave_value (key_a));
                   evt.assign ("Key", octave_value (std::tolower (key_a)));
                   evt.assign ("Modifier", octave_value (modifier2cell ()));
@@ -1286,7 +1286,7 @@
                 set_axes_currentpoint (ax_obj, pos_x, pos_y);
               }
 
-            fp.execute_windowbuttondownfcn ();
+            fp.execute_windowbuttondownfcn (Fl::event_button()); 
 
             if (Fl::event_button () == 1 || Fl::event_button () == 3)
               return 1;
@@ -1845,7 +1845,18 @@
   bool is_valid (void) const { return true; }
 
   bool initialize (const graphics_object& go)
-    { return go.isa ("figure"); }
+  {
+    if (go.isa ("figure")
+        || go.isa ("uimenu"))
+      {
+        if (go.isa ("uimenu"))
+          update (go, uimenu::properties::ID_LABEL);
+
+        return true;
+      }
+
+    return false;
+  }
 
   void finalize (const graphics_object& go)
   {
@@ -2071,7 +2082,7 @@
 
 DEFUN_DLD (__have_fltk__, , ,
   "-*- texinfo -*-\n\
-@deftypefn  {Loadable Function} {@var{FLTK_available} =} __have_fltk__ ()\n\
+@deftypefn {Loadable Function} {@var{FLTK_available} =} __have_fltk__ ()\n\
 Undocumented internal function.\n\
 @end deftypefn")
 {
--- a/libinterp/dldfcn/__magick_read__.cc
+++ b/libinterp/dldfcn/__magick_read__.cc
@@ -1,5 +1,6 @@
 /*
 
+Copyright (C) 2013 Carnë Draug
 Copyright (C) 2002-2012 Andy Adler
 Copyright (C) 2008 Thomas L. Scofield
 Copyright (C) 2010 David Grundberg
@@ -36,419 +37,386 @@
 #include "error.h"
 #include "ov-struct.h"
 
+#include "gripes.h"
+
 #ifdef HAVE_MAGICK
 
 #include <Magick++.h>
 #include <clocale>
 
-octave_value_list
+template <class T>
+static octave_value_list
 read_indexed_images (std::vector<Magick::Image>& imvec,
-                     const Array<int>& frameidx, bool wantalpha)
+                     const Array<octave_idx_type>& frameidx,
+                     const octave_idx_type nargout)
 {
-  octave_value_list output;
-
-  int rows = imvec[0].baseRows ();
-  int columns = imvec[0].baseColumns ();
-  int nframes = frameidx.length ();
+  typedef typename T::element_type P;
 
-  dim_vector idim = dim_vector ();
-  idim.resize (4);
-  idim(0) = rows;
-  idim(1) = columns;
-  idim(2) = 1;
-  idim(3) = nframes;
+  octave_value_list retval (3, Matrix ());
 
-  Array<int> idx (dim_vector (4, 1));
+  const octave_idx_type nRows    = imvec[0].baseRows ();
+  const octave_idx_type nCols    = imvec[0].baseColumns ();
+  const octave_idx_type nFrames  = frameidx.length ();
 
-  Magick::ImageType type = imvec[0].type ();
+  T img       = T (dim_vector (nRows, nCols, 1, nFrames));
+  P* img_fvec = img.fortran_vec ();
 
-  unsigned int mapsize = imvec[0].colorMapSize ();
-  unsigned int i = mapsize;
-  unsigned int depth = 0;
-  while (i >>= 1)
-    depth++;
-  i = 0;
-  depth--;
-  while (depth >>= 1)
-    i++;
-  depth = 1 << i;
-
-  switch (depth)
+  // When reading PixelPackets from the Image Pixel Cache, they come in
+  // row major order. So we keep moving back and forth there so we can
+  // write the image in column major order.
+  octave_idx_type idx = 0;
+  for (octave_idx_type frame = 0; frame < nFrames; frame++)
     {
-    case 1:
-    case 2:
-    case 4:
-    case 8:
-      {
-        uint8NDArray im = uint8NDArray (idim);
+      imvec[frameidx(frame)].getConstPixels (0, 0, nCols, nRows);
+
+      const Magick::IndexPacket *pix
+        = imvec[frameidx(frame)].getConstIndexes ();
 
-        idx(2) = 0;
-        for (int frame = 0; frame < nframes; frame++)
-          {
-            imvec[frameidx(frame)].getConstPixels (0, 0, columns, rows);
+      for (octave_idx_type col = 0; col < nCols; col++)
+        {
+          for (octave_idx_type row = 0; row < nRows; row++)
+            {
+              img_fvec[idx++] = static_cast<P> (*pix);
+              pix += nCols;
+            }
+          pix -= nCols * nRows -1;
+        }
+    }
+  retval(0) = octave_value (img);
 
-            const Magick::IndexPacket *pix
-              = imvec[frameidx(frame)].getConstIndexes ();
+  // Do we need to get the colormap to interpret the image and alpha channel?
+  if (nargout > 1)
+    {
+      const octave_idx_type mapsize = imvec[0].colorMapSize ();
+      Matrix cmap                   = Matrix (mapsize, 3);
 
-            i = 0;
-            idx(3) = frame;
+      // In theory, it should be possible for each frame of an image to
+      // have different colormaps but for Matlab compatibility, we only
+      // return the colormap of the first frame.
 
-            for (int y = 0; y < rows; y++)
-              {
-                idx(0) = y;
-                for (int x = 0; x < columns; x++)
-                  {
-                    idx(1) = x;
-                    im(idx) = static_cast<octave_uint8> (pix[i++]);
-                  }
-              }
-          }
+      // only get alpha channel if it exists and was requested as output
+      if (imvec[0].matte () && nargout >= 3)
+        {
+          Matrix amap = Matrix (mapsize, 1);
+          for (octave_idx_type i = 0; i < mapsize; i++)
+            {
+              const Magick::ColorRGB c = imvec[0].colorMap (i);
+              cmap(i,0) = c.red   ();
+              cmap(i,1) = c.green ();
+              cmap(i,2) = c.blue  ();
+              amap(i,0) = c.alpha ();
+            }
 
-        output(0) = octave_value (im);
-      }
-      break;
+          NDArray alpha (dim_vector (nRows, nCols, 1, nFrames));
+          const octave_idx_type nPixels = alpha.numel ();
 
-    case 16:
-      {
-        uint16NDArray im = uint16NDArray (idim);
+          double* alpha_fvec = alpha.fortran_vec ();
 
-        idx(2) = 0;
-        for (int frame = 0; frame < nframes; frame++)
-          {
-            imvec[frameidx(frame)].getConstPixels (0, 0, columns, rows);
-
-            const Magick::IndexPacket *pix
-              = imvec[frameidx(frame)].getConstIndexes ();
-
-            i = 0;
-            idx(3) = frame;
+          idx = 0;
+          for (octave_idx_type pix = 0; pix < nPixels; pix++)
+            {
+              // GraphicsMagick stores the alpha values inverted, i.e.,
+              // 1 for transparent and 0 for opaque so we fix that here.
+              alpha_fvec[idx] = abs (amap(img(idx), 0) - 1);
+              idx++;
+            }
+          retval(2) = alpha;
+        }
 
-            for (int y = 0; y < rows; y++)
-              {
-                idx(0) = y;
-                for (int x = 0; x < columns; x++)
-                  {
-                    idx(1) = x;
-                    im(idx) = static_cast<octave_uint16> (pix[i++]);
-                  }
-              }
-          }
+      else
+        {
+          for (octave_idx_type i = 0; i < mapsize; i++)
+            {
+              const Magick::ColorRGB c = imvec[0].colorMap (i);
+              cmap(i,0) = c.red   ();
+              cmap(i,1) = c.green ();
+              cmap(i,2) = c.blue  ();
+            }
+        }
 
-        output(0) = octave_value (im);
-      }
-      break;
-
-    default:
-      error ("__magic_read__: index depths greater than 16-bit are not supported");
-      return octave_value_list ();
+      retval(1) = cmap;
     }
 
-  Matrix map = Matrix (mapsize, 3);
-  Matrix alpha;
-
-  switch (type)
-    {
-    case Magick::PaletteMatteType:
-#if 0
-      warning ("palettematte");
-      Matrix map (mapsize, 3);
-      Matrix alpha (mapsize, 1);
-      for (i = 0; i < mapsize; i++)
-        {
-          warning ("%d", i);
-          Magick::ColorRGB c = imvec[0].colorMap (i);
-          map(i,0) = c.red ();
-          map(i,1) = c.green ();
-          map(i,2) = c.blue ();
-          alpha(i,1) = c.alpha ();
-        }
-      break;
-#endif
-
-    case Magick::PaletteType:
-      alpha = Matrix (0, 0);
-      for (i = 0; i < mapsize; i++)
-        {
-          Magick::ColorRGB c = imvec[0].colorMap (i);
-          map(i,0) = c.red ();
-          map(i,1) = c.green ();
-          map(i,2) = c.blue ();
-        }
-      break;
-
-    default:
-      error ("__magick_read__: unsupported indexed image type");
-      return octave_value_list ();
-    }
-
-  if (wantalpha)
-    output(2) = alpha;
-
-  output(1) = map;
-
-  return output;
+  return retval;
 }
 
+// This function is highly repetitive, a bunch of for loops that are
+// very similar to account for different image types. They are different
+// enough that trying to reduce the copy and paste would decrease its
+// readability too much.
 template <class T>
 octave_value_list
-read_images (const std::vector<Magick::Image>& imvec,
-             const Array<int>& frameidx, unsigned int depth)
+read_images (std::vector<Magick::Image>& imvec,
+             const Array<octave_idx_type>& frameidx)
 {
   typedef typename T::element_type P;
 
   octave_value_list retval (3, Matrix ());
 
-  T im;
-
-  int rows = imvec[0].baseRows ();
-  int columns = imvec[0].baseColumns ();
-  int nframes = frameidx.length ();
+  const octave_idx_type nRows   = imvec[0].baseRows ();
+  const octave_idx_type nCols   = imvec[0].baseColumns ();
+  const octave_idx_type nFrames = frameidx.length ();
+  T img;
 
-  dim_vector idim = dim_vector ();
-  idim.resize (4);
-  idim(0) = rows;
-  idim(1) = columns;
-  idim(2) = 1;
-  idim(3) = nframes;
+  // GraphicsMagick (GM) keeps the image values in memory using whatever
+  // QuantumDepth it was built with independently of the original image
+  // bitdepth. Basically this means that if GM was built with quantum 16
+  // all values are scaled in the uint16 range. If the original image
+  // had an 8 bit depth, we need to rescale it for that range.
+  // However, if the image had a bitdepth of 32, then we will be returning
+  // a floating point image. In this case, the values need to be rescaled
+  // for the range [0 1] (this is what Matlab has documented on the page
+  // about image types but in some cases seems to be doing something else.
+  // See bug #39249).
+  // Finally, we must do the division ourselves (set a divisor) instead of
+  // using quantumOperator for the cases where we will be returning floating
+  // point and want things in the range [0 1]. This is the same reason why
+  // the divisor is of type double.
+  const double divisor = (imvec[0].depth () == 32) ?
+                         std::numeric_limits<uint32_t>::max () :
+                         ((uint64_t (1) << QuantumDepth) - 1) / 
+                         ((uint64_t (1) << imvec[0].depth ()) - 1);
 
+  // FIXME: this workaround should probably be fixed in GM by creating a
+  //        new ImageType BilevelMatteType
+  // Despite what GM documentation claims, opacity is not only on the types
+  // with Matte on the name. It is possible that an image is completely
+  // black (1 color), and have a second channel set for transparency (2nd
+  // color). Its type will be bilevel since there is no BilevelMatte. The
+  // only way to check for this seems to be by checking matte ().
   Magick::ImageType type = imvec[0].type ();
-  const int divisor = ((uint64_t (1) << QuantumDepth) - 1) / 
-                      ((uint64_t (1) << depth) - 1);
+  if (type == Magick::BilevelType && imvec[0].matte ())
+    {
+      type = Magick::GrayscaleMatteType;
+    }
 
   switch (type)
     {
-    case Magick::BilevelType:
-    case Magick::GrayscaleType:
+    case Magick::BilevelType:           // Monochrome bi-level image
+    case Magick::GrayscaleType:         // Grayscale image
       {
-        im = T (idim);
-        P *vec = im.fortran_vec ();
+        img = T (dim_vector (nRows, nCols, 1, nFrames));
+        P *img_fvec = img.fortran_vec ();
+
+        octave_idx_type idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            const Magick::PixelPacket *pix
+              = imvec[frameidx(frame)].getConstPixels (0, 0, nCols, nRows);
 
-        for (int frame = 0; frame < nframes; frame++)
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    img_fvec[idx++] = pix->red / divisor;
+                    pix += nCols;
+                  }
+                pix -= nRows * nCols -1;
+              }
+          }
+        break;
+      }
+
+    case Magick::GrayscaleMatteType:    // Grayscale image with opacity
+      {
+        img   = T (dim_vector (nRows, nCols, 1, nFrames));
+        T alpha   (dim_vector (nRows, nCols, 1, nFrames));
+        P *img_fvec = img.fortran_vec ();
+        P *a_fvec   = alpha.fortran_vec ();
+
+        octave_idx_type idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
           {
             const Magick::PixelPacket *pix
-              = imvec[frameidx(frame)].getConstPixels (0, 0, columns, rows);
-
-            P *rbuf = vec;
-            for (int y = 0; y < rows; y++)
-              {
-                for (int x = 0; x < columns; x++)
-                  {
-                    *rbuf = pix->red / divisor;
-                    pix++;
-                    rbuf += rows;
-                  }
-                rbuf -= rows * columns - 1;
-              }
+              = imvec[frameidx(frame)].getConstPixels (0, 0, nCols, nRows);
 
-            // Next frame.
-            vec += rows * columns * idim(2);
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    img_fvec[idx] = pix->red / divisor;
+                    a_fvec[idx] = pix->opacity / divisor;
+                    pix += nCols;
+                    idx++;
+                  }
+                pix -= nRows * nCols -1;
+              }
           }
-        }
-      break;
+        retval(2) = alpha;
+        break;
+      }
 
-    case Magick::GrayscaleMatteType:
+    case Magick::PaletteType:           // Indexed color (palette) image
+    case Magick::TrueColorType:         // Truecolor image
       {
-        idim(2) = 2;
-        im = T (idim);
-        P *vec = im.fortran_vec ();
+        img = T (dim_vector (nRows, nCols, 3, nFrames));
+        P *img_fvec = img.fortran_vec ();
 
-        for (int frame = 0; frame < nframes; frame++)
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
           {
             const Magick::PixelPacket *pix
-              = imvec[frameidx(frame)].getConstPixels (0, 0, columns, rows);
+              = imvec[frameidx(frame)].getConstPixels (0, 0, nCols, nRows);
 
-            P *rbuf = vec;
-            P *obuf = vec + rows * columns;
-            for (int y = 0; y < rows; y++)
+            octave_idx_type idx = 0;
+            img_fvec += nRows * nCols * frame;
+            P *rbuf   = img_fvec;
+            P *gbuf   = img_fvec + nRows * nCols;
+            P *bbuf   = img_fvec + nRows * nCols * 2;
+
+            for (octave_idx_type col = 0; col < nCols; col++)
               {
-                for (int x = 0; x < columns; x++)
+                for (octave_idx_type row = 0; row < nRows; row++)
                   {
-                    *rbuf = pix->red / divisor;
-                    *obuf = pix->opacity / divisor;
-                    pix++;
-                    rbuf += rows;
-                    obuf += rows;
+                    rbuf[idx] = pix->red   / divisor;
+                    gbuf[idx] = pix->green / divisor;
+                    bbuf[idx] = pix->blue  / divisor;
+                    pix += nCols;
+                    idx++;
                   }
-                rbuf -= rows * columns - 1;
-                obuf -= rows * columns - 1;
+                pix -= nRows * nCols -1;
               }
-
-            // Next frame.
-            vec += rows * columns * idim(2);
           }
-        }
-      break;
+        break;
+      }
 
-    case Magick::PaletteType:
-    case Magick::TrueColorType:
+    case Magick::PaletteMatteType:      // Indexed color (palette) image with opacity
+    case Magick::TrueColorMatteType:    // Truecolor image with opacity
       {
-        idim(2) = 3;
-        im = T (idim);
-        P *vec = im.fortran_vec ();
+        img   = T (dim_vector (nRows, nCols, 3, nFrames));
+        T alpha   (dim_vector (nRows, nCols, 1, nFrames));
+        P *img_fvec = img.fortran_vec ();
+        P *a_fvec   = alpha.fortran_vec ();
 
-        for (int frame = 0; frame < nframes; frame++)
+        // Unlike the index for the other channels, this one won't need
+        // to be reset on each frame since it's a separate matrix.
+        octave_idx_type a_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
           {
             const Magick::PixelPacket *pix
-              = imvec[frameidx(frame)].getConstPixels (0, 0, columns, rows);
+              = imvec[frameidx(frame)].getConstPixels (0, 0, nCols, nRows);
 
-            P *rbuf = vec;
-            P *gbuf = vec + rows * columns;
-            P *bbuf = vec + rows * columns * 2;
-            for (int y = 0; y < rows; y++)
+            octave_idx_type idx = 0;
+            img_fvec += nRows * nCols * frame;
+            P *rbuf   = img_fvec;
+            P *gbuf   = img_fvec + nRows * nCols;
+            P *bbuf   = img_fvec + nRows * nCols * 2;
+
+            for (octave_idx_type col = 0; col < nCols; col++)
               {
-                for (int x = 0; x < columns; x++)
+                for (octave_idx_type row = 0; row < nRows; row++)
                   {
-                    *rbuf = pix->red / divisor;
-                    *gbuf = pix->green / divisor;
-                    *bbuf = pix->blue / divisor;
-                    pix++;
-                    rbuf += rows;
-                    gbuf += rows;
-                    bbuf += rows;
+                    rbuf[idx]     = pix->red     / divisor;
+                    gbuf[idx]     = pix->green   / divisor;
+                    bbuf[idx]     = pix->blue    / divisor;
+                    a_fvec[a_idx] = pix->opacity / divisor;
+                    pix += nCols;
+                    idx++;
                   }
-                rbuf -= rows * columns - 1;
-                gbuf -= rows * columns - 1;
-                bbuf -= rows * columns - 1;
+                pix -= nRows * nCols -1;
               }
-
-            // Next frame.
-            vec += rows * columns * idim(2);
           }
-        }
-      break;
+        retval(2) = alpha;
+        break;
+      }
 
-    case Magick::PaletteMatteType:
-    case Magick::TrueColorMatteType:
-    case Magick::ColorSeparationType:
+    case Magick::ColorSeparationType:   // Cyan/Yellow/Magenta/Black (CYMK) image
       {
-        idim(2) = 4;
-        im = T (idim);
-        P *vec = im.fortran_vec ();
+        img   = T (dim_vector (nRows, nCols, 4, nFrames));
+        P *img_fvec = img.fortran_vec ();
 
-        for (int frame = 0; frame < nframes; frame++)
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
           {
             const Magick::PixelPacket *pix
-              = imvec[frameidx(frame)].getConstPixels (0, 0, columns, rows);
+              = imvec[frameidx(frame)].getConstPixels (0, 0, nCols, nRows);
 
-            P *rbuf = vec;
-            P *gbuf = vec + rows * columns;
-            P *bbuf = vec + rows * columns * 2;
-            P *obuf = vec + rows * columns * 3;
-            for (int y = 0; y < rows; y++)
+            octave_idx_type idx = 0;
+            img_fvec += nRows * nCols * frame;
+            P *cbuf   = img_fvec;
+            P *mbuf   = img_fvec + nRows * nCols;
+            P *ybuf   = img_fvec + nRows * nCols * 2;
+            P *kbuf   = img_fvec + nRows * nCols * 3;
+
+            for (octave_idx_type col = 0; col < nCols; col++)
               {
-                for (int x = 0; x < columns; x++)
+                for (octave_idx_type row = 0; row < nRows; row++)
                   {
-                    *rbuf = pix->red / divisor;
-                    *gbuf = pix->green / divisor;
-                    *bbuf = pix->blue / divisor;
-                    *obuf = pix->opacity / divisor;
-                    pix++;
-                    rbuf += rows;
-                    gbuf += rows;
-                    bbuf += rows;
-                    obuf += rows;
+                    cbuf[idx] = pix->red     / divisor;
+                    mbuf[idx] = pix->green   / divisor;
+                    ybuf[idx] = pix->blue    / divisor;
+                    kbuf[idx] = pix->opacity / divisor;
+                    pix += nCols;
+                    idx++;
                   }
-                rbuf -= rows * columns - 1;
-                gbuf -= rows * columns - 1;
-                bbuf -= rows * columns - 1;
-                obuf -= rows * columns - 1;
+                pix -= nRows * nCols -1;
               }
+          }
+        break;
+      }
+
+    // Cyan, magenta, yellow, and black with alpha (opacity) channel
+    case Magick::ColorSeparationMatteType:
+      {
+        img   = T (dim_vector (nRows, nCols, 4, nFrames));
+        T alpha   (dim_vector (nRows, nCols, 1, nFrames));
+        P *img_fvec = img.fortran_vec ();
+        P *a_fvec   = alpha.fortran_vec ();
+
+        // Unlike the index for the other channels, this one won't need
+        // to be reset on each frame since it's a separate matrix.
+        octave_idx_type a_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            const Magick::PixelPacket *pix
+              = imvec[frameidx(frame)].getConstPixels (0, 0, nCols, nRows);
+            // Note that for CMYKColorspace + matte (CMYKA), the opacity is
+            // stored in the assocated IndexPacket.
+            const Magick::IndexPacket *apix
+              = imvec[frameidx(frame)].getConstIndexes ();
 
-            // Next frame.
-            vec += rows * columns * idim(2);
+            octave_idx_type idx = 0;
+            img_fvec += nRows * nCols * frame;
+            P *cbuf   = img_fvec;
+            P *mbuf   = img_fvec + nRows * nCols;
+            P *ybuf   = img_fvec + nRows * nCols * 2;
+            P *kbuf   = img_fvec + nRows * nCols * 3;
+
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    cbuf[idx]     = pix->red     / divisor;
+                    mbuf[idx]     = pix->green   / divisor;
+                    ybuf[idx]     = pix->blue    / divisor;
+                    kbuf[idx]     = pix->opacity / divisor;
+                    a_fvec[a_idx] = *apix / divisor;
+                    pix += nCols;
+                    idx++;
+                    a_idx++;
+                  }
+                pix -= nRows * nCols -1;
+              }
           }
-        }
-      break;
+        retval(2) = alpha;
+        break;
+      }
 
     default:
-      error ("__magick_read__: undefined ImageMagick image type");
+      error ("__magick_read__: unknown Magick++ image type");
       return retval;
     }
 
-  retval(0) = im;
-
+  retval(0) = img;
   return retval;
 }
 
-#endif
 
-static void
-maybe_initialize_magick (void)
+void static
+read_file (const std::string filename, std::vector<Magick::Image>& imvec)
 {
-#ifdef HAVE_MAGICK
-
-  static bool initialized = false;
-
-  if (! initialized)
-    {
-      // Save locale as GraphicsMagick might change this (depending on version)
-      const char *static_locale = setlocale (LC_ALL, NULL);
-      const std::string locale (static_locale);
-
-      std::string program_name = octave_env::get_program_invocation_name ();
-
-      Magick::InitializeMagick (program_name.c_str ());
-
-      // Restore locale from before GraphicsMagick initialisation
-      setlocale (LC_ALL, locale.c_str ());
-
-      if (QuantumDepth < 32)
-        warning ("your version of %s limits images to %d bits per pixel",
-                 MagickPackageName, QuantumDepth);
-
-      initialized = true;
-    }
-#endif
-}
-
-DEFUN_DLD (__magick_read__, args, nargout,
-  "-*- texinfo -*-\n\
-@deftypefn  {Loadable Function} {@var{m} =} __magick_read__ (@var{fname}, @var{index})\n\
-@deftypefnx {Loadable Function} {[@var{m}, @var{colormap}] =} __magick_read__ (@var{fname}, @var{index})\n\
-@deftypefnx {Loadable Function} {[@var{m}, @var{colormap}, @var{alpha}] =} __magick_read__ (@var{fname}, @var{index})\n\
-Read images with ImageMagick++.  In general you should not be using this\n\
-function.  Instead use @code{imread}.\n\
-@seealso{imread}\n\
-@end deftypefn")
-{
-  octave_value_list output;
-
-#ifdef HAVE_MAGICK
-
-  maybe_initialize_magick ();
-
-  if (args.length () > 3 || args.length () < 1 || ! args(0).is_string ()
-      || nargout > 3)
-    {
-      print_usage ();
-      return output;
-    }
-
-  Array<int> frameidx;
-  bool all_frames = false;
-
-  if (args.length () == 2 && args(1).is_real_type ())
-    frameidx = args(1).int_vector_value ();
-  else if (args.length () == 3 && args(1).is_string ()
-           && args(1).string_value () == "frames")
-    {
-      if (args(2).is_string () && args(2).string_value () == "all")
-        all_frames = true;
-      else if (args(2).is_real_type ())
-        frameidx = args(2).int_vector_value ();
-    }
-  else
-    {
-      frameidx = Array<int> (dim_vector (1, 1));
-      frameidx(0) = 1;
-    }
-
-  std::vector<Magick::Image> imvec;
-
   try
     {
       // Read a file into vector of image objects
-      Magick::readImages (&imvec, args(0).string_value ());
+      Magick::readImages (&imvec, filename);
     }
   catch (Magick::Warning& w)
     {
@@ -456,79 +424,184 @@
     }
   catch (Magick::ErrorCoder& e)
     {
+      // FIXME: there's a WarningCoder and ErrorCoder. Shouldn't this
+      // exception cause an error?
       warning ("Magick++ coder error: %s", e.what ());
     }
   catch (Magick::Exception& e)
     {
       error ("Magick++ exception: %s", e.what ());
+      error_state = 1;
+    }
+}
+
+
+static void
+maybe_initialize_magick (void)
+{
+  static bool initialized = false;
+
+  if (! initialized)
+    {
+      // Save locale as GraphicsMagick might change this (fixed in
+      // GraphicsMagick since version 1.3.13 released on December 24, 2011)
+      const char *static_locale = setlocale (LC_ALL, NULL);
+      const std::string locale (static_locale);
+
+      const std::string program_name = octave_env::get_program_invocation_name ();
+      Magick::InitializeMagick (program_name.c_str ());
+
+      // Restore locale from before GraphicsMagick initialisation
+      setlocale (LC_ALL, locale.c_str ());
+
+      if (QuantumDepth < 32)
+        {
+          warning ("your version of %s limits images to %d bits per pixel",
+                   MagickPackageName, QuantumDepth);
+        }
+      initialized = true;
+    }
+}
+#endif
+
+DEFUN_DLD (__magick_read__, args, nargout,
+  "-*- texinfo -*-\n\
+@deftypefn {Loadable Function} {[@var{img}, @var{map}, @var{alpha}] =} __magick_read__ (@var{fname}, @var{options})\n\
+Read image with GraphicsMagick or ImageMagick.\n\
+\n\
+This is a private internal function not intended for direct use.  Instead\n\
+use @code{imread}.\n\
+\n\
+@seealso{imfinfo, imformats, imread, imwrite}\n\
+@end deftypefn")
+{
+  octave_value_list output;
+
+#ifndef HAVE_MAGICK
+  gripe_disabled_feature ("imread", "Image IO");
+#else
+
+  maybe_initialize_magick ();
+
+  if (args.length () != 2 || ! args(0).is_string ())
+    {
+      print_usage ();
       return output;
     }
 
-  int nframes = imvec.size ();
-  if (all_frames)
+  const octave_map options = args(1).map_value ();
+  if (error_state)
+    {
+      error ("__magick_read__: OPTIONS must be a struct");
+    }
+
+  std::vector<Magick::Image> imvec;
+  read_file (args(0).string_value (), imvec);
+  if (error_state)
     {
-      frameidx = Array<int> (dim_vector (1, nframes));
-      for (int i = 0; i < frameidx.length (); i++)
-        frameidx(i) = i;
+      return output;
+    }
+
+  // Prepare an Array with the indexes for the requested frames.
+  const octave_idx_type nFrames = imvec.size ();
+  Array<octave_idx_type> frameidx;
+  const octave_value indexes = options.getfield ("index")(0);
+  if (indexes.is_string () && indexes.string_value () == "all")
+    {
+      frameidx.resize (dim_vector (1, nFrames));
+      for (octave_idx_type i = 0; i < nFrames; i++)
+        {
+          frameidx(i) = i;
+        }
     }
   else
     {
-      for (int i = 0; i < frameidx.length (); i++)
+      frameidx = indexes.int_vector_value ();
+      if (error_state)
         {
-          frameidx(i) = frameidx(i) - 1;
-
-          if (frameidx(i) >= nframes || frameidx(i) < 0)
+          error ("__magick_read__: invalid value for Index/Frame");
+        }
+      // Fix indexes from base 1 to base 0, and at the same time, make
+      // sure none of the indexes is outside the range of image number.
+      const octave_idx_type n = frameidx.nelem ();
+      for (octave_idx_type i = 0; i < n; i++)
+        {
+          frameidx(i)--;
+          if (frameidx(i) < 0 || frameidx(i) > nFrames - 1)
             {
-              error ("__magick_read__: invalid INDEX vector");
+              error ("imread: index/frames specified are outside the number of images");
               return output;
             }
         }
     }
 
-  Magick::ClassType klass = imvec[0].classType ();
+  const Magick::ClassType klass = imvec[0].classType ();
+  const octave_idx_type depth   = imvec[0].depth ();
+
+  // Magick::ClassType
+  // PseudoClass:
+  // Image is composed of pixels which specify an index in a color palette.
+  // DirectClass:
+  // Image is composed of pixels which represent literal color values.
+
+  // FIXME: GraphicsMagick does not really distinguishes between indexed and
+  //        normal images. After reading a file, it decides itself the optimal
+  //        way to store the image in memory, independently of the how the
+  //        image was stored in the file. That's what ClassType returns. While
+  //        it seems to match the original file most of the times, this is
+  //        not necessarily true all the times. See
+  //          https://sourceforge.net/mailarchive/message.php?msg_id=31180507
+  //        A grayscale jpeg image reports being indexed even though the JPEG
+  //        format has no support for indexed images. So we can skip at least
+  //        for that.
 
-  if (klass == Magick::PseudoClass && nargout > 1)
-    output = read_indexed_images (imvec, frameidx, (nargout == 3));
+  if (klass == Magick::PseudoClass && imvec[0].magick () != "JPEG")
+    {
+      if (depth <= 1)
+        {
+          output = read_indexed_images <boolNDArray> (imvec, frameidx, nargout);
+        }
+      else if (depth <= 8)
+        {
+          output = read_indexed_images <uint8NDArray> (imvec, frameidx, nargout);
+        }
+      else if (depth <= 16)
+        {
+          output = read_indexed_images <uint16NDArray> (imvec, frameidx, nargout);
+        }
+      else
+        {
+          error ("imread: indexed images with depths greater than 16-bit are not supported");
+          return output;
+        }
+    }
+
   else
     {
-      unsigned int depth = imvec[0].modulusDepth ();
-      if (depth > 1)
+      if (depth <= 1)
         {
-          --depth;
-          int i = 1;
-          while (depth >>= 1)
-            i++;
-          depth = 1 << i;
+          output = read_images<boolNDArray> (imvec, frameidx);
         }
-
-      switch (depth)
+      else if (depth <= 8)
+        {
+          output = read_images<uint8NDArray> (imvec, frameidx);
+        }
+      else if (depth <= 16)
         {
-        case 1:
-          output = read_images<boolNDArray> (imvec, frameidx, depth);
-          break;
-
-        case 2:
-        case 4:
-        case 8:
-          output = read_images<uint8NDArray> (imvec, frameidx, depth) ;
-          break;
-
-        case 16:
-          output = read_images<uint16NDArray> (imvec, frameidx, depth);
-          break;
-
-        case 32:
-        case 64:
-        default:
-          error ("__magick_read__: image depths greater than 16-bit are not supported");
+          output = read_images<uint16NDArray> (imvec, frameidx);
+        }
+      else if (depth <= 32)
+        {
+          output = read_images<FloatNDArray> (imvec, frameidx);
+        }
+      else
+        {
+          error ("imread: reading of images with %i-bit depth is not supported",
+                 depth);
         }
     }
-#else
-
-  error ("imread: image reading capabilities were disabled when Octave was compiled");
 
 #endif
-
   return output;
 }
 
@@ -540,54 +613,6 @@
 #ifdef HAVE_MAGICK
 
 static void
-jpg_settings (std::vector<Magick::Image>& imvec,
-              const Octave_map& options,
-              bool)
-{
-  bool something_set = false;
-
-  // Quality setting
-  octave_value result;
-  Octave_map::const_iterator p;
-  bool found_it = false;
-
-  for (p = options.begin (); p != options.end (); p++)
-    {
-      if (options.key (p) == "Quality")
-        {
-          found_it = true;
-          result = options.contents (p).elem (0);
-          break;
-        }
-    }
-
-  if (found_it && (! result.is_empty ()))
-    {
-      something_set = true;
-
-      if (result.is_real_type ())
-        {
-          int qlev = result.int_value ();
-
-          if (qlev < 0 || qlev > 100)
-            warning ("warning: Quality setting invalid--use default of 75");
-          else
-            {
-              for (size_t fnum = 0; fnum < imvec.size (); fnum++)
-                imvec[fnum].quality (static_cast<unsigned int>(qlev));
-            }
-        }
-      else
-        warning ("warning: Quality setting invalid--use default of 75");
-    }
-
-  // Other settings go here
-
-  if (! something_set)
-    warning ("__magick_write__ warning: all write parameters ignored");
-}
-
-static void
 encode_bool_image (std::vector<Magick::Image>& imvec, const octave_value& img)
 {
   unsigned int nframes = 1;
@@ -639,7 +664,7 @@
 static void
 encode_uint_image (std::vector<Magick::Image>& imvec,
                    const octave_value& img,
-                   bool has_map)
+                   const bool has_map)
 {
   unsigned int bitdepth = 0;
   T m;
@@ -657,13 +682,13 @@
   else
     error ("__magick_write__: invalid image class");
 
-  dim_vector dsizes = m.dims ();
+  const dim_vector dsizes = m.dims ();
   unsigned int nframes = 1;
   if (dsizes.length () == 4)
     nframes = dsizes(3);
 
-  bool is_color = ((dsizes.length () > 2) && (dsizes(2) > 2));
-  bool has_alpha = (dsizes.length () > 2 && (dsizes(2) == 2 || dsizes(2) == 4));
+  const bool is_color = ((dsizes.length () > 2) && (dsizes(2) > 2));
+  const bool has_alpha = (dsizes.length () > 2 && (dsizes(2) == 2 || dsizes(2) == 4));
 
   Array<octave_idx_type> idx (dim_vector (dsizes.length (), 1));
   octave_idx_type rows = m.rows ();
@@ -766,92 +791,54 @@
     }
 }
 
-static void
-encode_map (std::vector<Magick::Image>& imvec, const NDArray& cmap)
-{
-  unsigned int mapsize = cmap.dim1 ();
-
-  for (size_t fnum = 0; fnum < imvec.size (); fnum++)
-    {
-      imvec[fnum].colorMapSize (mapsize);
-      imvec[fnum].type (Magick::PaletteType);
-    }
-
-  for (unsigned int ii = 0; ii < mapsize; ii++)
-    {
-      Magick::ColorRGB c (cmap(ii,0), cmap(ii,1), cmap(ii,2));
-
-      // FIXME -- is this case needed?
-      if (cmap.dim2 () == 4)
-        c.alpha (cmap(ii,3));
+// FIXME: this will be needed to write indexed images
+//static void
+//encode_map (std::vector<Magick::Image>& imvec, const NDArray& cmap)
+//{
+//  unsigned int mapsize = cmap.dim1 ();
 
-      try
-        {
-          for_each (imvec.begin (), imvec.end (),
-                    Magick::colorMapImage (ii, c));
-        }
-      catch (Magick::Warning& w)
-        {
-          warning ("Magick++ warning: %s", w.what ());
-        }
-      catch (Magick::ErrorCoder& e)
-        {
-          warning ("Magick++ coder error: %s", e.what ());
-        }
-      catch (Magick::Exception& e)
-        {
-          error ("Magick++ exception: %s", e.what ());
-        }
-    }
-}
+//  for (size_t fnum = 0; fnum < imvec.size (); fnum++)
+//    {
+//      imvec[fnum].colorMapSize (mapsize);
+//      imvec[fnum].type (Magick::PaletteType);
+//    }
+
+//  for (unsigned int ii = 0; ii < mapsize; ii++)
+//    {
+//      Magick::ColorRGB c (cmap(ii,0), cmap(ii,1), cmap(ii,2));
+
+//      // FIXME -- is this case needed?
+//      if (cmap.dim2 () == 4)
+//        c.alpha (cmap(ii,3));
 
-static void
-write_image (const std::string& filename, const std::string& fmt,
-             const octave_value& img,
-             const octave_value& map = octave_value (),
-             const octave_value& params = octave_value ())
-{
-  std::vector<Magick::Image> imvec;
-
-  bool has_map = map.is_defined ();
-
-  if (has_map)
-    {
-      error ("__magick_write__: direct saving of indexed images not currently supported; use ind2rgb and save converted image");
-      return;
-    }
+//      try
+//        {
+//          for_each (imvec.begin (), imvec.end (),
+//                    Magick::colorMapImage (ii, c));
+//        }
+//      catch (Magick::Warning& w)
+//        {
+//          warning ("Magick++ warning: %s", w.what ());
+//        }
+//      catch (Magick::ErrorCoder& e)
+//        {
+//          warning ("Magick++ coder error: %s", e.what ());
+//        }
+//      catch (Magick::Exception& e)
+//        {
+//          error ("Magick++ exception: %s", e.what ());
+//        }
+//    }
+//}
 
-  if (img.is_bool_type ())
-    encode_bool_image (imvec, img);
-  else if (img.is_uint8_type ())
-    encode_uint_image<uint8NDArray> (imvec, img, has_map);
-  else if (img.is_uint16_type ())
-    encode_uint_image<uint16NDArray> (imvec, img, has_map);
-  else
-    error ("__magick_write__: image type not supported");
-
-  if (! error_state && has_map)
-    {
-      NDArray cmap = map.array_value ();
-
-      if (! error_state)
-        encode_map (imvec, cmap);
-    }
-
-  if (! error_state && params.is_defined ())
-    {
-      Octave_map options = params.map_value ();
-
-      // Insert calls here to handle parameters for various image formats
-      if (fmt == "jpg" || fmt == "jpeg")
-        jpg_settings (imvec, options, has_map);
-      else
-        warning ("warning: your parameter(s) currently not supported");
-    }
-
+void static
+write_file (const std::string filename,
+            const std::string ext,
+            std::vector<Magick::Image>& imvec)
+{
   try
     {
-      Magick::writeImages (imvec.begin (), imvec.end (), fmt + ":" + filename);
+      Magick::writeImages (imvec.begin (), imvec.end (), ext + ":" + filename);
     }
   catch (Magick::Warning& w)
     {
@@ -864,6 +851,7 @@
   catch (Magick::Exception& e)
     {
       error ("Magick++ exception: %s", e.what ());
+      error_state = 1;
     }
 }
 
@@ -871,55 +859,119 @@
 
 DEFUN_DLD (__magick_write__, args, ,
   "-*- texinfo -*-\n\
-@deftypefn  {Loadable Function} {} __magick_write__ (@var{fname}, @var{fmt}, @var{img})\n\
-@deftypefnx {Loadable Function} {} __magick_write__ (@var{fname}, @var{fmt}, @var{img}, @var{map})\n\
-Write images with ImageMagick++.  In general you should not be using this\n\
-function.  Instead use @code{imwrite}.\n\
-@seealso{imread}\n\
+@deftypefn {Loadable Function} {} __magick_write__ (@var{fname}, @var{fmt}, @var{img}, @var{map}, @var{options})\n\
+Write image with GraphicsMagick or ImageMagick.\n\
+\n\
+This is a private internal function not intended for direct use.  Instead\n\
+use @code{imwrite}.\n\
+\n\
+@seealso{imfinfo, imformats, imread, imwrite}\n\
 @end deftypefn")
 {
   octave_value_list retval;
 
-#ifdef HAVE_MAGICK
+#ifndef HAVE_MAGICK
+  gripe_disabled_feature ("imwrite", "Image IO");
+#else
+
   maybe_initialize_magick ();
 
-  int nargin = args.length ();
-
-  if (nargin > 2)
+  if (args.length () != 5 || ! args(0).is_string () || ! args(1).is_string ())
     {
-      std::string filename = args(0).string_value ();
+      print_usage ();
+      return retval;
+    }
+  const std::string filename = args(0).string_value ();
+  const std::string ext      = args(1).string_value ();
 
-      if (! error_state)
-        {
-          std::string fmt = args(1).string_value ();
+  const octave_map options   = args(4).map_value ();
+  if (error_state)
+    {
+      error ("__magick_write__: OPTIONS must be a struct");
+    }
 
-          if (! error_state)
-            {
-              if (nargin > 4)
-                write_image (filename, fmt, args(2), args(3), args(4));
-              else if (nargin > 3)
-                if (args(3).is_real_type ())
-                  write_image (filename, fmt, args(2), args(3));
-                else
-                  write_image (filename, fmt, args(2), octave_value (), args(3));
-              else
-                write_image (filename, fmt, args(2));
-            }
-          else
-            error ("__magick_write__: FMT must be string");
-        }
-      else
-        error ("__magick_write__: FNAME must be a string");
+  const octave_value img  = args(2);
+  const Matrix       cmap = args(3).matrix_value ();
+  if (error_state)
+    {
+      error ("__magick_write__: invalid IMG or MAP");
+    }
+  const bool is_indexed = ! cmap.is_empty ();
+
+  // Create vector with the images to write
+  std::vector<Magick::Image> imvec;
+  if (img.is_bool_type ())
+    {
+      encode_bool_image (imvec, img);
+    }
+  else if (img.is_uint8_type ())
+    {
+      encode_uint_image<uint8NDArray> (imvec, img, is_indexed);
+    }
+  else if (img.is_uint16_type ())
+    {
+      encode_uint_image<uint16NDArray> (imvec, img, is_indexed);
     }
   else
-    print_usage ();
-#else
+    {
+      error ("__magick_write__: image type not supported");
+      return retval;
+    }
+  const int nframes = imvec.size ();
+
+  // Add colormap to image
+  if (is_indexed)
+    {
+    // FIXME: this should be implemented. At the moment, imwrite is doing the
+    //        conversion in case of indexed images.
+      error ("__magick_write__: direct saving of indexed images not currently supported; use ind2rgb and save converted image");
+//      encode_map (imvec, cmap);
+      return retval;
+    }
+
+  // Set quality.
+  // FIXME What happens when we try to set with formats that do not support it?
+  const unsigned int quality = options.getfield ("quality")(0).int_value ();
+  for (int i = 0; i < nframes; i++)
+    {
+      imvec[i].quality (quality);
+    }
 
-  error ("__magick_write__: not available in this version of Octave");
+  // Finally, save the file.
+  // If writemode is set to append, read the image first, append to it,
+  // and then save it. But even if set to append, make sure anything was
+  // read at all.
+  const std::string writemode = options.getfield ("writemode")(0).string_value ();
+  std::vector<Magick::Image> ini_imvec;
+  if (writemode == "append" && file_stat (filename).exists ())
+    {
+      read_file (filename, ini_imvec);
+      if (error_state)
+        {
+          return retval;
+        }
+    }
+
+  if (ini_imvec.size () > 0)
+    {
+      ini_imvec.insert (ini_imvec.end (), imvec.begin (), imvec.end ());
+      write_file (filename, ext, ini_imvec);
+      if (error_state)
+        {
+          return retval;
+        }
+    }
+  else
+    {
+      write_file (filename, ext, imvec);
+      if (error_state)
+        {
+          return retval;
+        }
+    }
 
 #endif
-
-return retval;
+  return retval;
 }
 
 /*
@@ -1008,14 +1060,19 @@
 DEFUN_DLD (__magick_finfo__, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {} __magick_finfo__ (@var{fname})\n\
-Read image information with GraphicsMagick++.  In general you should\n\
-not be using this function.  Instead use @code{imfinfo}.\n\
-@seealso{imfinfo, imread}\n\
+Read image information with GraphicsMagick or ImageMagick.\n\
+\n\
+This is a private internal function not intended for direct use.  Instead\n\
+use @code{imfinfo}.\n\
+\n\
+@seealso{imfinfo, imformats, imread, imwrite}\n\
 @end deftypefn")
 {
   octave_value retval;
 
-#ifdef HAVE_MAGICK
+#ifndef HAVE_MAGICK
+  gripe_disabled_feature ("imfinfo", "Image IO");
+#else
 
   maybe_initialize_magick ();
 
@@ -1064,7 +1121,7 @@
           0
         };
 
-      Octave_map info (string_vector (fields), dim_vector (nframes, 1));
+      octave_map info (dim_vector (nframes, 1), string_vector (fields));
 
       file_stat fs (filename);
 
@@ -1135,13 +1192,7 @@
       error ("Magick++ exception: %s", e.what ());
       return retval;
     }
-
-#else
-
-  error ("imfinfo: not available in this version of Octave");
-
 #endif
-
   return retval;
 }
 
@@ -1152,61 +1203,53 @@
 
 #undef GET_PARAM
 
-// Determine the file formats supported by GraphicsMagick.  This is
-// called once at the beginning of imread or imwrite to determine
-// exactly which file formats are supported, so error messages can be
-// displayed properly.
-
-DEFUN_DLD (__magick_format_list__, args, ,
+DEFUN_DLD (__magick_formats__, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {} __magick_format_list__ (@var{formats})\n\
-Undocumented internal function.\n\
+@deftypefn {Loadable Function} {} __magick_imformats__ (@var{formats})\n\
+Fill formats info with GraphicsMagick CoderInfo.\n\
+\n\
+@seealso{imfinfo, imformats, imread, imwrite}\n\
 @end deftypefn")
 {
   octave_value retval;
-
-#ifdef HAVE_MAGICK
-  maybe_initialize_magick ();
-
-  std::list<std::string> accepted_formats;
-
-  if (args.length () == 1)
+#ifndef HAVE_MAGICK
+  gripe_disabled_feature ("imformats", "Image IO");
+#else
+  if (args.length () != 1 || ! args (0).is_map ())
     {
-      Cell c = args (0).cell_value ();
+      print_usage ();
+      return retval;
+    }
+  octave_map formats = args(0).map_value ();
 
-      if (! error_state)
+  maybe_initialize_magick ();
+  for (octave_idx_type idx = 0; idx < formats.numel (); idx++)
+    {
+      try
         {
-          for (octave_idx_type i = 0; i < c.nelem (); i++)
-            {
-              try
-                {
-                  std::string fmt = c.elem (i).string_value ();
-
-                  Magick::CoderInfo info(fmt);
+          octave_scalar_map fmt = formats.checkelem (idx);
+          Magick::CoderInfo coder (fmt.getfield ("coder").string_value ());
 
-                  if (info.isReadable () && info.isWritable ())
-                    accepted_formats.push_back (fmt);
-                }
-              catch (Magick::Exception& e)
-                {
-                  // Do nothing: exception here are simply missing formats.
-                }
-            }
+          fmt.setfield ("description", octave_value (coder.description ()));
+          fmt.setfield ("multipage", coder.isMultiFrame () ? true : false);
+          // default for read and write is a function handle. If we can't
+          // read or write them, them set it to an empty value
+          if (! coder.isReadable ())
+            fmt.setfield ("read",  Matrix ());
+          if (! coder.isWritable ())
+            fmt.setfield ("write", Matrix ());
+          formats.fast_elem_insert (idx, fmt);
         }
-      else
-        error ("__magick_format_list__: expecting a cell array of image format names");
+      catch (Magick::Exception& e)
+        {
+          // Exception here are missing formats. So we remove the format
+          // from the structure and reduce idx.
+          formats.delete_elements (idx);
+          idx--;
+        }
     }
-  else
-    print_usage ();
-
-  retval = Cell (accepted_formats);
-
-#else
-
-  error ("__magick_format_list__: not available in this version of Octave");
-
+  retval = formats;
 #endif
-
   return retval;
 }
 
--- a/libinterp/dldfcn/ccolamd.cc
+++ b/libinterp/dldfcn/ccolamd.cc
@@ -135,10 +135,10 @@
 \n\
 The authors of the code itself are S. Larimore, T. Davis (Univ. of Florida)\n\
 and S. Rajamanickam in collaboration with J. Bilbert and E. Ng.  Supported\n\
-by the National Science Foundation (DMS-9504974, DMS-9803599, CCR-0203270),\n\
-and a grant from Sandia National Lab.  See\n\
-@url{http://www.cise.ufl.edu/research/sparse} for ccolamd, csymamd, amd,\n\
-colamd, symamd, and other related orderings.\n\
+by the National Science Foundation\n\
+@nospell{(DMS-9504974, DMS-9803599, CCR-0203270)}, and a grant from Sandia\n\
+National Lab.  See @url{http://www.cise.ufl.edu/research/sparse} for\n\
+ccolamd, csymamd, amd, colamd, symamd, and other related orderings.\n\
 @seealso{colamd, csymamd}\n\
 @end deftypefn")
 {
@@ -390,10 +390,10 @@
 \n\
 The authors of the code itself are S. Larimore, T. Davis (Uni of Florida)\n\
 and S. Rajamanickam in collaboration with J. Bilbert and E. Ng.  Supported\n\
-by the National Science Foundation (DMS-9504974, DMS-9803599, CCR-0203270),\n\
-and a grant from Sandia National Lab.  See\n\
-@url{http://www.cise.ufl.edu/research/sparse} for ccolamd, csymamd, amd,\n\
-colamd, symamd, and other related orderings.\n\
+by the National Science Foundation\n\
+@nospell{(DMS-9504974, DMS-9803599, CCR-0203270)}, and a grant from Sandia\n\
+National Lab.  See @url{http://www.cise.ufl.edu/research/sparse} for\n\
+ccolamd, csymamd, amd, colamd, symamd, and other related orderings.\n\
 @seealso{symamd, ccolamd}\n\
 @end deftypefn")
 {
--- a/libinterp/dldfcn/chol.cc
+++ b/libinterp/dldfcn/chol.cc
@@ -135,7 +135,7 @@
 \n\
 In general the lower triangular factorization is significantly faster for\n\
 sparse matrices.\n\
-@seealso{cholinv, chol2inv}\n\
+@seealso{hess, lu, qr, qz, schur, svd, cholinv, chol2inv, cholupdate, cholinsert, choldelete, cholshift}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -649,7 +649,7 @@
 @end itemize\n\
 \n\
 If @var{info} is not present, an error message is printed in cases 1 and 2.\n\
-@seealso{chol, qrupdate}\n\
+@seealso{chol, cholinsert, choldelete, cholshift}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
@@ -849,7 +849,7 @@
 @end itemize\n\
 \n\
 If @var{info} is not present, an error message is printed in cases 1 and 2.\n\
-@seealso{chol, cholupdate, choldelete}\n\
+@seealso{chol, cholupdate, choldelete, cholshift}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
@@ -1097,7 +1097,7 @@
 positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper\n\
 triangular, return the Cholesky@tie{}factorization of @w{A(p,p)}, where\n\
 @w{p = [1:j-1,j+1:n+1]}.\n\
-@seealso{chol, cholupdate, cholinsert}\n\
+@seealso{chol, cholupdate, cholinsert, cholshift}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
@@ -1234,7 +1234,7 @@
  or @*\n\
 @code{p = [1:j-1, shift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}.  @*\n\
 \n\
-@seealso{chol, cholinsert, choldelete}\n\
+@seealso{chol, cholupdate, cholinsert, choldelete}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
--- a/libinterp/dldfcn/fftw.cc
+++ b/libinterp/dldfcn/fftw.cc
@@ -56,7 +56,7 @@
 will save the existing wisdom used by Octave to the string @var{wisdom}.\n\
 This string can then be saved to a file and restored using the @code{save}\n\
 and @code{load} commands respectively.  This existing wisdom can be\n\
-reimported as follows\n\
+re-imported as follows\n\
 \n\
 @example\n\
 fftw (\"dwisdom\", @var{wisdom})\n\
@@ -120,8 +120,9 @@
 fftw (\"threads\", @var{NTHREADS})\n\
 @end example\n\
 \n\
-Note that octave must be compiled with multi-threaded FFTW support for this feature.\n\
-The number of processors available to the current process is used per default.\n\
+Note that octave must be compiled with multi-threaded @sc{fftw} support for\n\
+this feature.  The number of processors available to the current process is\n\
+used per default.\n\
 \n\
 @seealso{fft, ifft, fft2, ifft2, fftn, ifftn}\n\
 @end deftypefn")
--- a/libinterp/dldfcn/module-files
+++ b/libinterp/dldfcn/module-files
@@ -3,7 +3,7 @@
 __dsearchn__.cc
 __fltk_uigetfile__.cc|$(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS)|$(GRAPHICS_LDFLAGS) $(FT2_LDFLAGS)|$(GRAPHICS_LIBS) $(FT2_LIBS)
 __glpk__.cc|$(GLPK_CPPFLAGS)|$(GLPK_LDFLAGS)|$(GLPK_LIBS)
-__init_fltk__.cc|$(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS)|$(GRAPHICS_LDFLAGS) $(FT2_LDFLAGS)|$(GRAPHICS_LIBS) $(FT2_LIBS)
+__init_fltk__.cc|$(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS)|$(GRAPHICS_LDFLAGS) $(FT2_LDFLAGS)|$(GRAPHICS_LIBS) $(FT2_LIBS) $(OPENGL_LIBS)
 __init_gnuplot__.cc
 __magick_read__.cc|$(MAGICK_CPPFLAGS)|$(MAGICK_LDFLAGS)|$(MAGICK_LIBS)
 __voronoi__.cc|$(QHULL_CPPFLAGS)|$(QHULL_LDFLAGS)|$(QHULL_LIBS)
--- a/libinterp/dldfcn/qr.cc
+++ b/libinterp/dldfcn/qr.cc
@@ -194,6 +194,7 @@
 x = @var{R} \\ @var{C}\n\
 @end group\n\
 @end example\n\
+@seealso{chol, hess, lu, qz, schur, svd, qrupdate, qrinsert, qrdelete, qrshift}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -769,7 +770,7 @@
 The QR@tie{}factorization supplied may be either full\n\
 (Q is square) or economized (R is square).\n\
 \n\
-@seealso{qr, qrinsert, qrdelete}\n\
+@seealso{qr, qrinsert, qrdelete, qrshift}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
@@ -960,7 +961,7 @@
 (Q is square) or economized (R is square).\n\
 \n\
 If @var{orient} is @code{\"row\"}, full factorization is needed.\n\
-@seealso{qr, qrupdate, qrdelete}\n\
+@seealso{qr, qrupdate, qrdelete, qrshift}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
@@ -1179,7 +1180,7 @@
 (Q is square) or economized (R is square).\n\
 \n\
 If @var{orient} is @code{\"row\"}, full factorization is needed.\n\
-@seealso{qr, qrinsert, qrupdate}\n\
+@seealso{qr, qrupdate, qrinsert, qrshift}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
@@ -1429,7 +1430,7 @@
  or @*\n\
 @code{p = [1:j-1, shift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}.  @*\n\
 \n\
-@seealso{qr, qrinsert, qrdelete}\n\
+@seealso{qr, qrupdate, qrinsert, qrdelete}\n\
 @end deftypefn")
 {
   octave_idx_type nargin = args.length ();
--- a/libinterp/genprops.awk
+++ b/libinterp/genprops.awk
@@ -70,6 +70,10 @@
 ##   S:  There is a custom extern definition for the type-specific set
 ##       function, so we emit only the declaration.
 ##
+################################################################################
+##   'o','O','a' are currently not processed.  They are commented out in code.
+################################################################################
+##    
 ##   o:  There is a custom inline definition for the octave_value version
 ##       of the set function, so we don't emit one.
 ##
@@ -98,6 +102,7 @@
 ##
 ##       constructor, which creates a new radio_property and so cannot
 ##       preserve the old list of possible values.
+################################################################################
 ##
 ##   l:  Add the line
 ##
deleted file mode 100644
--- a/libinterp/interp-core/module.mk
+++ /dev/null
@@ -1,144 +0,0 @@
-EXTRA_DIST += \
-  interp-core/module.mk \
-  interp-core/gl2ps.c \
-  interp-core/mxarray.in.h \
-  interp-core/oct-errno.in.cc
-
-JIT_INC = \
-  interp-core/jit-util.h \
-  interp-core/jit-typeinfo.h \
-  interp-core/jit-ir.h \
-  interp-core/pt-jit.h
-
-INTERP_CORE_INC = \
-  interp-core/Cell.h \
-  interp-core/action-container.h \
-  interp-core/c-file-ptr-stream.h \
-  interp-core/comment-list.h \
-  interp-core/cutils.h \
-  interp-core/defun-dld.h \
-  interp-core/defun-int.h \
-  interp-core/display.h \
-  interp-core/dynamic-ld.h \
-  interp-core/event-queue.h \
-  interp-core/gl-render.h \
-  interp-core/gl2ps-renderer.h \
-  interp-core/gl2ps.h \
-  interp-core/gripes.h \
-  interp-core/ls-ascii-helper.h \
-  interp-core/ls-hdf5.h \
-  interp-core/ls-mat-ascii.h \
-  interp-core/ls-mat4.h \
-  interp-core/ls-mat5.h \
-  interp-core/ls-oct-binary.h \
-  interp-core/ls-utils.h \
-  interp-core/mex.h \
-  interp-core/mexproto.h \
-  interp-core/mxarray.in.h \
-  interp-core/oct-errno.h \
-  interp-core/oct-fstrm.h \
-  interp-core/oct-hdf5.h \
-  interp-core/oct-iostrm.h \
-  interp-core/oct-lvalue.h \
-  interp-core/oct-map.h \
-  interp-core/oct-obj.h \
-  interp-core/oct-prcstrm.h \
-  interp-core/oct-procbuf.h \
-  interp-core/oct-stdstrm.h \
-  interp-core/oct-stream.h \
-  interp-core/oct-strstrm.h \
-  interp-core/oct.h \
-  interp-core/procstream.h \
-  interp-core/siglist.h \
-  interp-core/sparse-xdiv.h \
-  interp-core/sparse-xpow.h \
-  interp-core/txt-render.h \
-  interp-core/txt-latex.h \
-  interp-core/txt-eng-ft.h \
-  interp-core/txt-eng.h \
-  interp-core/unwind-prot.h \
-  interp-core/xdiv.h \
-  interp-core/xnorm.h \
-  interp-core/xpow.h \
-  interp-core/zfstream.h \
-  $(JIT_INC)
-
-JIT_SRC = \
-  interp-core/jit-util.cc \
-  interp-core/jit-typeinfo.cc \
-  interp-core/jit-ir.cc \
-  interp-core/pt-jit.cc
-
-C_INTERP_CORE_SRC = \
-  interp-core/cutils.c \
-  interp-core/matherr.c \
-  interp-core/siglist.c \
-  interp-core/xgl2ps.c
-
-INTERP_CORE_SRC = \
-  interp-core/Cell.cc \
-  interp-core/c-file-ptr-stream.cc \
-  interp-core/comment-list.cc \
-  interp-core/display.cc \
-  interp-core/dynamic-ld.cc \
-  interp-core/gl-render.cc \
-  interp-core/gl2ps-renderer.cc \
-  interp-core/gripes.cc \
-  interp-core/ls-ascii-helper.cc \
-  interp-core/ls-hdf5.cc \
-  interp-core/ls-mat-ascii.cc \
-  interp-core/ls-mat4.cc \
-  interp-core/ls-mat5.cc \
-  interp-core/ls-oct-binary.cc \
-  interp-core/ls-utils.cc \
-  interp-core/mex.cc \
-  interp-core/oct-fstrm.cc \
-  interp-core/oct-iostrm.cc \
-  interp-core/oct-lvalue.cc \
-  interp-core/oct-map.cc \
-  interp-core/oct-obj.cc \
-  interp-core/oct-prcstrm.cc \
-  interp-core/oct-procbuf.cc \
-  interp-core/oct-stream.cc \
-  interp-core/oct-strstrm.cc \
-  interp-core/procstream.cc \
-  interp-core/sparse-xdiv.cc \
-  interp-core/sparse-xpow.cc \
-  interp-core/txt-render.cc \
-  interp-core/txt-latex.cc \
-  interp-core/txt-eng-ft.cc \
-  interp-core/unwind-prot.cc \
-  interp-core/xdiv.cc \
-  interp-core/xnorm.cc \
-  interp-core/xpow.cc \
-  interp-core/zfstream.cc \
-  $(JIT_SRC) \
-  $(C_INTERP_CORE_SRC)
-
-## FIXME: Automake does not support per-object rules.
-##        These rules could be emulated by creating a new convenience
-##        library and using per-library rules.  Or we can just live
-##        without the rule since there haven't been any problems. (09/18/2012)
-#display.df display.lo: CPPFLAGS += $(X11_FLAGS)
-
-## Special rules for sources which must be built before rest of compilation.
-interp-core/oct-errno.cc: interp-core/oct-errno.in.cc Makefile
-	if test -n "$(PERL)"; then \
-	  $(srcdir)/mk-errno-list --perl "$(PERL)" < $< > $@-t; \
-	elif test -n "$(PYTHON)"; then \
-	  $(srcdir)/mk-errno-list --python "$(PYTHON)" < $< > $@-t; \
-	else \
-	  $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \
-	fi
-	mv $@-t $@
-
-interp-core/mxarray.h: interp-core/mxarray.in.h Makefile
-	$(SED) < $< \
-	  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
-	  -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|" > $@-t
-	mv $@-t $@
-
-noinst_LTLIBRARIES += interp-core/libinterp-core.la
-
-interp_core_libinterp_core_la_SOURCES = $(INTERP_CORE_SRC)
-interp_core_libinterp_core_la_CPPFLAGS = $(liboctinterp_la_CPPFLAGS)
deleted file mode 100644
--- a/libinterp/interpfcn/module.mk
+++ /dev/null
@@ -1,76 +0,0 @@
-EXTRA_DIST += \
-  interpfcn/module.mk \
-  interpfcn/defaults.in.h \
-  interpfcn/graphics.in.h
-
-INTERPFCN_INC = \
-  interpfcn/data.h \
-  interpfcn/debug.h \
-  interpfcn/defun.h \
-  interpfcn/dirfns.h \
-  interpfcn/error.h \
-  interpfcn/file-io.h \
-  interpfcn/help.h \
-  interpfcn/hook-fcn.h \
-  interpfcn/input.h \
-  interpfcn/load-path.h \
-  interpfcn/load-save.h \
-  interpfcn/ls-oct-ascii.h \
-  interpfcn/octave-link.h \
-  interpfcn/oct-hist.h \
-  interpfcn/pager.h \
-  interpfcn/pr-output.h \
-  interpfcn/profiler.h \
-  interpfcn/sighandlers.h \
-  interpfcn/symtab.h \
-  interpfcn/sysdep.h \
-  interpfcn/toplev.h \
-  interpfcn/utils.h \
-  interpfcn/variables.h \
-  interpfcn/workspace-element.h
-
-INTERPFCN_SRC = \
-  interpfcn/data.cc \
-  interpfcn/debug.cc \
-  interpfcn/defaults.cc \
-  interpfcn/defun.cc \
-  interpfcn/dirfns.cc \
-  interpfcn/error.cc \
-  interpfcn/file-io.cc \
-  interpfcn/graphics.cc \
-  interpfcn/help.cc \
-  interpfcn/hook-fcn.cc \
-  interpfcn/input.cc \
-  interpfcn/load-path.cc \
-  interpfcn/load-save.cc \
-  interpfcn/ls-oct-ascii.cc \
-  interpfcn/octave-link.cc \
-  interpfcn/oct-hist.cc \
-  interpfcn/pager.cc \
-  interpfcn/pr-output.cc \
-  interpfcn/profiler.cc \
-  interpfcn/sighandlers.cc \
-  interpfcn/symtab.cc \
-  interpfcn/sysdep.cc \
-  interpfcn/toplev.cc \
-  interpfcn/utils.cc \
-  interpfcn/variables.cc
-
-## defaults.h and graphics.h must depend on Makefile.  Calling configure
-## may change default/config values.  However, calling configure will also
-## regenerate the Makefiles from Makefile.am and trigger the rules below.
-interpfcn/defaults.h: interpfcn/defaults.in.h Makefile
-	@$(do_subst_default_vals)
-
-interpfcn/graphics.h: interpfcn/graphics.in.h genprops.awk Makefile
-	$(AWK) -f $(srcdir)/genprops.awk $< > $@-t
-	mv $@-t $@
-
-interpfcn/graphics-props.cc: interpfcn/graphics.in.h genprops.awk Makefile
-	$(AWK) -v emit_graphics_props=1 -f $(srcdir)/genprops.awk $< > $@-t
-	mv $@-t $@
-
-noinst_LTLIBRARIES += interpfcn/libinterpfcn.la
-
-interpfcn_libinterpfcn_la_SOURCES = $(INTERPFCN_SRC)
-interpfcn_libinterpfcn_la_CPPFLAGS = $(liboctinterp_la_CPPFLAGS)
--- a/libinterp/mk-pkg-add
+++ b/libinterp/mk-pkg-add
@@ -1,4 +1,4 @@
-#! /bin/sh -e
+#! /bin/sh
 #
 # Copyright (C) 2005-2012 John W. Eaton
 #
@@ -18,6 +18,8 @@
 # along with Octave; see the file COPYING.  If not, see
 # <http://www.gnu.org/licenses/>.
 
+set -e
+
 SED=${SED:-'sed'}
 
 for f in "$@"; do
--- a/libinterp/octave-value/ov-base-sparse.h
+++ b/libinterp/octave-value/ov-base-sparse.h
@@ -72,6 +72,8 @@
 
   ~octave_base_sparse (void) { }
 
+  octave_idx_type numel (void) const { return dims ().safe_numel (); }
+
   octave_idx_type nnz (void) const { return matrix.nnz (); }
 
   octave_idx_type nzmax (void) const { return matrix.nzmax (); }
--- a/libinterp/octave-value/ov-base.h
+++ b/libinterp/octave-value/ov-base.h
@@ -331,7 +331,7 @@
 
   virtual bool is_defined (void) const { return false; }
 
-  bool is_empty (void) const { return numel () == 0; }
+  bool is_empty (void) const { return (dims ().any_zero ()); }
 
   virtual bool is_cell (void) const { return false; }
 
--- a/libinterp/octave-value/ov-bool-sparse.h
+++ b/libinterp/octave-value/ov-bool-sparse.h
@@ -83,9 +83,9 @@
 
   octave_base_value *try_narrowing_conversion (void);
 
-  // FIXME Adapt idx_vector to allow sparse logical indexing!!
+  // FIXME Adapt idx_vector to allow sparse logical indexing without overflow!!
   idx_vector index_vector (void) const
-    { return idx_vector (bool_array_value ()); }
+    { return idx_vector (matrix); }
 
   builtin_type_t builtin_type (void) const { return btyp_bool; }
 
--- a/libinterp/octave-value/ov-cx-mat.cc
+++ b/libinterp/octave-value/ov-cx-mat.cc
@@ -68,7 +68,7 @@
 {
   CAST_CONV_ARG (const octave_complex_matrix&);
 
-  return new octave_float_complex_matrix (v.float_complex_matrix_value ());
+  return new octave_float_complex_matrix (v.float_complex_array_value ());
 }
 
 octave_base_value::type_conv_info
--- a/libinterp/octave-value/ov-fcn-handle.cc
+++ b/libinterp/octave-value/ov-fcn-handle.cc
@@ -1329,14 +1329,14 @@
 
 /*
 %!function fcn_handle_save_recurse (n, mode, nm, f2, g2, hm2, hdld2, hbi2)
-%!  if n == 0
+%!  if (n == 0)
 %!    save (mode, nm, "f2", "g2", "hm2", "hdld2", "hbi2");
 %!  else
 %!    fcn_handle_save_recurse (n - 1, mode, nm, f2, g2, hm2, hdld2, hbi2);
 %!  endif
 %!endfunction
 %!function [f2, g2, hm2, hdld2, hbi2] = fcn_handle_load_recurse (n, nm)
-%!  if n == 0
+%!  if (n == 0)
 %!    load (nm)
 %!  else
 %!    [f2, g2, hm2, hdld2, hbi2] = fcn_handle_load_recurse (n - 1, nm);
--- a/libinterp/octave-value/ov-fcn-inline.cc
+++ b/libinterp/octave-value/ov-fcn-inline.cc
@@ -645,7 +645,7 @@
 be noted that i, and j are ignored as arguments due to the\n\
 ambiguity between their use as a variable or their use as an inbuilt\n\
 constant.  All arguments followed by a parenthesis are considered\n\
-to be functions. If no arguments are found, a function taking a single\n\
+to be functions.  If no arguments are found, a function taking a single\n\
 argument named @code{x} will be created.\n\
 \n\
 If the second and subsequent arguments are character strings,\n\
--- a/libinterp/octave-value/ov-flt-cx-diag.h
+++ b/libinterp/octave-value/ov-flt-cx-diag.h
@@ -61,7 +61,7 @@
 
   bool is_complex_type (void) const { return true; }
 
-  bool is_double_type (void) const { return true; }
+  bool is_single_type (void) const { return true; }
 
   bool is_float_type (void) const { return true; }
 
--- a/libinterp/octave-value/ov-java.cc
+++ b/libinterp/octave-value/ov-java.cc
@@ -1321,7 +1321,7 @@
       else
         {
           found = 0;
-          error ("cannot convert matrix of type `%s'", val.class_name ().c_str ());
+          error ("cannot convert matrix of type '%s'", val.class_name ().c_str ());
         }
     }
   else if (val.is_cellstr ())
--- a/libinterp/octave-value/ov-struct.cc
+++ b/libinterp/octave-value/ov-struct.cc
@@ -1751,7 +1751,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} struct (@var{field1}, @var{value1}, @var{field2}, @var{value2}, @dots{})\n\
 \n\
-Create a scalar or array structure and initialize its values. The\n\
+Create a scalar or array structure and initialize its values.  The\n\
 @var{field1}, @var{field2}, @dots{} variables are strings giving the\n\
 names of the fields and the @var{value1}, @var{value2}, @dots{}\n\
 variables can be any type.\n\
@@ -1764,8 +1764,8 @@
 \n\
 If the argument is an object, return the underlying struct.\n\
 \n\
-Observe that the syntax is optimized for struct @strong{arrays}. Consider the\n\
-following examples:\n\
+Observe that the syntax is optimized for struct @strong{arrays}.  Consider\n\
+the following examples:\n\
 \n\
 @example\n\
 @group\n\
@@ -1789,11 +1789,11 @@
 @end example\n\
 \n\
 @noindent\n\
-The first case is an ordinary scalar struct, one field, one value. The\n\
+The first case is an ordinary scalar struct, one field, one value.  The\n\
 second produces an empty struct array with one field and no values, since\n\
-s being passed an empty cell array of struct array values. When the value is\n\
+s being passed an empty cell array of struct array values.  When the value is\n\
 a cell array containing a single entry, this becomes a scalar struct with\n\
-that single entry as the value of the field. That single entry happens\n\
+that single entry as the value of the field.  That single entry happens\n\
 to be an empty cell array.\n\
 \n\
 Finally, if the value is a non-scalar cell array, then @code{struct}\n\
--- a/libinterp/octave-value/ov-usr-fcn.cc
+++ b/libinterp/octave-value/ov-usr-fcn.cc
@@ -58,6 +58,8 @@
 // Whether to optimize subsasgn method calls.
 static bool Voptimize_subsasgn_calls = true;
 
+// The character to fill with when creating string arrays.
+extern char Vstring_fill_char;   // see pt-mat.cc
 
 std::map<std::string, octave_value>
 octave_user_code::subfunctions (void) const
@@ -698,7 +700,7 @@
       // which might be redefined in a function.  Keep the old argn name
       // for backward compatibility of functions that use it directly.
 
-      symbol_table::force_assign ("argn", arg_names);
+      symbol_table::force_assign ("argn", charMatrix (arg_names, Vstring_fill_char));
       symbol_table::force_assign (".argn.", Cell (arg_names));
 
       symbol_table::mark_hidden (".argn.");
--- a/libinterp/octave.cc
+++ b/libinterp/octave.cc
@@ -150,24 +150,25 @@
 static std::string image_path;
 
 // If TRUE, ignore the window system even if it is available.
-// (--no-window-system)
+// (--no-window-system, -W)
 static bool no_window_system = false;
 
 // Usage message
 static const char *usage_string =
-  "octave [-HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\
-       [--exec-path path] [--force-gui] [--help] [--image-path path]\n\
+  "octave [-HVWdfhiqvx] [--debug] [--debug-jit] [--doc-cache-file file]\n\
+       [--echo-commands] [--eval CODE] [--exec-path path]\n\
+       [--force-gui] [--help] [--image-path path]\n\
        [--info-file file] [--info-program prog] [--interactive]\n\
-       [--jit-debugging] [--line-editing] [--no-gui] [--no-history]\n\
+       [--line-editing] [--no-gui] [--no-history]\n\
        [--no-init-file] [--no-init-path] [--no-jit-compiler]\n\
        [--no-line-editing] [--no-site-file] [--no-window-system]\n\
-       [-p path] [--path path] [--silent] [--traditional]\n\
-       [--verbose] [--version] [file]";
+       [--norc] [-p path] [--path path] [--persist] [--silent]\n\
+       [--traditional] [--verbose] [--version] [file]";
 
 // This is here so that it's more likely that the usage message and
 // the real set of options will agree.  Note: the '+' must come first
 // to prevent getopt from permuting arguments!
-static const char *short_opts = "+HVdfhip:qvx";
+static const char *short_opts = "+HWVdfhip:qvx";
 
 // The code to evaluate at startup (--eval CODE)
 static std::string code_to_eval;
@@ -191,7 +192,7 @@
 #define IMAGE_PATH_OPTION 6
 #define INFO_FILE_OPTION 7
 #define INFO_PROG_OPTION 8
-#define JIT_DEBUGGING_OPTION 9
+#define DEBUG_JIT_OPTION 9
 #define LINE_EDITING_OPTION 10
 #define NO_GUI_OPTION 11
 #define NO_INIT_FILE_OPTION 12
@@ -199,14 +200,14 @@
 #define NO_JIT_COMPILER_OPTION 14
 #define NO_LINE_EDITING_OPTION 15
 #define NO_SITE_FILE_OPTION 16
-#define NO_WINDOW_SYSTEM_OPTION 17
-#define PERSIST_OPTION 18
-#define TEXI_MACROS_FILE_OPTION 19
-#define TRADITIONAL_OPTION 20
+#define PERSIST_OPTION 17
+#define TEXI_MACROS_FILE_OPTION 18
+#define TRADITIONAL_OPTION 19
 struct option long_opts[] = {
   { "braindead",                no_argument,       0, TRADITIONAL_OPTION },
   { "built-in-docstrings-file", required_argument, 0, BUILT_IN_DOCSTRINGS_FILE_OPTION },
   { "debug",                    no_argument,       0, 'd' },
+  { "debug-jit",                no_argument,       0, DEBUG_JIT_OPTION },
   { "doc-cache-file",           required_argument, 0, DOC_CACHE_FILE_OPTION },
   { "echo-commands",            no_argument,       0, 'x' },
   { "eval",                     required_argument, 0, EVAL_OPTION },
@@ -217,7 +218,6 @@
   { "info-file",                required_argument, 0, INFO_FILE_OPTION },
   { "info-program",             required_argument, 0, INFO_PROG_OPTION },
   { "interactive",              no_argument,       0, 'i' },
-  { "jit-debugging",            no_argument,       0, JIT_DEBUGGING_OPTION },
   { "line-editing",             no_argument,       0, LINE_EDITING_OPTION },
   { "no-gui",                   no_argument,       0, NO_GUI_OPTION },
   { "no-history",               no_argument,       0, 'H' },
@@ -226,7 +226,7 @@
   { "no-jit-compiler",          no_argument,       0, NO_JIT_COMPILER_OPTION },
   { "no-line-editing",          no_argument,       0, NO_LINE_EDITING_OPTION },
   { "no-site-file",             no_argument,       0, NO_SITE_FILE_OPTION },
-  { "no-window-system",         no_argument,       0, NO_WINDOW_SYSTEM_OPTION },
+  { "no-window-system",         no_argument,       0, 'W' },
   { "norc",                     no_argument,       0, 'f' },
   { "path",                     required_argument, 0, 'p' },
   { "persist",                  no_argument,       0, PERSIST_OPTION },
@@ -522,7 +522,9 @@
 \n\
 Options:\n\
 \n\
+  --built-in-docstrings-file FILE Use docs for built-ins from FILE.\n\
   --debug, -d             Enter parser debugging mode.\n\
+  --debug-jit             Enable JIT compiler debugging/tracing.\n\
   --doc-cache-file FILE   Use doc cache file FILE.\n\
   --echo-commands, -x     Echo commands as they are executed.\n\
   --eval CODE             Evaluate CODE.  Exit when done unless --persist.\n\
@@ -533,7 +535,6 @@
   --info-file FILE        Use top-level info file FILE.\n\
   --info-program PROGRAM  Use PROGRAM for reading info files.\n\
   --interactive, -i       Force interactive behavior.\n\
-  --jit-debug             Enable JIT compiler debugging/tracing.\n\
   --line-editing          Force readline use for command-line editing.\n\
   --no-gui                Disable the graphical user interface.\n\
   --no-history, -H        Don't save commands to the history list\n\
@@ -542,11 +543,11 @@
   --no-jit-compiler       Disable the JIT compiler.\n\
   --no-line-editing       Don't use readline for command-line editing.\n\
   --no-site-file          Don't read the site-wide octaverc file.\n\
-  --no-window-system      Disable window system, including graphics.\n\
+  --no-window-system, -W  Disable window system, including graphics.\n\
   --norc, -f              Don't read any initialization files.\n\
   --path PATH, -p PATH    Add PATH to head of function search path.\n\
   --persist               Go interactive after --eval or reading from FILE.\n\
-  --silent, -q            Don't print message at startup.\n\
+  --silent, --quiet, -q   Don't print message at startup.\n\
   --texi-macros-file FILE Use Texinfo macros in FILE for makeinfo command.\n\
   --traditional           Set variables for closer MATLAB compatibility.\n\
   --verbose, -V           Enable verbose output in some cases.\n\
@@ -625,7 +626,7 @@
   Fbeep_on_error (octave_value (true));
   Fconfirm_recursive_rmdir (octave_value (false));
   Fcrash_dumps_octave_core (octave_value (false));
-  Fdefault_save_options (octave_value ("-mat-binary"));
+  Fsave_default_options (octave_value ("-mat-binary"));
   Fdo_braindead_shortcircuit_evaluation (octave_value (true));
   Ffixed_point_format (octave_value (true));
   Fhistory_timestamp_format_string (octave_value ("%%-- %D %I:%M %p --%%"));
@@ -681,10 +682,14 @@
           break;
 
         case 'H':
-          Fsaving_history (octave_value (false));
+          Fhistory_save (octave_value (false));
           read_history_file = false;
           break;
 
+        case 'W':
+          no_window_system = true;
+          break;
+
         case 'V':
           verbose_flag = true;
           break;
@@ -771,8 +776,8 @@
             Finfo_program (octave_value (optarg));
           break;
 
-        case JIT_DEBUGGING_OPTION:
-          Fenable_jit_debugging (octave_value (true));
+        case DEBUG_JIT_OPTION:
+          Fdebug_jit (octave_value (true));
           break;
 
         case LINE_EDITING_OPTION:
@@ -792,7 +797,7 @@
           break;
 
         case NO_JIT_COMPILER_OPTION:
-          Fenable_jit_compiler (octave_value (false));
+          Fjit_enable (octave_value (false));
           break;
 
         case NO_LINE_EDITING_OPTION:
@@ -803,10 +808,6 @@
           read_site_files = 0;
           break;
 
-        case NO_WINDOW_SYSTEM_OPTION:
-          no_window_system = true;
-          break;
-
         case PERSIST_OPTION:
           persist = true;
           break;
--- a/libinterp/parse-tree/lex.h
+++ b/libinterp/parse-tree/lex.h
@@ -280,6 +280,7 @@
       looping (0), defining_func (0), looking_at_function_handle (0),
       block_comment_nesting_level (0), token_count (0),
       current_input_line (), comment_text (), help_text (),
+      string_text (), string_line (0), string_column (0),
       fcn_file_name (), fcn_file_full_name (), looking_at_object_index (),
       parsed_function_name (), pending_local_variables (),
       symtab_context (), nesting_level (), tokens ()
@@ -411,6 +412,13 @@
   // The current help text.
   std::string help_text;
 
+  // The current character string text.
+  std::string string_text;
+
+  // The position of the beginning of the current character string.
+  int string_line;
+  int string_column;
+
   // Simple name of function file we are reading.
   std::string fcn_file_name;
 
@@ -501,6 +509,8 @@
 
   void prep_for_file (void);
 
+  void begin_string (int state);
+
   virtual int fill_flex_buffer (char *buf, unsigned int max_size) = 0;
 
   bool at_end_of_buffer (void) const { return input_buf.empty (); }
@@ -535,12 +545,6 @@
 
   void finish_comment (octave_comment_elt::comment_type typ);
 
-  bool have_continuation (bool trailing_comments_ok = true);
-
-  bool have_ellipsis_continuation (bool trailing_comments_ok = true);
-
-  int handle_string (char delim);
-
   int handle_close_bracket (int bracket_type);
 
   bool looks_like_command_arg (void);
--- a/libinterp/parse-tree/lex.ll
+++ b/libinterp/parse-tree/lex.ll
@@ -51,6 +51,9 @@
 %x BLOCK_COMMENT_START
 %x LINE_COMMENT_START
 
+%x DQ_STRING_START
+%x SQ_STRING_START
+
 %{
 
 #include <cctype>
@@ -173,8 +176,15 @@
  \
       if (curr_lexer->previous_token_may_be_command ()) \
         { \
-          yyless (0); \
-          curr_lexer->push_start_state (COMMAND_START); \
+          if (curr_lexer->looks_like_command_arg ()) \
+            { \
+              yyless (0); \
+              curr_lexer->push_start_state (COMMAND_START); \
+            } \
+          else \
+            { \
+              return curr_lexer->handle_op_internal (TOK, false, COMPAT); \
+            } \
         } \
       else \
         { \
@@ -198,6 +208,31 @@
     } \
   while (0)
 
+// We can't rely on the trick used elsewhere of sticking ASCII 1 in
+// the input buffer and recognizing it as a special case because ASCII
+// 1 is a valid character for a character string.  If we are at the
+// end of the buffer, ask for more input.  If we are at the end of the
+// file, deal with it.  Otherwise, just keep going with the text from
+// the current buffer.
+#define HANDLE_STRING_CONTINUATION \
+  do \
+    { \
+      curr_lexer->decrement_promptflag (); \
+      curr_lexer->input_line_number++; \
+      curr_lexer->current_input_column = 1; \
+ \
+      if (curr_lexer->is_push_lexer ()) \
+        { \
+          if (curr_lexer->at_end_of_buffer ()) \
+            return -1; \
+ \
+          if (curr_lexer->at_end_of_file ()) \
+            return curr_lexer->handle_end_of_input (); \
+        } \
+    } \
+  while (0)
+
+
 static bool Vdisplay_tokens = false;
 
 static unsigned int Vtoken_count = 0;
@@ -283,9 +318,9 @@
     curr_lexer->at_beginning_of_statement = false;
 
     curr_lexer->current_input_column++;
-    int tok = curr_lexer->handle_string (yytext[0]);
-
-    return curr_lexer->count_token_internal (tok);
+
+    curr_lexer->begin_string (yytext[0] == '"'
+                              ? DQ_STRING_START : SQ_STRING_START);
   }
 
 <COMMAND_START>[^#% \t\r\n\;\,\"\'][^ \t\r\n\;\,]*{S}* {
@@ -442,7 +477,7 @@
 %}
 
 ^{S}*{CCHAR}\{{S}*{NL} {
-    curr_lexer->lexer_debug ("^{S}*{CCHAR}\{{S}*{NL}");
+    curr_lexer->lexer_debug ("^{S}*{CCHAR}\\{{S}*{NL}");
 
     yyless (0);
 
@@ -461,7 +496,7 @@
   }
 
 <BLOCK_COMMENT_START>^{S}*{CCHAR}\{{S}*{NL} {
-    curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>^{S}*{CCHAR}\{{S}*{NL}");
+    curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>^{S}*{CCHAR}\\{{S}*{NL}");
 
     curr_lexer->input_line_number++;
     curr_lexer->current_input_column = 1;
@@ -615,6 +650,223 @@
   }
 
 %{
+// Double-quoted character strings.
+%}
+
+<DQ_STRING_START>\"\" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\"\\\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '"';
+  }
+
+<DQ_STRING_START>\" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\"");
+
+    curr_lexer->current_input_column++;
+
+    curr_lexer->pop_start_state ();
+
+    curr_lexer->looking_for_object_index = true;
+    curr_lexer->at_beginning_of_statement = false;
+
+    curr_lexer->push_token (new token (DQ_STRING,
+                                       curr_lexer->string_text,
+                                       curr_lexer->string_line,
+                                       curr_lexer->string_column));
+
+    curr_lexer->string_text = "";
+
+    return curr_lexer->count_token_internal (DQ_STRING);
+  }
+
+<DQ_STRING_START>\\[0-7]{1,3} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\[0-7]{1,3}");
+
+    curr_lexer->current_input_column += yyleng;
+
+    int result;
+    sscanf (yytext+1, "%o", &result);
+
+    if (result > 0xff)
+      error ("invalid octal escape sequence in character string");
+    else
+      curr_lexer->string_text += static_cast<unsigned char> (result);
+  }
+
+<DQ_STRING_START>"\\a" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\a\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\a';
+  }
+
+<DQ_STRING_START>"\\b" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\b\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\b';
+  }
+
+<DQ_STRING_START>"\\f" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\f\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\f';
+  }
+
+<DQ_STRING_START>"\\n" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\n\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\n';
+  }
+
+<DQ_STRING_START>"\\r" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\r\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\r';
+  }
+
+<DQ_STRING_START>"\\t" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\t\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\t';
+  }
+
+<DQ_STRING_START>"\\v" {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\"\\\\v\"");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\v';
+  }
+
+<DQ_STRING_START>(\.\.\.){S}*{NL} |
+<DQ_STRING_START>(\.\.\.){S}*{CCHAR}.*{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>(\\.\\.\\.){S}*{NL}|<DQ_STRING_START>(\\.\\.\\.){S}*{CCHAR}.*{NL}");
+
+    static const char *msg = "'...' continuations in double-quoted character strings are obsolete and will not be allowed in a future version of Octave; please use '\\' instead";
+
+    std::string nm = curr_lexer->fcn_file_full_name;
+
+    if (nm.empty ())
+      warning_with_id ("Octave:deprecated-syntax", "%s", msg);
+    else
+      warning_with_id ("Octave:deprecated-syntax",
+                       "%s; near line %d of file '%s'", msg,
+                       curr_lexer->input_line_number, nm.c_str ());
+
+    HANDLE_STRING_CONTINUATION;
+  }
+
+<DQ_STRING_START>\\{S}+{NL} |
+<DQ_STRING_START>\\{S}*{CCHAR}.*{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{S}+{NL}|<DQ_STRING_START>\\\\{S}*{CCHAR}.*{NL}");
+
+    static const char *msg = "white space and comments after continuation markers in double-quoted character strings are obsolete and will not be allowed in a future version of Octave";
+
+    std::string nm = curr_lexer->fcn_file_full_name;
+
+    if (nm.empty ())
+      warning_with_id ("Octave:deprecated-syntax", "%s", msg);
+    else
+      warning_with_id ("Octave:deprecated-syntax",
+                       "%s; near line %d of file '%s'", msg,
+                       curr_lexer->input_line_number, nm.c_str ());
+
+    HANDLE_STRING_CONTINUATION;
+  }
+
+<DQ_STRING_START>\\{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{NL}");
+
+    HANDLE_STRING_CONTINUATION;
+  }
+
+<DQ_STRING_START>\\. {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\.");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += yytext[1];
+  }
+
+<DQ_STRING_START>\. {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\.");
+
+    curr_lexer->current_input_column++;
+    curr_lexer->string_text += yytext[0];
+  }
+
+<DQ_STRING_START>[^\.\\\r\n\"]+ {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>[^\\.\\\\\\r\\n\\\"]+");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += yytext;
+  }
+
+<DQ_STRING_START>{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>{NL}");
+
+    curr_lexer->input_line_number++;
+    curr_lexer->current_input_column = 1;
+
+    error ("unterminated character string constant");
+
+    return LEXICAL_ERROR;
+  }
+
+%{
+// Single-quoted character strings.
+%}
+
+<SQ_STRING_START>\'\' {
+    curr_lexer->lexer_debug ("<SQ_STRING_START>\\'\\'");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += '\'';
+  }
+
+<SQ_STRING_START>\' {
+    curr_lexer->lexer_debug ("<SQ_STRING_START>\\'");
+
+    curr_lexer->current_input_column++;
+
+    curr_lexer->pop_start_state ();
+
+    curr_lexer->looking_for_object_index = true;
+    curr_lexer->at_beginning_of_statement = false;
+
+    curr_lexer->push_token (new token (SQ_STRING,
+                                       curr_lexer->string_text,
+                                       curr_lexer->string_line,
+                                       curr_lexer->string_column));
+
+    curr_lexer->string_text = "";
+
+    return curr_lexer->count_token_internal (SQ_STRING);
+  }
+
+<SQ_STRING_START>[^\'\n\r]+ {
+    curr_lexer->lexer_debug ("<SQ_STRING_START>[^\\'\\n\\r]+");
+
+    curr_lexer->current_input_column += yyleng;
+    curr_lexer->string_text += yytext;
+  }
+
+<SQ_STRING_START>{NL} {
+    curr_lexer->lexer_debug ("<SQ_STRING_START>{NL}");
+
+    curr_lexer->input_line_number++;
+    curr_lexer->current_input_column = 1;
+
+    error ("unterminated character string constant");
+
+    return LEXICAL_ERROR;
+  }
+
+%{
 // Imaginary numbers.
 %}
 
@@ -654,7 +906,7 @@
 
 {D}+/\.[\*/\\^\'] |
 {NUMBER} {
-    curr_lexer->lexer_debug ("{D}+/\\.[\\*/\\^\\']|{NUMBER}");
+    curr_lexer->lexer_debug ("{D}+/\\.[\\*/\\\\^\\']|{NUMBER}");
 
     if (curr_lexer->previous_token_may_be_command ()
         &&  curr_lexer->space_follows_previous_token ())
@@ -860,14 +1112,14 @@
     if (curr_lexer->previous_token_may_be_command ()
         &&  curr_lexer->space_follows_previous_token ())
       {
-        yyless (0);
+        curr_lexer->current_input_column++;
         curr_lexer->push_start_state (COMMAND_START);
+        curr_lexer->begin_string (SQ_STRING_START);
       }
     else if (curr_lexer->at_beginning_of_statement)
       {
         curr_lexer->current_input_column++;
-        int retval = curr_lexer->handle_string ('\'');
-        return curr_lexer->count_token_internal (retval);
+        curr_lexer->begin_string (SQ_STRING_START);
       }
     else
       {
@@ -881,8 +1133,7 @@
                     || curr_lexer->previous_token_is_binop ())
                   {
                     curr_lexer->current_input_column++;
-                    int retval = curr_lexer->handle_string ('\'');
-                    return curr_lexer->count_token_internal (retval);
+                    curr_lexer->begin_string (SQ_STRING_START);
                   }
                 else
                   {
@@ -899,8 +1150,7 @@
                     || curr_lexer->previous_token_is_keyword ())
                   {
                     curr_lexer->current_input_column++;
-                    int retval = curr_lexer->handle_string ('\'');
-                    return curr_lexer->count_token_internal (retval);
+                    curr_lexer->begin_string (SQ_STRING_START);
                   }
                 else
                   return curr_lexer->count_token (HERMITIAN);
@@ -913,8 +1163,7 @@
                 || curr_lexer->previous_token_is_keyword ())
               {
                 curr_lexer->current_input_column++;
-                int retval = curr_lexer->handle_string ('\'');
-                return curr_lexer->count_token_internal (retval);
+                curr_lexer->begin_string (SQ_STRING_START);
               }
             else
               return curr_lexer->count_token (HERMITIAN);
@@ -927,13 +1176,14 @@
 %}
 
 \" {
-    curr_lexer->lexer_debug ("\"");
+    curr_lexer->lexer_debug ("\\\"");
 
     if (curr_lexer->previous_token_may_be_command ()
         &&  curr_lexer->space_follows_previous_token ())
       {
-        yyless (0);
+        curr_lexer->current_input_column++;
         curr_lexer->push_start_state (COMMAND_START);
+        curr_lexer->begin_string (DQ_STRING_START);
       }
     else
       {
@@ -947,8 +1197,7 @@
                     || curr_lexer->previous_token_is_binop ())
                   {
                     curr_lexer->current_input_column++;
-                    int retval = curr_lexer->handle_string ('"');
-                    return curr_lexer->count_token_internal (retval);
+                    curr_lexer->begin_string (DQ_STRING_START);
                   }
                 else
                   {
@@ -961,15 +1210,13 @@
             else
               {
                 curr_lexer->current_input_column++;
-                int retval = curr_lexer->handle_string ('"');
-                return curr_lexer->count_token_internal (retval);
+                curr_lexer->begin_string (DQ_STRING_START);
               }
           }
         else
           {
             curr_lexer->current_input_column++;
-            int retval = curr_lexer->handle_string ('"');
-            return curr_lexer->count_token_internal (retval);
+            curr_lexer->begin_string (DQ_STRING_START);
           }
       }
   }
@@ -1548,6 +1795,9 @@
   current_input_line = "";
   comment_text = "";
   help_text = "";
+  string_text = "";
+  string_line = 0;
+  string_column = 0;
   fcn_file_name = "";
   fcn_file_full_name = "";
   looking_at_object_index.clear ();
@@ -1762,6 +2012,15 @@
   push_start_state (INPUT_FILE_START);
 }
 
+void
+octave_base_lexer::begin_string (int state)
+{
+  string_line = input_line_number;
+  string_column = current_input_column;
+
+  push_start_state (state);
+}
+
 int
 octave_base_lexer::handle_end_of_input (void)
 {
@@ -1899,6 +2158,9 @@
 
   if (kw)
     {
+      // May be reset to true for some token types.
+      at_beginning_of_statement = false;
+
       token *tok_val = 0;
 
       switch (kw->kw_id)
@@ -2247,218 +2509,6 @@
   at_beginning_of_statement = true;
 }
 
-// We have seen a backslash and need to find out if it should be
-// treated as a continuation character.  If so, this eats it, up to
-// and including the new line character.
-//
-// Match whitespace only, followed by a comment character or newline.
-// Once a comment character is found, discard all input until newline.
-// If non-whitespace characters are found before comment
-// characters, return 0.  Otherwise, return 1.
-
-// FIXME -- we need to handle block comments here.
-
-bool
-octave_base_lexer::have_continuation (bool trailing_comments_ok)
-{
-  std::ostringstream buf;
-
-  std::string comment_buf;
-
-  bool in_comment = false;
-  bool beginning_of_comment = false;
-
-  int c = 0;
-
-  while ((c = text_yyinput ()) != EOF)
-    {
-      buf << static_cast<char> (c);
-
-      switch (c)
-        {
-        case ' ':
-        case '\t':
-          if (in_comment)
-            {
-              comment_buf += static_cast<char> (c);
-              beginning_of_comment = false;
-            }
-          break;
-
-        case '%':
-        case '#':
-          if (trailing_comments_ok)
-            {
-              if (in_comment)
-                {
-                  if (! beginning_of_comment)
-                    comment_buf += static_cast<char> (c);
-                }
-              else
-                {
-                  maybe_gripe_matlab_incompatible_comment (c);
-                  in_comment = true;
-                  beginning_of_comment = true;
-                }
-            }
-          else
-            goto cleanup;
-          break;
-
-        case '\n':
-          if (in_comment)
-            {
-              comment_buf += static_cast<char> (c);
-              octave_comment_buffer::append (comment_buf);
-            }
-          current_input_column = 0;
-          decrement_promptflag ();
-          gripe_matlab_incompatible_continuation ();
-          return true;
-
-        default:
-          if (in_comment)
-            {
-              comment_buf += static_cast<char> (c);
-              beginning_of_comment = false;
-            }
-          else
-            goto cleanup;
-          break;
-        }
-    }
-
-  xunput (c);
-  return false;
-
-cleanup:
-
-  std::string s = buf.str ();
-
-  int len = s.length ();
-  while (len--)
-    xunput (s[len]);
-
-  return false;
-}
-
-// We have seen a '.' and need to see if it is the start of a
-// continuation.  If so, this eats it, up to and including the new
-// line character.
-
-bool
-octave_base_lexer::have_ellipsis_continuation (bool trailing_comments_ok)
-{
-  char c1 = text_yyinput ();
-  if (c1 == '.')
-    {
-      char c2 = text_yyinput ();
-      if (c2 == '.' && have_continuation (trailing_comments_ok))
-        return true;
-      else
-        {
-          xunput (c2);
-          xunput (c1);
-        }
-    }
-  else
-    xunput (c1);
-
-  return false;
-}
-
-int
-octave_base_lexer::handle_string (char delim)
-{
-  std::ostringstream buf;
-
-  int bos_line = input_line_number;
-  int bos_col = current_input_column;
-
-  int c;
-  int escape_pending = 0;
-
-  while ((c = text_yyinput ()) != EOF)
-    {
-      current_input_column++;
-
-      if (c == '\\')
-        {
-          if (delim == '\'' || escape_pending)
-            {
-              buf << static_cast<char> (c);
-              escape_pending = 0;
-            }
-          else
-            {
-              if (have_continuation (false))
-                escape_pending = 0;
-              else
-                {
-                  buf << static_cast<char> (c);
-                  escape_pending = 1;
-                }
-            }
-          continue;
-        }
-      else if (c == '.')
-        {
-          if (delim == '\'' || ! have_ellipsis_continuation (false))
-            buf << static_cast<char> (c);
-        }
-      else if (c == '\n')
-        {
-          error ("unterminated string constant");
-          break;
-        }
-      else if (c == delim)
-        {
-          if (escape_pending)
-            buf << static_cast<char> (c);
-          else
-            {
-              c = text_yyinput ();
-              if (c == delim)
-                {
-                  buf << static_cast<char> (c);
-                }
-              else
-                {
-                  std::string s;
-                  xunput (c);
-
-                  if (delim == '\'')
-                    s = buf.str ();
-                  else
-                    s = do_string_escapes (buf.str ());
-
-                  if (delim == '"')
-                    gripe_matlab_incompatible ("\" used as string delimiter");
-                  else if (delim == '\'')
-                    gripe_single_quote_string ();
-
-                  looking_for_object_index = true;
-                  at_beginning_of_statement = false;
-
-                  int tok = delim == '"' ? DQ_STRING : SQ_STRING;
-
-                  push_token (new token (tok, s, bos_line, bos_col));
-
-                  return tok;
-                }
-            }
-        }
-      else
-        {
-          buf << static_cast<char> (c);
-        }
-
-      escape_pending = 0;
-    }
-
-  return LEXICAL_ERROR;
-}
-
 int
 octave_base_lexer::handle_close_bracket (int bracket_type)
 {
@@ -2589,21 +2639,17 @@
 
       current_input_column += flex_yyleng ();
 
+      assert (! at_beginning_of_statement);
+
       return STRUCT_ELT;
     }
 
-  // The is_keyword_token may reset
-  // at_beginning_of_statement.  For example, if it sees
-  // an else token, then the next token is at the beginning of a
-  // statement.
-
-  // May set at_beginning_of_statement to true.
+  // If tok is a keyword token, then is_keyword_token will set
+  // at_beginning_of_statement.  For example, if tok is and IF
+  // token, then at_beginning_of_statement will be false.
+
   int kw_token = is_keyword_token (tok);
 
-  // If we found a keyword token, then the beginning_of_statement flag
-  // is already set.  Otherwise, we won't be at the beginning of a
-  // statement.
-
   if (looking_at_function_handle)
     {
       if (kw_token)
@@ -2637,6 +2683,8 @@
           looking_for_object_index = false;
         }
 
+      // The call to is_keyword_token set at_beginning_of_statement.
+
       return kw_token;
     }
 
@@ -2651,9 +2699,16 @@
   token *tok_val = new token (NAME, &(symbol_table::insert (tok, sid)),
                               input_line_number, current_input_column);
 
+  // The following symbols are handled specially so that things like
+  //
+  //   pi +1
+  //
+  // are parsed as an addition expression instead of as a command-style
+  // function call with the argument "+1".
+
   if (at_beginning_of_statement
       && (! (is_variable (tok)
-             || tok == "e"
+             || tok == "e" || tok == "pi"
              || tok == "I" || tok == "i"
              || tok == "J" || tok == "j"
              || tok == "Inf" || tok == "inf"
@@ -2975,6 +3030,14 @@
       std::cerr << "LINE_COMMENT_START" << std::endl;
       break;
 
+    case DQ_STRING_START:
+      std::cerr << "DQ_STRING_START" << std::endl;
+      break;
+
+    case SQ_STRING_START:
+      std::cerr << "SQ_STRING_START" << std::endl;
+      break;
+
     default:
       std::cerr << "UNKNOWN START STATE!" << std::endl;
       break;
--- a/libinterp/parse-tree/oct-parse.in.yy
+++ b/libinterp/parse-tree/oct-parse.in.yy
@@ -235,8 +235,8 @@
 %type <tree_constant_type> string constant magic_colon
 %type <tree_anon_fcn_handle_type> anon_fcn_handle
 %type <tree_fcn_handle_type> fcn_handle
-%type <tree_matrix_type> matrix_rows matrix_rows1
-%type <tree_cell_type> cell_rows cell_rows1
+%type <tree_matrix_type> matrix_rows
+%type <tree_cell_type> cell_rows
 %type <tree_expression_type> matrix cell
 %type <tree_expression_type> primary_expr oper_expr
 %type <tree_expression_type> simple_expr colon_expr assign_expr expression
@@ -426,59 +426,62 @@
                   { $$ = $1; }
                 ;
 
-matrix          : '[' ']'
-                  { $$ = new tree_constant (octave_null_matrix::instance); }
-                | '[' ';' ']'
-                  { $$ = new tree_constant (octave_null_matrix::instance); }
-                | '[' ',' ']'
-                  { $$ = new tree_constant (octave_null_matrix::instance); }
-                | '[' matrix_rows ']'
+matrix          : '[' matrix_rows ']'
                   { $$ = parser.finish_matrix ($2); }
                 ;
 
-matrix_rows     : matrix_rows1
-                  { $$ = $1; }
-                | matrix_rows1 ';'      // Ignore trailing semicolon.
-                  { $$ = $1; }
-                ;
-
-matrix_rows1    : cell_or_matrix_row
-                  { $$ = new tree_matrix ($1); }
-                | matrix_rows1 ';' cell_or_matrix_row
+matrix_rows     : cell_or_matrix_row
+                  { $$ = $1 ? new tree_matrix ($1) : 0; }
+                | matrix_rows ';' cell_or_matrix_row
                   {
-                    $1->append ($3);
-                    $$ = $1;
+                    if ($1)
+                      {
+                        if ($3)
+                          $1->append ($3);
+
+                        $$ = $1;
+                      }
+                    else
+                      $$ = $3 ? new tree_matrix ($3) : 0;
                   }
                 ;
 
-cell            : '{' '}'
-                  { $$ = new tree_constant (octave_value (Cell ())); }
-                | '{' ';' '}'
-                  { $$ = new tree_constant (octave_value (Cell ())); }
-                | '{' cell_rows '}'
+cell            : '{' cell_rows '}'
                   { $$ = parser.finish_cell ($2); }
                 ;
 
-cell_rows       : cell_rows1
-                  { $$ = $1; }
-                | cell_rows1 ';'        // Ignore trailing semicolon.
-                  { $$ = $1; }
-                ;
-
-cell_rows1      : cell_or_matrix_row
-                  { $$ = new tree_cell ($1); }
-                | cell_rows1 ';' cell_or_matrix_row
+cell_rows       : cell_or_matrix_row
+                  { $$ = $1 ? new tree_cell ($1) : 0; }
+                | cell_rows ';' cell_or_matrix_row
                   {
-                    $1->append ($3);
-                    $$ = $1;
+                    if ($1)
+                      {
+                        if ($3)
+                          $1->append ($3);
+
+                        $$ = $1;
+                      }
+                    else
+                      $$ = $3 ? new tree_cell ($3) : 0;
                   }
                 ;
 
+// tree_argument_list objects can't be empty or have leading or trailing
+// commas, but those are all allowed in matrix and cell array rows.
+
 cell_or_matrix_row
-                : arg_list
+                : // empty
+                  { $$ = 0; }
+                | ','
+                  { $$ = 0; }
+                | arg_list
                   { $$ = $1; }
-                | arg_list ','          // Ignore trailing comma.
+                | arg_list ','
                   { $$ = $1; }
+                | ',' arg_list
+                  { $$ = $2; }
+                | ',' arg_list ','
+                  { $$ = $2; }
                 ;
 
 fcn_handle      : '@' FCN_HANDLE
@@ -3069,7 +3072,9 @@
 tree_expression *
 octave_base_parser::finish_matrix (tree_matrix *m)
 {
-  return finish_array_list (m);
+  return (m
+          ? finish_array_list (m)
+          : new tree_constant (octave_null_matrix::instance));
 }
 
 // Finish building a cell list.
@@ -3077,7 +3082,9 @@
 tree_expression *
 octave_base_parser::finish_cell (tree_cell *c)
 {
-  return finish_array_list (c);
+  return (c
+          ? finish_array_list (c)
+          : new tree_constant (octave_value (Cell ())));
 }
 
 void
@@ -3515,6 +3522,7 @@
 DEFUN (autoload, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} autoload (@var{function}, @var{file})\n\
+@deftypefnx {Built-in Function} {} autoload (@dots{}, @asis{\"remove\"})\n\
 Define @var{function} to autoload from @var{file}.\n\
 \n\
 The second argument, @var{file}, should be an absolute file name or\n\
@@ -3523,7 +3531,7 @@
 Octave load path.\n\
 \n\
 Normally, calls to @code{autoload} appear in PKG_ADD script files that\n\
-are evaluated when a directory is added to the Octave's load path.  To\n\
+are evaluated when a directory is added to Octave's load path.  To\n\
 avoid having to hardcode directory names in @var{file}, if @var{file}\n\
 is in the same directory as the PKG_ADD script then\n\
 \n\
@@ -3533,16 +3541,20 @@
 \n\
 @noindent\n\
 will load the function @code{foo} from the file @code{bar.oct}.  The above\n\
-when @code{bar.oct} is not in the same directory or uses like\n\
+usage when @code{bar.oct} is not in the same directory or usages such as\n\
 \n\
 @example\n\
 autoload (\"foo\", file_in_loadpath (\"bar.oct\"))\n\
 @end example\n\
 \n\
 @noindent\n\
-are strongly discouraged, as their behavior might be unpredictable.\n\
+are strongly discouraged, as their behavior may be unpredictable.\n\
 \n\
 With no arguments, return a structure containing the current autoload map.\n\
+\n\
+If a third argument @asis{'remove'} is given, the function is cleared and\n\
+not loaded anymore during the current Octave session.\n\
+\n\
 @seealso{PKG_ADD}\n\
 @end deftypefn")
 {
@@ -3572,7 +3584,7 @@
 
       retval = m;
     }
-  else if (nargin == 2)
+  else if (nargin == 2 || nargin == 3)
     {
       string_vector argv = args.make_argv ("autoload");
 
@@ -3609,7 +3621,18 @@
                                  "autoload: '%s' is not an absolute file name",
                                  nm.c_str ());
             }
-          autoload_map[argv[1]] = nm;
+          if (nargin == 2)
+            autoload_map[argv[1]] = nm;
+          else if (nargin == 3)
+            {
+              if (argv[3].compare ("remove") != 0)
+                error_with_id ("Octave:invalid-input-arg",
+                               "autoload: third argument can only be 'remove'");
+
+              // Remove function from symbol table and autoload map.
+              symbol_table::clear_dld_function (argv[1]);
+              autoload_map.erase (argv[1]);
+            }
         }
     }
   else
@@ -3790,7 +3813,6 @@
   return retval;
 }
 
-
 DEFUN (source, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} source (@var{file})\n\
@@ -3917,7 +3939,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} feval (@var{name}, @dots{})\n\
 Evaluate the function named @var{name}.  Any arguments after the first\n\
-are passed on to the named function.  For example,\n\
+are passed as inputs to the named function.  For example,\n\
 \n\
 @example\n\
 @group\n\
@@ -3947,8 +3969,9 @@
 \n\
 @noindent\n\
 are equivalent ways to call the function referred to by @var{f}.  If it\n\
-cannot be predicted beforehand that @var{f} is a function handle or the\n\
-function name in a string, @code{feval} can be used instead.\n\
+cannot be predicted beforehand whether @var{f} is a function handle,\n\
+function name in a string, or inline function then @code{feval} can be used\n\
+instead.\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -3965,9 +3988,28 @@
 
 DEFUN (builtin, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {[@dots{}]} builtin (@var{f}, @dots{})\n\
+@deftypefn {Loadable Function} {[@dots{}] =} builtin (@var{f}, @dots{})\n\
 Call the base function @var{f} even if @var{f} is overloaded to\n\
 another function for the given type signature.\n\
+\n\
+This is normally useful when doing object-oriented programming and there\n\
+is a requirement to call one of Octave's base functions rather than\n\
+the overloaded one of a new class.\n\
+\n\
+A trivial example which redefines the @code{sin} function to be the\n\
+@code{cos} function shows how @code{builtin} works.\n\
+\n\
+@example\n\
+@group\n\
+sin (0)\n\
+  @result{} 0\n\
+function y = sin (x), y = cos (x); endfunction\n\
+sin (0)\n\
+  @result{} 1\n\
+builtin (\"sin\", 0)\n\
+  @result{} 0\n\
+@end group\n\
+@end example\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -4121,11 +4163,11 @@
 The string @var{try} is evaluated in the current context,\n\
 so any results remain available after @code{eval} returns.\n\
 \n\
-The following example makes the variable @var{a} with the approximate\n\
+The following example makes the variable @var{A} with the approximate\n\
 value 3.1416 available.\n\
 \n\
 @example\n\
-eval (\"a = acos(-1);\");\n\
+eval (\"A = acos(-1);\");\n\
 @end example\n\
 \n\
 If an error occurs during the evaluation of @var{try} the @var{catch}\n\
--- a/libinterp/parse-tree/pt-assign.cc
+++ b/libinterp/parse-tree/pt-assign.cc
@@ -45,134 +45,10 @@
 
 // Simple assignment expressions.
 
-// FIXME -- the following variable and the function that uses it
-// should be removed from some future version of Octave.
-
-static const char *former_built_in_variables[] =
-{
-  "DEFAULT_EXEC_PATH",
-  "DEFAULT_LOADPATH",
-  "EDITOR",
-  "EXEC_PATH",
-  "FFTW_WISDOM_PROGRAM",
-  "IMAGEPATH",
-  "INFO_FILE",
-  "INFO_PROGRAM",
-  "LOADPATH",
-  "MAKEINFO_PROGRAM",
-  "PAGER",
-  "PS1",
-  "PS2",
-  "PS4",
-  "__kluge_procbuf_delay__",
-  "automatic_replot",
-  "beep_on_error",
-  "completion_append_char",
-  "crash_dumps_octave_core",
-  "current_script_file_name",
-  "debug_on_error",
-  "debug_on_interrupt",
-  "debug_on_warning",
-  "debug_symtab_lookups",
-  "default_save_options",
-  "echo_executing_commands",
-  "fixed_point_format",
-  "gnuplot_binary",
-  "gnuplot_command_axes",
-  "gnuplot_command_end",
-  "gnuplot_command_plot",
-  "gnuplot_command_replot",
-  "gnuplot_command_splot",
-  "gnuplot_command_title",
-  "gnuplot_command_using",
-  "gnuplot_command_with",
-  "gnuplot_has_frames",
-  "history_file",
-  "history_size",
-  "ignore_function_time_stamp",
-  "max_recursion_depth",
-  "octave_core_file_format",
-  "octave_core_file_limit",
-  "octave_core_file_name",
-  "output_max_field_width",
-  "output_precision",
-  "page_output_immediately",
-  "page_screen_output",
-  "print_answer_id_name",
-  "print_empty_dimensions",
-  "print_rhs_assign_val",
-  "save_header_format_string",
-  "save_precision",
-  "saving_history",
-  "sighup_dumps_octave_core",
-  "sigterm_dumps_octave_core",
-  "silent_functions",
-  "split_long_rows",
-  "string_fill_char",
-  "struct_levels_to_print",
-  "suppress_verbose_help_message",
-  "variables_can_hide_functions",
-  "warn_assign_as_truth_value",
-  "warn_associativity_change",
-  "warn_divide_by_zero",
-  "warn_empty_list_elements",
-  "warn_fortran_indexing",
-  "warn_function_name_clash",
-  "warn_future_time_stamp",
-  "warn_imag_to_real",
-  "warn_matlab_incompatible",
-  "warn_missing_semicolon",
-  "warn_neg_dim_as_zero",
-  "warn_num_to_str",
-  "warn_precedence_change",
-  "warn_reload_forces_clear",
-  "warn_resize_on_range_error",
-  "warn_separator_insert",
-  "warn_single_quote_string",
-  "warn_str_to_num",
-  "warn_undefined_return_values",
-  "warn_variable_switch_label",
-  "whos_line_format",
-  0,
-};
-
-static void
-maybe_warn_former_built_in_variable (const std::string& nm)
-{
-  static bool initialized = false;
-
-  static std::set<std::string> vars;
-
-  if (! initialized)
-    {
-      const char **p = former_built_in_variables;
-
-      while (*p)
-        vars.insert (*p++);
-
-      initialized = true;
-    }
-
-  if (vars.find (nm) != vars.end ())
-    {
-      const char *nm_c_str = nm.c_str ();
-
-      warning_with_id ("Octave:built-in-variable-assignment",
-                       "\
-In recent versions of Octave, %s is a function instead\n\
-of a built-in variable.\n\n\
-By assigning to %s, you have created a variable that hides\n\
-the function %s. To remove the variable and restore the \n\
-function, type \"clear %s\"\n",
-                       nm_c_str, nm_c_str, nm_c_str, nm_c_str);
-    }
-}
-
 tree_simple_assignment::tree_simple_assignment
   (tree_expression *le, tree_expression *re,
    bool plhs, int l, int c, octave_value::assign_op t)
-    : tree_expression (l, c), lhs (le), rhs (re), preserve (plhs), etype (t),
-      first_execution (true) { }
+    : tree_expression (l, c), lhs (le), rhs (re), preserve (plhs), etype (t) { }
 
 tree_simple_assignment::~tree_simple_assignment (void)
 {
@@ -200,9 +76,6 @@
 {
   octave_value retval;
 
-  if (first_execution && lhs)
-    maybe_warn_former_built_in_variable (lhs->name ());
-
   if (error_state)
     return retval;
 
@@ -271,8 +144,6 @@
         }
     }
 
-  first_execution = false;
-
   return retval;
 }
 
@@ -307,8 +178,7 @@
 tree_multi_assignment::tree_multi_assignment
   (tree_argument_list *lst, tree_expression *r,
    bool plhs, int l, int c)
-    : tree_expression (l, c), lhs (lst), rhs (r), preserve (plhs),
-      first_execution (true) { }
+    : tree_expression (l, c), lhs (lst), rhs (r), preserve (plhs) { }
 
 tree_multi_assignment::~tree_multi_assignment (void)
 {
@@ -342,17 +212,6 @@
   if (error_state)
     return retval;
 
-  if (first_execution)
-    {
-      for (tree_argument_list::iterator p = lhs->begin (); p != lhs->end (); p++)
-        {
-          tree_expression *lhs_expr = *p;
-
-          if (lhs_expr)
-            maybe_warn_former_built_in_variable (lhs_expr->name ());
-        }
-    }
-
   if (rhs)
     {
       std::list<octave_lvalue> lvalue_list = lhs->lvalue_list ();
@@ -488,8 +347,6 @@
 
     }
 
-  first_execution = false;
-
   return retval;
 }
 
--- a/libinterp/parse-tree/pt-assign.h
+++ b/libinterp/parse-tree/pt-assign.h
@@ -47,7 +47,7 @@
   tree_simple_assignment (bool plhs = false, int l = -1, int c = -1,
                           octave_value::assign_op t = octave_value::op_asn_eq)
     : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs), ans_ass (),
-      etype (t), first_execution (true) { }
+      etype (t) { }
 
   tree_simple_assignment (tree_expression *le, tree_expression *re,
                           bool plhs = false, int l = -1, int c = -1,
@@ -100,9 +100,6 @@
   // The type of the expression.
   octave_value::assign_op etype;
 
-  // true only on first rvalue() call.
-  bool first_execution;
-
   // No copying!
 
   tree_simple_assignment (const tree_simple_assignment&);
@@ -118,8 +115,7 @@
 public:
 
   tree_multi_assignment (bool plhs = false, int l = -1, int c = -1)
-    : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs),
-      first_execution (true) { }
+    : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs) { }
 
   tree_multi_assignment (tree_argument_list *lst, tree_expression *r,
                          bool plhs = false, int l = -1, int c = -1);
@@ -160,9 +156,6 @@
   // True if we should not delete the lhs.
   bool preserve;
 
-  // true only on first rvalue() call.
-  bool first_execution;
-
   // No copying!
 
   tree_multi_assignment (const tree_multi_assignment&);
--- a/libinterp/parse-tree/pt-mat.cc
+++ b/libinterp/parse-tree/pt-mat.cc
@@ -1336,6 +1336,34 @@
 
 %!assert (class ([cell(1), struct("foo", "bar")]), "cell")
 %!error [struct("foo", "bar"), cell(1)]
+
+%!assert ([,1], 1)
+%!assert ([1,], 1)
+%!assert ([,1,], 1)
+%!assert ([,1,;;], 1)
+%!assert ([,1,;,;], 1)
+
+%!assert ([1,1], ones (1, 2))
+%!assert ([,1,1], ones (1, 2))
+%!assert ([1,1,], ones (1, 2))
+%!assert ([,1,1,], ones (1, 2))
+%!assert ([,1,1,;;], ones (1, 2))
+%!assert ([,1,1,;,;], ones (1, 2))
+%!assert ([,;,1,1], ones (1, 2))
+
+%!assert ([1;1], ones (2, 1))
+%!assert ([1,;1], ones (2, 1))
+%!assert ([1,;,;1], ones (2, 1))
+
+%!error eval ("[,,]")
+%!error eval ("[,,;,]")
+%!error eval ("[,;,,;,]")
+
+%!assert (isnull ([,]))
+%!assert (isnull ([;]))
+%!assert (isnull ([;;]))
+%!assert (isnull ([;,;]))
+%!assert (isnull ([,;,;,]))
 */
 
 DEFUN (string_fill_char, args, nargout,
--- a/libinterp/template-inst/Array-jit.cc
+++ b/libinterp/template-inst/Array-jit.cc
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Max Brister <max@2bass.com>
+Copyright (C) 2012 Max Brister
 
 This file is part of Octave.
 
@@ -20,6 +20,8 @@
 
 */
 
+// Author: Max Brister <max@2bass.com>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
--- a/liboctave/array/Sparse.cc
+++ b/liboctave/array/Sparse.cc
@@ -1575,6 +1575,14 @@
       else
         gripe_index_out_of_range (2, 2, idx_j.extent (nc), nc);
     }
+  else if (nr == 1 && nc == 1)
+    {
+      // Scalars stored as sparse matrices occupy more memory than 
+      // a scalar, so let's just convert the matrix to full, index, 
+      // and sparsify the result.
+
+      retval = Sparse<T> (array_value ().index (idx_i, idx_j));
+    }
   else if (idx_i.is_colon ())
     {
       // Great, we're just manipulating columns. This is going to be quite
@@ -2615,7 +2623,7 @@
  *
 
 %!function x = set_slice (x, dim, slice, arg)
-%!  switch dim
+%!  switch (dim)
 %!    case 11
 %!      x(slice) = 2;
 %!    case 21
@@ -2628,7 +2636,7 @@
 %!endfunction
 
 %!function x = set_slice2 (x, dim, slice)
-%!  switch dim
+%!  switch (dim)
 %!    case 11
 %!      x(slice) = 2 * ones (size (slice));
 %!    case 21
--- a/liboctave/array/idx-vector.cc
+++ b/liboctave/array/idx-vector.cc
@@ -423,30 +423,27 @@
 }
 
 idx_vector::idx_vector_rep::idx_vector_rep (const Sparse<bool>& bnda)
-  : data (0), len (0), ext (0), aowner (0), orig_dims ()
+  : data (0), len (bnda.nnz ()), ext (0), aowner (0), orig_dims ()
 {
-  for (octave_idx_type i = 0, l = bnda.nnz (); i < l; i++)
-    if (bnda.data (i)) len++;
+  const dim_vector dv = bnda.dims ();
 
-  dim_vector dv = bnda.dims ();
-
-  orig_dims = ((dv.length () == 2 && dv(0) == 1)
-               ? dim_vector (1, len) : orig_dims = dim_vector (len, 1));
+  if (! dv.all_zero ())
+    orig_dims = ((dv.length () == 2 && dv(0) == 1)
+                 ? dim_vector (1, len) : dim_vector (len, 1));
 
   if (len != 0)
     {
       octave_idx_type *d = new octave_idx_type [len];
 
-      octave_idx_type nnz = bnda.nnz ();
+      octave_idx_type k = 0;
+      octave_idx_type nc = bnda.cols ();
+      octave_idx_type nr = bnda.rows ();
 
-      octave_idx_type k = 0;
-      // FIXME: I hope this is OK, i.e. the element iterated this way are correctly ordered.
-      for (octave_idx_type i = 0; i < nnz; i++)
-        {
+      for (octave_idx_type j = 0; j < nc; j++)
+        for (octave_idx_type i = bnda.cidx(j); i < bnda.cidx(j+1); i++)
           if (bnda.data (i))
-            d[k++] = bnda.cidx (i) + bnda.rows () * bnda.ridx (i);
-        }
-
+            d[k++] = j * nr + bnda.ridx (i);
+ 
       data = d;
 
       ext = d[k-1] + 1;
--- a/liboctave/numeric/bsxfun.h
+++ b/liboctave/numeric/bsxfun.h
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2012 Jordi Gutiérrez Hermoso <jordigh@octave.org>
+Copyright (C) 2012 Jordi Gutiérrez Hermoso
 
 This file is part of Octave.
 
@@ -19,6 +19,9 @@
 <http://www.gnu.org/licenses/>.
 
 */
+
+// Author: Jordi Gutiérrez Hermoso <jordigh@octave.org>
+
 #if !defined (bsxfun_h)
 #define bsxfun_h 1
 
--- a/liboctave/numeric/lo-mappers.h
+++ b/liboctave/numeric/lo-mappers.h
@@ -234,7 +234,7 @@
 T
 X_NINT (T x)
 {
-  return (xisinf (x) || xisnan (x)) ? x : xfloor (x + 0.5);
+  return (xfinite (x) ? xfloor (x + 0.5) : x);
 }
 
 inline OCTAVE_API double D_NINT (double x) { return X_NINT (x); }
--- a/liboctave/numeric/oct-rand.cc
+++ b/liboctave/numeric/oct-rand.cc
@@ -360,7 +360,7 @@
           break;
 
         case poisson_dist:
-          if (a < 0.0 || xisnan (a) || xisinf (a))
+          if (a < 0.0 || ! xfinite (a))
             retval = octave_NaN;
           else
             {
@@ -371,7 +371,7 @@
           break;
 
         case gamma_dist:
-          if (a <= 0.0 || xisnan (a) || xisinf (a))
+          if (a <= 0.0 || ! xfinite (a))
             retval = octave_NaN;
           else
             F77_FUNC (dgengam, DGENGAM) (1.0, a, retval);
@@ -443,7 +443,7 @@
           break;
 
         case poisson_dist:
-          if (da < 0.0 || xisnan (da) || xisinf (da))
+          if (da < 0.0 || ! xfinite (a))
             dretval = octave_NaN;
           else
             {
@@ -454,7 +454,7 @@
           break;
 
         case gamma_dist:
-          if (da <= 0.0 || xisnan (da) || xisinf (da))
+          if (da <= 0.0 || ! xfinite (a))
             retval = octave_NaN;
           else
             F77_FUNC (dgengam, DGENGAM) (1.0, da, dretval);
@@ -748,7 +748,7 @@
     case poisson_dist:
       if (use_old_generators)
         {
-          if (a < 0.0 || xisnan (a) || xisinf (a))
+          if (a < 0.0 || ! xfinite (a))
 #define RAND_FUNC(x) x = octave_NaN;
             MAKE_RAND (len);
 #undef RAND_FUNC
@@ -769,7 +769,7 @@
     case gamma_dist:
       if (use_old_generators)
         {
-          if (a <= 0.0 || xisnan (a) || xisinf (a))
+          if (a <= 0.0 || ! xfinite (a))
 #define RAND_FUNC(x) x = octave_NaN;
             MAKE_RAND (len);
 #undef RAND_FUNC
@@ -838,7 +838,7 @@
       if (use_old_generators)
         {
           double da = a;
-          if (da < 0.0 || xisnan (da) || xisinf (da))
+          if (da < 0.0 || ! xfinite (a))
 #define RAND_FUNC(x) x = octave_NaN;
             MAKE_RAND (len);
 #undef RAND_FUNC
@@ -860,7 +860,7 @@
       if (use_old_generators)
         {
           double da = a;
-          if (da <= 0.0 || xisnan (da) || xisinf (da))
+          if (da <= 0.0 || ! xfinite (a))
 #define RAND_FUNC(x) x = octave_NaN;
             MAKE_RAND (len);
 #undef RAND_FUNC
--- a/liboctave/util/kpse.cc
+++ b/liboctave/util/kpse.cc
@@ -7,20 +7,23 @@
 Copyright (C) 1993, 94, 95, 96, 97 Karl Berry & O. Weber.
 Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
 
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA.  */
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
 
 #if defined (HAVE_CONFIG_H)
 #include <config.h>
@@ -1477,24 +1480,9 @@
 }
 
 /* braces.c -- code for doing word expansion in curly braces. Taken from
-   bash 1.14.5.  [Ans subsequently modified for kpatshea.]
-
-   Copyright (C) 1987,1991 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 1, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING.  If not, write to the
-   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
+   bash 1.14.5.  [And subsequently modified for kpatshea.]
+
+   Copyright (C) 1987,1991 Free Software Foundation, Inc.  */
 
 #define brace_whitespace(c) (! (c) || (c) == ' ' || (c) == '\t' || (c) == '\n')
 
--- a/liboctave/util/lo-array-gripes.cc
+++ b/liboctave/util/lo-array-gripes.cc
@@ -130,7 +130,11 @@
   const char *err_id = error_id_invalid_index;
 
   (*current_liboctave_error_with_id_handler)
-    (err_id, "subscript indices must be either positive integers or logicals");
+#ifdef USE_64_BIT_IDX_T
+    (err_id, "subscript indices must be either positive integers less than 2^63 or logicals");
+#else
+    (err_id, "subscript indices must be either positive integers less than 2^31 or logicals");
+#endif
 }
 
 // FIXME -- the following is a common error message to resize,
rename from liboctave/util/regexp.cc
rename to liboctave/util/lo-regexp.cc
--- a/liboctave/util/regexp.cc
+++ b/liboctave/util/lo-regexp.cc
@@ -42,7 +42,7 @@
 #include "lo-error.h"
 #include "oct-locbuf.h"
 #include "quit.h"
-#include "regexp.h"
+#include "lo-regexp.h"
 #include "str-vec.h"
 
 // Define the maximum number of retries for a pattern that possibly
rename from liboctave/util/regexp.h
rename to liboctave/util/lo-regexp.h
--- a/liboctave/util/regexp.h
+++ b/liboctave/util/lo-regexp.h
@@ -21,8 +21,8 @@
 
 */
 
-#if !defined (octave_regexp_match_h)
-#define octave_regexp_match_h 1
+#if !defined (octave_liboctave_regexp_match_h)
+#define octave_liboctave_regexp_match_h 1
 
 #include <list>
 #include <sstream>
--- a/liboctave/util/lo-utils.cc
+++ b/liboctave/util/lo-utils.cc
@@ -55,8 +55,7 @@
 
 bool xtoo_large_for_float (double x)
 {
-  return (! (xisnan (x) || xisinf (x))
-          && fabs (x) > std::numeric_limits<float>::max ());
+  return (xfinite (x) && fabs (x) > std::numeric_limits<float>::max ());
 }
 
 bool xtoo_large_for_float (const Complex& x)
--- a/liboctave/util/module.mk
+++ b/liboctave/util/module.mk
@@ -34,7 +34,7 @@
   util/oct-sort.h \
   util/oct-sparse.h \
   util/pathsearch.h \
-  util/regexp.h \
+  util/lo-regexp.h \
   util/singleton-cleanup.h \
   util/sparse-sort.h \
   util/sparse-util.h \
@@ -66,7 +66,7 @@
   util/oct-mutex.cc \
   util/oct-shlib.cc \
   util/pathsearch.cc \
-  util/regexp.cc \
+  util/lo-regexp.cc \
   util/singleton-cleanup.cc \
   util/sparse-sort.cc \
   util/sparse-util.cc \
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -1,19 +1,19 @@
 dnl aclocal.m4 -- extra macros for configuring Octave
 dnl
 dnl Copyright (C) 1995-2012 John W. Eaton
-dnl 
+dnl
 dnl This file is part of Octave.
-dnl 
+dnl
 dnl Octave is free software; you can redistribute it and/or modify it
 dnl under the terms of the GNU General Public License as published by the
 dnl Free Software Foundation; either version 3 of the License, or (at
 dnl your option) any later version.
-dnl 
+dnl
 dnl Octave is distributed in the hope that it will be useful, but WITHOUT
 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 dnl for more details.
-dnl 
+dnl
 dnl You should have received a copy of the GNU General Public License
 dnl along with Octave; see the file COPYING.  If not, see
 dnl <http://www.gnu.org/licenses/>.
@@ -84,7 +84,7 @@
   ])
   if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
     AC_MSG_RESULT([yes])
-    ifelse([$2], , 
+    ifelse([$2], ,
       [CFLAGS="$CFLAGS $1"
       AC_MSG_RESULT([adding $1 to CFLAGS])], [$2])
   else
@@ -147,7 +147,7 @@
 dnl Check whether a math mapper function is available in <cmath>.
 dnl Will define HAVE_CMATH_FUNC if there is a double variant and
 dnl HAVE_CMATH_FUNCF if there is a float variant.
-dnl Currently capable of checking for functions with single 
+dnl Currently capable of checking for functions with single
 dnl argument and returning bool/int/real.
 dnl
 AC_DEFUN([OCTAVE_CHECK_FUNC_CMATH], [
@@ -242,7 +242,7 @@
       end program
 ]],
       octave_cv_func_fortran_isnan=yes, octave_cv_func_fortran_isnan=no)
-    AC_LANG_POP(Fortran 77)      
+    AC_LANG_POP(Fortran 77)
   ])
 ])
 dnl
@@ -267,7 +267,7 @@
     AC_LANG_POP(C++)
   ])
   if test $octave_cv_func_glutesscallback_threedots = yes; then
-    AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1, 
+    AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1,
       [Define to 1 if gluTessCallback is called with (...).])
   fi
 ])
@@ -295,11 +295,54 @@
     AC_LANG_POP(C++)
   ])
   if test $octave_cv_func_setplaceholdertext = yes; then
-    AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1, 
+    AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1,
       [Define to 1 if you have the Qt SetPlaceholderText function.])
   fi
 ])
 dnl
+dnl Check whether the Qt QAbstractItemModel::beginResetModel() function exists.
+dnl Also checks for QAbstractItemModel::endResetModel().  These are two of the
+dnl newest Qt functions that the Octave GUI depends on, added in Qt 4.6.
+dnl
+AC_DEFUN([OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL], [
+  AC_CACHE_CHECK([whether Qt has the QAbstractItemModel::beginResetModel() function],
+    [octave_cv_func_qabstractitemmodel_beginresetmodel],
+    [AC_LANG_PUSH(C++)
+    ac_octave_save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+        #include <QAbstractItemModel>
+        class item_model : public QAbstractItemModel
+        {
+        public:
+          item_model (QObject *parent = 0) : QAbstractItemModel (parent) {}
+          ~item_model () {}
+          QModelIndex index (int, int, const QModelIndex& m) const { return m; }
+          QModelIndex parent (const QModelIndex& m) const { return m; }
+          int columnCount (const QModelIndex&) const { return 0; }
+          int rowCount (const QModelIndex&) const { return 0; }
+          QVariant data (const QModelIndex&, int) const { return QVariant(); }
+          void update_model ()
+          {
+            this->beginResetModel ();
+            this->endResetModel ();
+          }
+        };
+        ]], [[
+        item_model model;
+        model.update_model ();
+        ]])],
+      octave_cv_func_qabstractitemmodel_beginresetmodel=yes,
+      octave_cv_func_qabstractitemmodel_beginresetmodel=no)
+    CPPFLAGS="$ac_octave_save_CPPFLAGS"
+    AC_LANG_POP(C++)
+  ])
+  if test $octave_cv_func_qabstractitemmodel_beginresetmodel = yes; then
+    AC_DEFINE(HAVE_QABSTRACTITEMMODEL_BEGINRESETMODEL, 1,
+      [Define to 1 if Qt has the QAbstractItemModel::beginResetModel() function.])
+  fi
+])
+dnl
 dnl Check whether HDF5 library has version 1.6 API functions.
 dnl
 AC_DEFUN([OCTAVE_CHECK_HDF5_HAS_VER_16_API], [
@@ -470,7 +513,7 @@
   ip[8] = 0;
   ip[9] = 0;
   ip[10] = 0;
- 
+
   int *ipntr = new int [14];
 
   int k = 1;
@@ -486,7 +529,7 @@
 
   double tol = DBL_EPSILON;
 
-  do 
+  do
     {
       F77_FUNC (dnaupd, DNAUPD) (ido, "I", n, "LM", k, tol, resid, p,
                                  v, n, ip, ipntr, workd, workl, lwork,
@@ -509,7 +552,7 @@
 
           break;
         }
-    } 
+    }
   while (1);
 
   int *sel = new int [p];
@@ -652,7 +695,7 @@
             #elif defined (HAVE_OPENGL_GL_H)
             # include <OpenGL/gl.h>
             #endif
-            ]], [[ 
+            ]], [[
             glEnable(GL_SMOOTH);
             ]])], [OPENGL_LIBS="-lopengl32 -lglu32"])
 
@@ -715,7 +758,7 @@
         int n = 4;
         coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 };
         boolT ismalloc = 0;
-        return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr); 
+        return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr);
       ]])],
       octave_cv_lib_qhull_ok=yes,
       octave_cv_lib_qhull_ok=no,
@@ -740,7 +783,7 @@
                  [], [])
   LIBS="$ac_octave_save_LIBS"
   case "$ac_cv_search_tputs" in
-    -l*)  
+    -l*)
       TERM_LIBS="$ac_cv_search_tputs"
     ;;
     no)
@@ -776,7 +819,7 @@
         ]], [[
         int main(int argc, char* argv[])
         {
-          _Pragma("omp parallel")  
+          _Pragma("omp parallel")
           printf("Hello, world.\n");
           return 0;
         }
@@ -828,7 +871,7 @@
         #endif
         ]], [[
         const char *tmp = qh_version;
-      ]])], 
+      ]])],
       octave_cv_lib_qhull_version=yes, octave_cv_lib_qhull_version=no)
   ])
   if test $octave_cv_lib_qhull_version = no; then
@@ -998,7 +1041,7 @@
     AC_LANG_POP(C++)
   ])
   if test $octave_cv_cxx_complex_setters = yes; then
-    AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS, 1, 
+    AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS, 1,
       [Define to 1 if C++ complex class has void real (T) and void imag (T) methods.])
   fi
 ])
@@ -1015,7 +1058,7 @@
         char x[length()];
         test(x);
       ]])],
-      octave_cv_cxx_dynamic_auto_arrays=yes, 
+      octave_cv_cxx_dynamic_auto_arrays=yes,
       octave_cv_cxx_dynamic_auto_arrays=no)
     AC_LANG_POP(C++)
   ])
@@ -1087,13 +1130,13 @@
   ])
   AC_MSG_RESULT([$octave_cv_cxx_iso_compliant_library])
   if test $octave_cv_cxx_iso_compliant_library = yes; then
-    AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, 
+    AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1,
       [Define to 1 if your C++ runtime library is ISO compliant.])
   fi
 ])
 dnl
 dnl Check if C++ compiler needs the new friend template declaration
-dnl syntax. 
+dnl syntax.
 dnl
 AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [
   AC_REQUIRE([AC_PROG_CXX])
@@ -1141,7 +1184,7 @@
         ]], [[
         operator delete((void *)0, (void *)0);
       ]])],
-      octave_cv_cxx_placement_delete=yes, 
+      octave_cv_cxx_placement_delete=yes,
       octave_cv_cxx_placement_delete=no)
     AC_LANG_POP(C++)
   ])
@@ -1230,16 +1273,16 @@
     AC_RUN_IFELSE([AC_LANG_PROGRAM([[
         #include <limits>
         template<class UT, class ST>
-        static bool 
+        static bool
         do_test (UT, ST)
         {
           volatile ST s = std::numeric_limits<ST>::min () / 3;
           volatile UT u = static_cast<UT> (s);
           if (*(reinterpret_cast<volatile ST *> (&u)) != s) return true;
-          
+
           u = 0; u = ~u;
           if (*(reinterpret_cast<volatile ST *> (&u)) != -1) return true;
-          
+
           ST sx, sy;
           sx = std::numeric_limits<ST>::max () / 2 + 1;
           sy = std::numeric_limits<ST>::max () / 2 + 2;
@@ -1247,7 +1290,7 @@
               != std::numeric_limits<ST>::min () + 1) return true;
           if (static_cast<ST> (static_cast<UT> (sx) - static_cast<UT> (sy))
               != -1) return true;
-          
+
           if ((sx & sy) != (static_cast<UT> (sx) & static_cast<UT> (sy)))
             return true;
           if ((sx | sy) != (static_cast<UT> (sx) | static_cast<UT> (sy)))
@@ -1257,7 +1300,7 @@
           if ((-1 >> 1) != -1) return true;
           return false;
         }
-      
+
         #define DO_TEST(T) \
           if (do_test (static_cast<unsigned T> (0), static_cast<signed T> (0)))\
             return sizeof (T);
@@ -1305,7 +1348,7 @@
   if test "$octave_cv_framework_$1" = yes; then
     AC_MSG_RESULT([yes])
     AC_ARG_WITH(framework-m4_tolower($1),
-      [AS_HELP_STRING([--without-framework-m4_tolower($1)], 
+      [AS_HELP_STRING([--without-framework-m4_tolower($1)],
         [don't use framework $1])],
          with_have_framework=$withval, with_have_framework=yes)
     if test "$with_have_framework" = yes; then
@@ -1349,10 +1392,10 @@
   AC_CACHE_VAL([octave_cv_ieee754_data_format],
     [AC_RUN_IFELSE([AC_LANG_SOURCE([[
         int
-        main (void) 
+        main (void)
         {
           typedef union { unsigned char c[8]; double d; } ieeebytes;
-           
+
           ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43};
           ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c};
 
@@ -1381,6 +1424,175 @@
   fi
 ])
 dnl
+dnl Check for CallInst::addAttribute API
+dnl
+AC_DEFUN([OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API], [
+  AC_CACHE_CHECK([check LLVM::CallInst::addAttribute arg type is llvm::Attributes],
+    [octave_cv_callinst_addattribute_arg_is_attributes],
+    [AC_LANG_PUSH(C++)
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[
+          #include <llvm/Instructions.h>
+          #include <llvm/Attributes.h>
+          #include <llvm/LLVMContext.h>
+          ]], [[
+          llvm::CallInst *callinst;
+          llvm::AttrBuilder attr_builder;
+          attr_builder.addAttribute(llvm::Attributes::StructRet);
+          llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
+          callinst->addAttribute (1, attrs);
+        ]])],
+        octave_cv_callinst_addattribute_arg_is_attributes=yes,
+        octave_cv_callinst_addattribute_arg_is_attributes=no)
+    AC_LANG_POP(C++)
+  ])
+  if test $octave_cv_callinst_addattribute_arg_is_attributes = yes; then
+    AC_DEFINE(CALLINST_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
+      [Define to 1 if llvm::CallInst:addAttribute arg type is llvm::Attributes.])
+  else
+    AC_CACHE_CHECK([check LLVM::CallInst::addAttribute arg type is llvm::Attribute],
+      [octave_cv_callinst_addattribute_arg_is_attribute],
+      [AC_LANG_PUSH(C++)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+            #include <llvm/Instructions.h>
+            #include <llvm/Attributes.h>
+            ]], [[
+            llvm::CallInst *callinst;
+            callinst->addAttribute (1, llvm::Attribute::StructRet);
+          ]])],
+          octave_cv_callinst_addattribute_arg_is_attribute=yes,
+          octave_cv_callinst_addattribute_arg_is_attribute=no)
+      AC_LANG_POP(C++)
+    ])
+    if test $octave_cv_callinst_addattribute_arg_is_attribute = no; then
+      AC_MSG_ERROR([llvm::CallInst::addAttribute is required.])
+    fi
+  fi
+])
+dnl
+dnl Detect TargetData.h or DataLayout.h.
+dnl
+AC_DEFUN([OCTAVE_LLVM_DATALAYOUT_HEADER], [
+  AC_CHECK_HEADER([llvm/DataLayout.h], [
+    octave_is_datalayout_header=yes], [
+    AC_CHECK_HEADER([llvm/Target/TargetData.h], [
+      octave_is_datalayout_header=no], [
+      AC_MSG_ERROR([DataLayout.h or Target/TargetData.h is required.])
+    ])
+  ])
+  if test $octave_is_datalayout_header = yes; then
+    AC_DEFINE(HAVE_DATALAYOUT, 1,
+      [Define to 1 if DataLayout.h exist.])
+  fi
+])
+dnl
+dnl Check for Function::addAttribute API
+dnl
+AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDATTRIBUTE_API], [
+  AC_CACHE_CHECK([check llvm::Function::addAttribute arg type is llvm::Attributes],
+    [octave_cv_function_addattribute_arg_is_attributes],
+    [AC_LANG_PUSH(C++)
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[
+          #include <llvm/Function.h>
+          #include <llvm/Attributes.h>
+          #include <llvm/LLVMContext.h>
+          ]], [[
+          llvm::Function *llvm_function;
+          llvm::AttrBuilder attr_builder;
+          attr_builder.addAttribute(llvm::Attributes::StructRet);
+          llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
+          llvm_function->addAttribute (1, attrs);
+        ]])],
+        octave_cv_function_addattribute_arg_is_attributes=yes,
+        octave_cv_function_addattribute_arg_is_attributes=no)
+    AC_LANG_POP(C++)
+  ])
+  if test $octave_cv_function_addattribute_arg_is_attributes = yes; then
+    AC_DEFINE(FUNCTION_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
+      [Define to 1 if llvm::Function:addAttribute arg type is llvm::Attributes.])
+  else
+    AC_CACHE_CHECK([check llvm::Function::addAttribute arg type is llvm::Attribute],
+      [octave_cv_function_addattribute_arg_is_attribute],
+      [AC_LANG_PUSH(C++)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+            #include <llvm/Function.h>
+            #include <llvm/Attributes.h>
+            ]], [[
+            llvm::Function *llvm_function;
+            llvm_function->addAttribute (1, llvm::Attribute::StructRet);
+          ]])],
+          octave_cv_function_addattribute_arg_is_attribute=yes,
+          octave_cv_function_addattribute_arg_is_attribute=no)
+      AC_LANG_POP(C++)
+    ])
+    if test $octave_cv_function_addattribute_arg_is_attribute = no; then
+      AC_MSG_ERROR([llvm::Function::addAttribute is required.])
+    fi
+  fi
+])
+dnl
+dnl Check for Function::addFnAttr API
+dnl
+AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDFNATTR_API], [
+  AC_CACHE_CHECK([check LLVM::Function::addFnAttr arg type is llvm::Attributes],
+    [octave_cv_function_addfnattr_arg_is_attributes],
+    [AC_LANG_PUSH(C++)
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[
+          #include <llvm/Function.h>
+          #include <llvm/Attributes.h>
+          ]], [[
+          llvm::Function *llvm_function;
+          llvm_function->addFnAttr (llvm::Attributes::AlwaysInline);
+        ]])],
+        octave_cv_function_addfnattr_arg_is_attributes=yes,
+        octave_cv_function_addfnattr_arg_is_attributes=no)
+    AC_LANG_POP(C++)
+  ])
+  if test $octave_cv_function_addfnattr_arg_is_attributes = yes; then
+    AC_DEFINE(FUNCTION_ADDFNATTR_ARG_IS_ATTRIBUTES, 1,
+      [Define to 1 if llvm::Function:addFnAttr arg type is llvm::Attributes.])
+  else
+    AC_CACHE_CHECK([check llvm::Function::addFnAttr arg type is llvm::Attribute],
+      [octave_cv_function_addfnattr_arg_is_attribute],
+      [AC_LANG_PUSH(C++)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+            #include <llvm/Function.h>
+            #include <llvm/Attributes.h>
+            ]], [[
+            llvm::Function *llvm_function;
+            llvm_function->addFnAttr (llvm::Attribute::AlwaysInline);
+          ]])],
+          octave_cv_function_addfnattr_arg_is_attribute=yes,
+          octave_cv_function_addfnattr_arg_is_attribute=no)
+      AC_LANG_POP(C++)
+    ])
+    if test $octave_cv_function_addfnattr_arg_is_attribute = no; then
+      AC_MSG_ERROR([llvm::Function::addFnAttr is required.])
+    fi
+  fi
+])
+dnl
+dnl Check whether IRBuilder.h is in Support directory.
+dnl
+AC_DEFUN([OCTAVE_LLVM_IRBUILDER_HEADER], [
+  AC_CHECK_HEADER([llvm/IRBuilder.h], [
+    octave_irbuilder_header_in_support_dir=no], [
+    AC_CHECK_HEADER([llvm/Support/IRBuilder.h], [
+      octave_irbuilder_header_in_support_dir=yes], [
+      AC_MSG_ERROR([IRBuilder.h is required.])
+    ])
+  ])
+  if test $octave_irbuilder_header_in_support_dir = yes; then
+    AC_DEFINE(IRBUILDER_HEADER_IN_SUPPORT_DIR, 1,
+      [Define to 1 if IRBuilder.h in Support directory.])
+  fi
+])
+dnl
 dnl Check for ar.
 dnl
 AC_DEFUN([OCTAVE_PROG_AR], [
@@ -1399,8 +1611,13 @@
 dnl
 AC_DEFUN([OCTAVE_PROG_BISON], [
   AC_PROG_YACC
-  case "$YACC" in
-    bison*)
+
+  case "`$YACC --version`" in
+    *bison*) tmp_have_bison="yes" ;;
+    *) tmp_have_bison=no ;;
+  esac
+
+  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"
@@ -1440,8 +1657,7 @@
       done
       rm -f conftest.yy y.tab.h y.tab.c
       ])
-    ;;
-  esac
+  fi
 
   AC_SUBST(BISON_PUSH_PULL_DECL_STYLE, $octave_cv_bison_push_pull_decl_style)
 
@@ -1455,20 +1671,16 @@
     OCTAVE_CONFIGURE_WARNING([warn_bison_push_pull_decl_style])
   fi
 
-  case "$YACC" in
-    bison*)
-    ;;
-    *)
-      YACC='$(top_srcdir)/build-aux/missing bison'
-      warn_bison="
+  if test "$tmp_have_bison" = no; then
+    YACC='$(top_srcdir)/build-aux/missing bison'
+    warn_bison="
 
 I didn't find bison, but it's only a problem if you need to
 reconstruct parse.cc, which is the case if you're building from VCS
 sources.
 "
-      OCTAVE_CONFIGURE_WARNING([warn_bison])
-    ;;
-  esac
+    OCTAVE_CONFIGURE_WARNING([warn_bison])
+  fi
 ])
 dnl
 dnl Find desktop-file-install program.
@@ -1497,8 +1709,8 @@
   ## Also make sure that we generate an interactive scanner if we are
   ## using flex.
   AC_PROG_LEX
-  case "$LEX" in
-    flex*)
+  case "`$LEX --version`" in
+    *flex*)
       LFLAGS="-I"
       AC_MSG_RESULT([defining LFLAGS to be $LFLAGS])
       LEXLIB=
@@ -1574,7 +1786,7 @@
     warn_gperf="
 
 I didn't find gperf, but it's only a problem if you need to
-reconstruct oct-gperf.h 
+reconstruct oct-gperf.h
 "
     OCTAVE_CONFIGURE_WARNING([warn_gperf])
     GPERF='$(top_srcdir)/build-aux/missing gperf'
@@ -1761,7 +1973,7 @@
 dnl Macro assumes that the check for umfpack has already been performed.
 dnl
 AC_DEFUN([OCTAVE_UMFPACK_NEED_SUITESPARSE_TIME], [
-  AC_CACHE_CHECK([whether UMFPACK needs SuiteSparse_time function], 
+  AC_CACHE_CHECK([whether UMFPACK needs SuiteSparse_time function],
     [octave_cv_umfpack_need_suitesparse_time],
     [AC_LANG_PUSH(C)
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
@@ -1814,7 +2026,7 @@
         idx_type n = 5;
         idx_type Ap[] = {0, 2, 5, 9, 10, 12};
         idx_type Ai[]  = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4};
-        double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0., 
+        double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0.,
                       -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.};
         double br[] = {8., 45., -3., 3., 19.};
         double bi[] = {0., 0., 0., 0., 0.};
@@ -1827,10 +2039,10 @@
           (void) UMFPACK_NAME (symbolic) (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ;
           (void) UMFPACK_NAME (numeric) (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ;
           UMFPACK_NAME (free_symbolic) (&Symbolic) ;
-          (void) UMFPACK_NAME (solve) (0, Ap, Ai, Ax, null, x, null, br, bi, 
+          (void) UMFPACK_NAME (solve) (0, Ap, Ai, Ax, null, x, null, br, bi,
                                    Numeric, null, null) ;
           UMFPACK_NAME (free_numeric) (&Numeric) ;
-          for (i = 0; i < n; i++, x+=2) 
+          for (i = 0; i < n; i++, x+=2)
             if (fabs (*x - i - 1.) > 1.e-13)
               return (1);
           return (0) ;
@@ -1846,7 +2058,7 @@
     AC_MSG_RESULT([$octave_cv_umfpack_separate_split])
   fi
   if test $octave_cv_umfpack_separate_split = yes; then
-    AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, 
+    AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1,
       [Define to 1 if the UMFPACK Complex solver allows matrix and RHS to be split independently.])
   fi
 ])
@@ -1857,7 +2069,7 @@
 AC_DEFUN([OCTAVE_UNORDERED_MAP_HEADERS], [
   AC_CHECK_HEADERS([unordered_map], [],
     [AC_CHECK_HEADERS([tr1/unordered_map])])
-  AC_CACHE_CHECK([whether unordered_map requires tr1 namespace], 
+  AC_CACHE_CHECK([whether unordered_map requires tr1 namespace],
     [octave_cv_header_require_tr1_namespace],
     [AC_LANG_PUSH(C++)
     octave_cv_header_require_tr1_namespace=no
@@ -1870,7 +2082,7 @@
           ]], [[
           std::unordered_map<int,int> m;
         ]])],
-        octave_cv_header_require_tr1_namespace=no, 
+        octave_cv_header_require_tr1_namespace=no,
         octave_cv_header_require_tr1_namespace=yes)
     elif test $ac_cv_header_tr1_unordered_map = yes; then
       octave_cv_header_require_tr1_namespace=yes
@@ -1878,7 +2090,7 @@
     AC_LANG_POP(C++)
   ])
   if test $octave_cv_header_require_tr1_namespace = yes; then
-    AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1, 
+    AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1,
       [Define to 1 if unordered_map requires the use of tr1 namespace.])
   fi
 ])
--- a/scripts/@ftp/cd.m
+++ b/scripts/@ftp/cd.m
@@ -17,12 +17,27 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} cd (@var{f}, @var{path})
-## Set the remote directory to @var{path} on the FTP connection @var{f}.
+## @deftypefn  {Function File} {} cd (@var{f})
+## @deftypefnx {Function File} {} cd (@var{f}, @var{path})
+## Get or set the remote directory on the FTP connection @var{f}.
 ##
 ## @var{f} is an FTP object returned by the @code{ftp} function.
+##
+## If @var{path} is not specified, return the remote current working
+## directory.  Otherwise, set the remote directory to @var{path} and
+## return the new remote working directory.
+##
+## If the directory does not exist, an error message is printed and the
+## working directory is not changed.
 ## @end deftypefn
 
-function cd (f, path)
-  __ftp_cwd__ (f.curlhandle, path);
+function path = cd (f, path)
+  if (nargin != 1 && nargin != 2)
+    print_usage ();
+  endif
+
+  if (nargin == 2)
+    __ftp_cwd__ (f.curlhandle, path);
+  endif
+  path = __ftp_pwd__ (f.curlhandle);
 endfunction
--- a/scripts/audio/wavwrite.m
+++ b/scripts/audio/wavwrite.m
@@ -157,43 +157,43 @@
 %! A = [-1:0.1:1; -1:0.1:1];
 %! wavwrite (A, fname);
 %! [B, samples_per_sec, bits_per_sample] = wavread (fname);
+%! unlink (fname);
 %! assert (A,B, 1/2^15);
 %! assert (samples_per_sec, 8000);
 %! assert (bits_per_sample, 16);
-%! unlink (fname);
-%
+
 %!test
 %! A = [-1:0.1:1; -1:0.1:1];
 %! wavwrite (A, 4000, fname);
 %! [B, samples_per_sec, bits_per_sample] = wavread (fname);
+%! unlink (fname);
 %! assert (A,B, 1/2^15);
 %! assert (samples_per_sec, 4000);
 %! assert (bits_per_sample, 16);
-%! unlink (fname);
-%
+
 %!test
 %! A = [-1:0.1:1; -1:0.1:1];
 %! wavwrite (A, 4000, 8, fname);
 %! [B, samples_per_sec, bits_per_sample] = wavread (fname);
+%! unlink (fname);
 %! assert (A,B, 1/128);
 %! assert (samples_per_sec, 4000);
 %! assert (bits_per_sample, 8);
-%! unlink (fname);
-%
+
 %!test
 %! A = [-2:2]';
 %! wavwrite (A, fname);
 %! B = wavread (fname);
+%! unlink (fname);
 %! B *= 32768;
 %! assert (B, [-32768 -32768 0 32767 32767]');
-%! unlink (fname);
-%
+
 %!test
 %! A = [-1:0.1:1];
 %! wavwrite (A, fname);
 %! [B, samples_per_sec, bits_per_sample] = wavread (fname);
+%! unlink (fname);
 %! assert (A', B, 1/2^15);
 %! assert (samples_per_sec, 8000);
 %! assert (bits_per_sample, 16);
-%! unlink (fname);
 
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/default_save_options.m
@@ -0,0 +1,42 @@
+## Copyright (C) 2013 Rik Wehbring
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn  {Built-in Function} {@var{val} =} default_save_options ()
+## @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val})
+## @deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, "local")
+## This function has been deprecated.  Use @code{@file{save_default_options}}
+## instead.
+## @seealso{save_default_options}
+## @end deftypefn
+
+## Deprecated in 3.8
+
+function retval = default_save_options (varargin)
+
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "default_save_options is obsolete and will be removed from a future version of Octave, please use save_default_options instead");
+  endif
+
+  retval = save_default_options (varargin{:});
+
+endfunction
+
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/gen_doc_cache.m
@@ -0,0 +1,39 @@
+## Copyright (C) 2013 Rik Wehbring
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} gen_doc_cache (@var{out_file}, @var{directory})
+## This function has been deprecated.  Use @code{doc_cache_create} instead.
+## @seealso{doc_cache_create}
+## @end deftypefn
+
+## Deprecated in 3.8
+
+function gen_doc_cache (varargin)
+
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "gen_doc_cache is obsolete and will be removed from a future version of Octave, please use doc_cache_create instead");
+  endif
+
+  doc_cache_create (varargin{:});
+
+endfunction
+
rename from scripts/general/isequalwithequalnans.m
rename to scripts/deprecated/isequalwithequalnans.m
--- a/scripts/general/isequalwithequalnans.m
+++ b/scripts/deprecated/isequalwithequalnans.m
@@ -18,18 +18,22 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} isequalwithequalnans (@var{x1}, @var{x2}, @dots{})
-## Assuming NaN == NaN, return true if all of @var{x1}, @var{x2}, @dots{}
-## are equal.
-## @seealso{isequal}
+## This function has been deprecated.  Use @code{@file{isequaln}} instead.
+## @seealso{isequaln}
 ## @end deftypefn
 
-function retval = isequalwithequalnans (x1, varargin)
+## Deprecated in 3.8
+
+function retval = isequalwithequalnans (varargin)
 
-  if (nargin < 2)
-    print_usage ();
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "isequalwithequalnans is obsolete and will be removed from a future version of Octave, please use isequaln instead");
   endif
 
-  retval = __isequal__ (true, x1, varargin{:});
+  retval = isequaln (varargin{:});
 
 endfunction
 
--- a/scripts/deprecated/module.mk
+++ b/scripts/deprecated/module.mk
@@ -5,8 +5,11 @@
   deprecated/cor.m \
   deprecated/corrcoef.m \
   deprecated/cut.m \
+  deprecated/default_save_options.m \
   deprecated/java_debug.m \
   deprecated/error_text.m \
+  deprecated/gen_doc_cache.m \
+  deprecated/isequalwithequalnans.m \
   deprecated/isstr.m \
   deprecated/java_convert_matrix.m \
   deprecated/java_get.m \
@@ -17,7 +20,9 @@
   deprecated/javafields.m \
   deprecated/javamethods.m \
   deprecated/polyderiv.m \
-  deprecated/setstr.m \
+  deprecated/re_read_readline_init_file.m \
+  deprecated/read_readline_init_file.m \
+  deprecated/saving_history.m \
   deprecated/shell_cmd.m \
   deprecated/studentize.m \
   deprecated/sylvester_matrix.m
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/re_read_readline_init_file.m
@@ -0,0 +1,40 @@
+## Copyright (C) 2013 Rik Wehbring
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Built-in Function} {} re_read_readline_init_file (@var{file})
+## This function has been deprecated.  Use
+## @code{@file{readline_re_read_init_file}} instead.
+## @seealso{readline_read_init_file}
+## @end deftypefn
+
+## Deprecated in 3.8
+
+function re_read_readline_init_file (varargin)
+
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "re_read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_re_read_init_file instead");
+  endif
+
+  readline_re_read_init_file (varargin{:});
+
+endfunction
+
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/read_readline_init_file.m
@@ -0,0 +1,40 @@
+## Copyright (C) 2013 Rik Wehbring
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Built-in Function} {} read_readline_init_file (@var{file})
+## This function has been deprecated.  Use
+## @code{@file{readline_read_init_file}} instead.
+## @seealso{readline_read_init_file}
+## @end deftypefn
+
+## Deprecated in 3.8
+
+function read_readline_init_file (varargin)
+
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_read_init_file instead");
+  endif
+
+  readline_read_init_file (varargin{:});
+
+endfunction
+
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/saving_history.m
@@ -0,0 +1,41 @@
+## Copyright (C) 2013 Rik Wehbring
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn  {Built-in Function} {@var{val} =} saving_history ()
+## @deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val})
+## @deftypefnx {Built-in Function} {} saving_history (@var{new_val}, "local")
+## This function has been deprecated.  Use @code{@file{history_save}} instead.
+## @seealso{history_save}
+## @end deftypefn
+
+## Deprecated in 3.8
+
+function retval = saving_history (varargin)
+
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "saving_history is obsolete and will be removed from a future version of Octave, please use history_save instead");
+  endif
+
+  retval = save_default_options (varargin{:});
+
+endfunction
+
deleted file mode 100644
--- a/scripts/deprecated/setstr.m
+++ /dev/null
@@ -1,40 +0,0 @@
-## Copyright (C) 2003-2012 John W. Eaton
-##
-## This file is part of Octave.
-##
-## Octave is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 3 of the License, or (at
-## your option) any later version.
-##
-## Octave is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-## -*- texinfo -*-
-## @deftypefn {Function File} {} setstr (@var{s})
-## This function has been deprecated.  Use char instead.
-## @end deftypefn
-
-## Author: jwe
-
-## Deprecated in version 3.0
-## Matlab still has this function, so don't remove just yet.
-
-function retval = setstr (varargin)
-
-  persistent warned = false;
-  if (! warned)
-    warned = true;
-    warning ("Octave:deprecated-function",
-             "setstr is obsolete and will be removed from a future version of Octave; please use char instead");
-  endif
-
-  retval = char (varargin{:});
-
-endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/elfun/atan2d.m
@@ -0,0 +1,41 @@
+## Copyright (C) 2013 Rik Wehbring
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} atan2d (@var{y}, @var{x})
+## Compute atan2 (@var{y} / @var{x}) in degrees for corresponding elements
+## from @var{y} and @var{x}.
+## @seealso{tand, atan2}
+## @end deftypefn
+
+function retval = atan2d (y, x)
+
+  if (nargin != 2)
+    print_usage ();
+  endif
+
+  retval = 180 ./ pi .* atan2 (y, x);
+
+endfunction
+
+
+%!assert (atan2d (-1:.1:1, 1:-.1:-1), 180/pi * atan2 (-1:.1:1, 1:-.1:-1), -10*eps)
+
+%!error atan2d ()
+%!error atan2d (1)
+
--- a/scripts/elfun/module.mk
+++ b/scripts/elfun/module.mk
@@ -12,6 +12,7 @@
   elfun/asecd.m \
   elfun/asech.m \
   elfun/asind.m \
+  elfun/atan2d.m \
   elfun/atand.m \
   elfun/cosd.m \
   elfun/cot.m \
--- a/scripts/general/accumarray.m
+++ b/scripts/general/accumarray.m
@@ -61,7 +61,7 @@
 ## that in the first column counts how many occurrences each number in
 ## the second column has, taken from the vector @var{x}.  Note the usage
 ## of @code{unique}  for assigning to all repeated elements of @var{x}
-## the same index (@pxref{doc-unique}).
+## the same index (@pxref{XREFunique,,unique}).
 ##
 ## @example
 ## @group
@@ -92,7 +92,7 @@
 ## @end example
 ##
 ## The sparse option can be used as an alternative to the @code{sparse}
-## constructor (@pxref{doc-sparse}).  Thus
+## constructor (@pxref{XREFsparse,,sparse}).  Thus
 ##
 ## @example
 ## sparse (@var{i}, @var{j}, @var{sv})
--- a/scripts/general/accumdim.m
+++ b/scripts/general/accumdim.m
@@ -59,7 +59,7 @@
 
 function A = accumdim (subs, vals, dim, n = 0, func = [], fillval = 0)
 
-  if (nargin < 2 || nargin > 5)
+  if (nargin < 2 || nargin > 6)
     print_usage ();
   endif
 
@@ -149,8 +149,7 @@
 endfunction
 
 
-%%test accumdim vs. accumarray
-
+%% Test accumdim vs. accumarray
 %!shared a
 %! a = rand (5, 5, 5);
 
@@ -159,3 +158,16 @@
 %!assert (accumdim ([2;3;2;1;2], a, 3, 3, @min)(1,5,:), accumarray ([2;3;2;1;2], a(1,5,:), [1,1,3], @min))
 %!assert (accumdim ([1;3;2;2;1], a, 2, 3, @median)(4,:,5), accumarray ([1;3;2;2;1], a(4,:,5), [1,3], @median))
 
+%% Test fillval
+%!assert (accumdim ([1;3;1;3;3], a)(2,:,:), zeros (1,5,5))
+%!assert (accumdim ([1;3;1;3;3], a, 1, 4)([2 4],:,:), zeros (2,5,5))
+%!assert (accumdim ([1;3;1;3;3], a, 1, 4, [], pi)([2 4],:,:), pi (2,5,5))
+
+%% Test input validation
+%!error accumdim (1)
+%!error accumdim (1,2,3,4,5,6,7)
+%!error <SUBS must be a subscript vector> accumdim (ones (2,2), ones (2,2))
+%!error <indices must be positive integers> accumdim ([-1 1], ones (2,2))
+%!error <N index out of range> accumdim ([1 2], ones (2,2), 1, 1)
+%!error <dimension mismatch> accumdim ([1], ones (2,2))
+
--- a/scripts/general/cell2mat.m
+++ b/scripts/general/cell2mat.m
@@ -21,8 +21,8 @@
 ## @deftypefn {Function File} {@var{m} =} cell2mat (@var{c})
 ## Convert the cell array @var{c} into a matrix by concatenating all
 ## elements of @var{c} into a hyperrectangle.  Elements of @var{c} must
-## be numeric, logical or char matrices, or cell arrays, and @code{cat}
-## must be able to concatenate them together.
+## be numeric, logical, or char matrices; or cell arrays; or structs; and
+## @code{cat} must be able to concatenate them together.
 ## @seealso{mat2cell, num2cell}
 ## @end deftypefn
 
@@ -42,38 +42,48 @@
     m = [];
   else
 
-    ## We only want numeric, logical, and char matrices.
+    ## Check first for valid matrix types
     valid = cellfun ("isnumeric", c);
-    valid |= cellfun ("islogical", c);
-    valid |= cellfun ("isclass", c, "char");
-    validc = cellfun ("isclass", c, "cell");
-    valids = cellfun ("isclass", c, "struct");
-
-    if (! all (valid(:)) && ! all (validc(:)) && ! all (valids(:)))
-      error ("cell2mat: wrong type elements or mixed cells, structs and matrices");
+    valid = cellfun ("islogical", c(! valid));
+    valid = cellfun ("isclass", c(! valid), "char");
+    if (! all (valid(:)))
+      valid = cellfun ("isclass", c, "cell");
+      if (! all (valid(:)))
+        valid = cellfun ("isclass", c, "struct");
+        if (! all (valid(:)))
+          error ("cell2mat: wrong type elements or mixed cells, structs, and matrices");
+        endif
+      endif
     endif
 
-    ## The goal is to minimize the total number of cat() calls.
-    ## The dimensions can be concatenated along in arbitrary order.
-    ## The numbers of concatenations are:
-    ## n / d1
-    ## n / (d1 * d2)
-    ## n / (d1 * d2 * d3)
-    ## etc.
-    ## This is minimized if d1 >= d2 >= d3...
+    sz = size (c);
+    if (all (cellfun ("numel", c)(:) == 1))
+      ## Special case of all scalars
+      m = reshape (cat (1, c{:}), sz);
+    else
 
-    sc = size (c);
-    nd = ndims (c);
-    [~, isc] = sort (sc);
-    for idim = isc
-      if (sc(idim) == 1)
-        continue;
-      endif
-      xdim = [1:idim-1, idim+1:nd];
-      cc = num2cell (c, xdim);
-      c = cellfun ("cat", {idim}, cc{:}, "uniformoutput", false);
-    endfor
-    m = c{1};
+      ## The goal is to minimize the total number of cat() calls.
+      ## The dimensions can be concatenated along in arbitrary order.
+      ## The numbers of concatenations are:
+      ## n / d1
+      ## n / (d1 * d2)
+      ## n / (d1 * d2 * d3)
+      ## etc.
+      ## This is minimized if d1 >= d2 >= d3...
+
+      nd = ndims (c);
+      [~, isz] = sort (sz, "descend");
+      for idim = isz
+        if (sz(idim) == 1)
+          continue;
+        endif
+        xdim = [1:idim-1, idim+1:nd];
+        cc = num2cell (c, xdim);
+        c = cellfun ("cat", {idim}, cc{:}, "uniformoutput", false);
+      endfor
+      m = c{1};
+
+    endif
   endif
 
 endfunction
@@ -103,3 +113,10 @@
 %! m = {1, 2, 3};
 %! assert (cell2mat (mat2cell (m, 1, [1 1 1])), m);
 
+%!error cell2mat ()
+%!error cell2mat (1,2)
+%!error <C is not a cell array> cell2mat ([1,2])
+%!error <mixed cells, structs, and matrices> cell2mat ({[1], struct()})
+%!error <mixed cells, structs, and matrices> cell2mat ({[1], {1}})
+%!error <mixed cells, structs, and matrices> cell2mat ({struct(), {1}})
+
--- a/scripts/general/genvarname.m
+++ b/scripts/general/genvarname.m
@@ -119,7 +119,7 @@
     error ("genvarname: STR must be a string or a cellstr");
   endif
 
-  validchars = cstrcat ("A":"Z", "a":"z", "0":"9", "_");
+  validchars = ["A":"Z", "a":"z", "0":"9", "_"];
 
   varname = cell (size (str));
   for i = 1:numel (str)
@@ -130,7 +130,7 @@
     str{i}(! ismember (str{i}, validchars)) = "_";
     ## do not use keywords
     if (iskeyword (str{i}))
-      str{i} = cstrcat ("_", str{i});
+      str{i} = ["_" str{i}];
     endif
     ## double underscores at the beginning and end are reserved variables
     underscores = (str{i} == "_");
@@ -145,7 +145,7 @@
     endif
     ## it cannot start with a number
     if (ismember (str{i}(1), "0":"9"))
-      str{i} = cstrcat ("_", str{i});
+      str{i} = ["_" str{i}];
     endif
 
     ## make sure that the variable is unique relative to other variables
--- a/scripts/general/int2str.m
+++ b/scripts/general/int2str.m
@@ -67,9 +67,9 @@
     ifmt = get_fmt (n(idx{:}), 0);
     idx(2) = 2:sz(2);
     rfmt = get_fmt (n(idx{:}), 2);
-    fmt = cstrcat (ifmt, repmat (rfmt, 1, nc-1), "\n");
+    fmt = [ifmt repmat(rfmt,1,nc-1) "\n"];
   else
-    fmt = cstrcat (get_fmt (n, 0), "\n");
+    fmt = [get_fmt(n, 0) "\n"];
   endif
   tmp = sprintf (fmt, permute (n, [2, 1, 3 : nd]));
   tmp(end) = "";
@@ -86,7 +86,7 @@
     fmt = sprintf ("%%%dd", 1 + sep);
   else
     ## Maybe have some zeros.
-    nan_inf = isinf (t) | isnan (t);
+    nan_inf = ! isfinite (t);
     if (any (nan_inf))
       if (any (t(nan_inf) < 0))
         min_fw = 4 + sep;
--- a/scripts/general/interp1.m
+++ b/scripts/general/interp1.m
@@ -26,8 +26,8 @@
 ##
 ## One-dimensional interpolation.  Interpolates to determine the value of
 ## @var{yi} at the points, @var{xi}.  If not specified, @var{x} is taken
-## to be the indices of @var{y}.  If @var{y} is an array, treat the columns
-## of @var{y} separately.
+## to be the indices of @var{y}.  If @var{y} is a matrix or an N-dimensional
+## array, the interpolation is performed on each column of @var{y}.
 ##
 ## Method is one of:
 ##
@@ -68,7 +68,7 @@
 ## Duplicate points in @var{x} specify a discontinuous interpolant.  There
 ## may be at most 2 consecutive points with the same value.
 ## If @var{x} is increasing, the default discontinuous interpolant is
-## right-continuous. If @var{x} is decreasing, the default discontinuous
+## right-continuous.  If @var{x} is decreasing, the default discontinuous
 ## interpolant is left-continuous.
 ## The continuity condition of the interpolant may be specified by using
 ## the options, "-left" or "-right", to select a left-continuous
@@ -149,7 +149,11 @@
   if (isempty (xi) && firstnumeric && ! ispp)
     xi = y;
     y = x;
-    x = 1:numel (y);
+    if (isvector (y))
+      x = 1:numel (y);
+    else
+      x = 1:rows (y);
+    endif
   endif
 
   ## reshape matrices for convenience
--- a/scripts/general/interp1q.m
+++ b/scripts/general/interp1q.m
@@ -21,9 +21,10 @@
 ## One-dimensional linear interpolation without error checking.
 ## Interpolates @var{y}, defined at the points @var{x}, at the points
 ## @var{xi}.  The sample points @var{x} must be a strictly monotonically
-## increasing column vector.  If @var{y} is an array, treat the columns
-## of @var{y} separately.  If @var{y} is a vector, it must be a column
-## vector of the same length as @var{x}.
+## increasing column vector.  If @var{y} is a matrix or an N-dimensional
+## array, the interpolation is performed on each column of @var{y}.  If
+## @var{y} is a vector, it must be a column vector of the same length as
+## @var{x}.
 ##
 ## Values of @var{xi} beyond the endpoints of the interpolation result
 ## in NA being returned.
--- a/scripts/general/interpft.m
+++ b/scripts/general/interpft.m
@@ -22,9 +22,9 @@
 ##
 ## Fourier interpolation.  If @var{x} is a vector, then @var{x} is
 ## resampled with @var{n} points.  The data in @var{x} is assumed to be
-## equispaced.  If @var{x} is an array, then operate along each column of
-## the array separately.  If @var{dim} is specified, then interpolate
-## along the dimension @var{dim}.
+## equispaced.  If @var{x} is a matrix or an N-dimensional array, the
+## interpolation is performed on each column of @var{x}.  If @var{dim} is
+## specified, then interpolate along the dimension @var{dim}.
 ##
 ## @code{interpft} assumes that the interpolated function is periodic,
 ## and so assumptions are made about the endpoints of the interpolation.
@@ -68,7 +68,7 @@
   x = permute (x, perm);
   m = rows (x);
 
-  inc = max (1, fix (m/n));
+  inc = ceil (m/n);
   y = fft (x) / m;
   k = floor (m / 2);
   sz = size (x);
--- a/scripts/general/interpn.m
+++ b/scripts/general/interpn.m
@@ -76,14 +76,14 @@
 
   if (ischar (varargin{end}))
     method = varargin{end};
-    nargs = nargs - 1;
+    nargs -= 1;
   elseif (nargs > 1 && ischar (varargin{end - 1}))
     if (! isnumeric (varargin{end}) || ! isscalar (varargin{end}))
       error ("interpn: extrapal is expected to be a numeric scalar");
     endif
     method = varargin{end - 1};
     extrapval = varargin{end};
-    nargs = nargs - 2;
+    nargs -= 2;
   endif
 
   if (nargs < 3)
@@ -102,7 +102,7 @@
     nd = ndims (v);
     x = cell (1, nd);
     y = cell (1, nd);
-    for i = 1 : nd;
+    for i = 1 : nd
       x{i} = 1 : sz(i);
       y{i} = 1 : (1 / (2 ^ m)) : sz(i);
     endfor
@@ -113,18 +113,18 @@
     sz = size (v);
     nd = ndims (v);
     x = cell (1, nd);
-    y = varargin (2 : nargs);
-    for i = 1 : nd;
+    y = varargin(2 : nargs);
+    for i = 1 : nd
       x{i} = 1 : sz(i);
     endfor
-  elseif (rem (nargs, 2) == 1 && nargs ==
-          (2 * ndims (varargin{ceil (nargs / 2)})) + 1)
+  elseif (rem (nargs, 2) == 1
+          && nargs == (2 * ndims (varargin{ceil (nargs / 2)})) + 1)
     nv = ceil (nargs / 2);
     v = varargin{nv};
     sz = size (v);
     nd = ndims (v);
-    x = varargin (1 : (nv - 1));
-    y = varargin ((nv + 1) : nargs);
+    x = varargin(1 : (nv - 1));
+    y = varargin((nv + 1) : nargs);
   else
     error ("interpn: wrong number or incorrectly formatted input arguments");
   endif
@@ -134,12 +134,12 @@
       if (! size_equal (x{1}, x{i}) || ! size_equal (x{i}, v))
         error ("interpn: dimensional mismatch");
       endif
-      idx (1 : nd) = {1};
-      idx (i) = ":";
+      idx(1 : nd) = {1};
+      idx(i) = ":";
       x{i} = x{i}(idx{:})(:);
     endfor
-    idx (1 : nd) = {1};
-    idx (1) = ":";
+    idx(1 : nd) = {1};
+    idx(1) = ":";
     x{1} = x{1}(idx{:})(:);
   endif
 
@@ -154,7 +154,7 @@
 
   if (strcmp (method, "linear"))
     vi = __lin_interpn__ (x{:}, v, y{:});
-    vi (isna (vi)) = extrapval;
+    vi(isna (vi)) = extrapval;
   elseif (strcmp (method, "nearest"))
     yshape = size (y{1});
     yidx = cell (1, nd);
@@ -166,7 +166,7 @@
     for i = 1 : nd
       idx{i} = yidx{i} + (y{i} - x{i}(yidx{i})(:) >= x{i}(yidx{i} + 1)(:) - y{i});
     endfor
-    vi = v (sub2ind (sz, idx{:}));
+    vi = v(sub2ind (sz, idx{:}));
     idx = zeros (prod (yshape), 1);
     for i = 1 : nd
       idx |= y{i} < min (x{i}(:)) | y{i} > max (x{i}(:));
@@ -179,12 +179,12 @@
         if (! size_equal (y{1}, y{i}))
           error ("interpn: dimensional mismatch");
         endif
-        idx (1 : nd) = {1};
-        idx (i) = ":";
+        idx(1 : nd) = {1};
+        idx(i) = ":";
         y{i} = y{i}(idx{:});
       endfor
-      idx (1 : nd) = {1};
-      idx (1) = ":";
+      idx(1 : nd) = {1};
+      idx(1) = ":";
       y{1} = y{1}(idx{:});
     endif
 
@@ -196,9 +196,9 @@
       q = cell (1, nd);
       for i = 1 : ly
         q(:) = i;
-        idx {i} = q;
+        idx{i} = q;
       endfor
-      vi = vi (cellfun (@(x) sub2ind (size (vi), x{:}), idx));
+      vi = vi(cellfun (@(x) sub2ind (size (vi), x{:}), idx));
       vi = reshape (vi, size (y{1}));
     endif
   elseif (strcmp (method, "cubic"))
--- a/scripts/general/isequal.m
+++ b/scripts/general/isequal.m
@@ -19,7 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} isequal (@var{x1}, @var{x2}, @dots{})
 ## Return true if all of @var{x1}, @var{x2}, @dots{} are equal.
-## @seealso{isequalwithequalnans}
+## @seealso{isequaln}
 ## @end deftypefn
 
 function retval = isequal (x1, varargin)
@@ -74,3 +74,7 @@
 ## test for inequality (struct)
 %!assert (isequal (struct ('a',NaN,'b',2),struct ('a',NaN,'b',2),struct ('a',NaN,'b',2)), false)
 
+## Input validation
+%!error isequal ()
+%!error isequal (1)
+
new file mode 100644
--- /dev/null
+++ b/scripts/general/isequaln.m
@@ -0,0 +1,50 @@
+## Copyright (C) 2005-2012 William Poetra Yoga Hadisoeseno
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} isequaln (@var{x1}, @var{x2}, @dots{})
+## Return true if all of @var{x1}, @var{x2}, @dots{} are equal under the
+## additional assumption that NaN == NaN (no comparison of NaN placeholders
+## in dataset).
+## @seealso{isequal}
+## @end deftypefn
+
+function retval = isequaln (x1, varargin)
+
+  if (nargin < 2)
+    print_usage ();
+  endif
+
+  retval = __isequal__ (true, x1, varargin{:});
+
+endfunction
+
+
+## test for equality
+%!assert (isequaln ({1,2,NaN,4},{1,2,NaN,4}), true)
+%!assert (isequaln ([1,2,NaN,4],[1,2,NaN,4]), true)
+## test for inequality
+%!assert (isequaln ([1,2,NaN,4],[1,NaN,3,4]), false)
+%!assert (isequaln ([1,2,NaN,4],[1,2,3,4]), false)
+## test for equality (struct)
+%!assert (isequaln (struct ('a',NaN,'b',2),struct ('a',NaN,'b',2),struct ('a',NaN,'b',2)), true)
+%!assert (isequaln (1,2,1), false)
+
+## Input validation
+%!error isequaln ()
+%!error isequaln (1)
--- a/scripts/general/module.mk
+++ b/scripts/general/module.mk
@@ -46,7 +46,7 @@
   general/iscolumn.m \
   general/isdir.m \
   general/isequal.m \
-  general/isequalwithequalnans.m \
+  general/isequaln.m \
   general/isrow.m \
   general/isscalar.m \
   general/issquare.m \
--- a/scripts/general/num2str.m
+++ b/scripts/general/num2str.m
@@ -53,7 +53,7 @@
 ##
 ## Notes:
 ##
-## For Matlab compatibility, leading spaces are stripped before returning
+## For @sc{matlab} compatibility, leading spaces are stripped before returning
 ## the string.
 ##
 ## The @code{num2str} function is not very flexible.  For better control
@@ -115,14 +115,14 @@
         fmt = "%3d";
       endif
     endif
-    fmt = cstrcat (deblank (repmat (fmt, 1, columns (x))), "\n");
+    fmt = [deblank(repmat(fmt, 1, columns(x))), "\n"];
     nd = ndims (x);
     tmp = sprintf (fmt, permute (x, [2, 1, 3:nd]));
     retval = strtrim (char (ostrsplit (tmp(1:end-1), "\n")));
   else   # Complex matrix input
     if (nargin == 2)
       if (ischar (arg))
-        fmt = cstrcat (arg, "%-+", arg(2:end), "i");
+        fmt = [arg "%-+" arg(2:end) "i"];
       elseif (isnumeric (arg) && isscalar (arg) && arg >= 0)
         fmt = sprintf ("%%%d.%dg%%-+%d.%dgi", arg+7, arg, arg+7, arg);
       else
@@ -157,7 +157,7 @@
     x = horzcat (real (x), imag (x));
     x = x(idx{:});
 
-    fmt = cstrcat (deblank (repmat (fmt, 1, nc)), "\n");
+    fmt = [deblank(repmat(fmt, 1, nc)), "\n"];
     tmp = sprintf (fmt, permute (x, [2, 1, 3:nd]));
 
     ## Put the "i"'s where they are supposed to be.
--- a/scripts/general/pol2cart.m
+++ b/scripts/general/pol2cart.m
@@ -55,7 +55,7 @@
       r = theta(:,2);
       theta = theta(:,1);
     else
-      error ("pol2car: matrix input must have 2 or 3 columns [THETA, R (, Z)]");
+      error ("pol2cart: matrix input must have 2 or 3 columns [THETA, R (, Z)]");
     endif
   elseif (nargin == 2)
     if (! ((ismatrix (theta) && ismatrix (r))
--- a/scripts/general/quadv.m
+++ b/scripts/general/quadv.m
@@ -106,7 +106,7 @@
 
   if (nfun > 10000)
     warning ("maximum iteration count reached");
-  elseif (any (isnan (q)(:) | isinf (q)(:)))
+  elseif (any (! isfinite (q(:))))
     warning ("infinite or NaN function evaluations were returned");
   elseif (hmin < (b - a) * myeps)
     warning ("minimum step size reached -- possibly singular integral");
--- a/scripts/general/structfun.m
+++ b/scripts/general/structfun.m
@@ -64,11 +64,11 @@
 ##
 ## @noindent
 ## where there is an additional input argument to @var{errfunc} relative to
-## @var{func}, given by @var{se}.  This is a structure with the elements
-## "identifier", "message" and "index", giving respectively the error
+## @var{func}, given by @nospell{@var{se}}.  This is a structure with the
+## elements "identifier", "message" and "index", giving respectively the error
 ## identifier, the error message, and the index into the input arguments
 ## of the element that caused the error.  For an example on how to use
-## an error handler, @pxref{doc-cellfun, @code{cellfun}}.
+## an error handler, @pxref{XREFcellfun,,cellfun}.
 ##
 ## @seealso{cellfun, arrayfun, spfun}
 ## @end deftypefn
--- a/scripts/geometry/delaunay.m
+++ b/scripts/geometry/delaunay.m
@@ -18,12 +18,15 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} delaunay (@var{x}, @var{y})
-## @deftypefnx {Function File} {@var{tri} =} delaunay (@var{x}, @var{y})
-## @deftypefnx {Function File} {@var{tri} =} delaunay (@var{x}, @var{y}, @var{options})
+## @deftypefnx {Function File} {} delaunay (@var{x})
+## @deftypefnx {Function File} {} delaunay (@dots{}, @var{options})
+## @deftypefnx {Function File} {@var{tri} =} delaunay (@dots{})
 ## Compute the Delaunay triangulation for a 2-D set of points.
 ## The return value @var{tri} is a set of triangles which satisfies the
 ## Delaunay circum-circle criterion, i.e., only a single data point from
 ## [@var{x}, @var{y}] is within the circum-circle of the defining triangle.
+## The input @var{x} may also be a matrix with two columns where the first
+## column contains x-data and the second y-data.
 ##
 ## The set of triangles @var{tri} is a matrix of size [n, 3].  Each
 ## row defines a triangle and the three columns are the three vertices
@@ -31,7 +34,7 @@
 ## @var{x} and @var{y} for the location of the j-th vertex of the i-th
 ## triangle.
 ##
-## An optional third argument, which must be a string or cell array of strings,
+## The optional last argument, which must be a string or cell array of strings,
 ## contains options passed to the underlying qhull command.
 ## See the documentation for the Qhull library for details
 ## @url{http://www.qhull.org/html/qh-quick.htm#options}.
@@ -61,24 +64,56 @@
 
 ## Author: Kai Habel <kai.habel@gmx.de>
 
-function tri = delaunay (x, y, options)
+function tri = delaunay (varargin)
 
-  if (nargin != 2 && nargin != 3)
+  if (nargin < 1 || nargin > 3)
     print_usage ();
   endif
 
-  if (! (isvector (x) && isvector (y) && length (x) == length (y))
-      && ! size_equal (x, y))
+  options = [];
+
+  switch (nargin)
+
+  case 1
+    if (! ismatrix (varargin{1}) && columns (varargin{1}) != 2)
+        error ("delaunay: X must be a matrix with 2 columns");
+    else
+      x = varargin{1}(:,1);
+      y = varargin{1}(:,2);
+    endif
+  
+  case 2
+    if (isnumeric (varargin{2}))
+      x = varargin{1};
+      y = varargin{2};
+    elseif (ischar (varargin{2}) || iscellstr (varargin{2}))
+      options = varargin{2};
+      if (! ismatrix (varargin{1}) && columns (varargin{1}) != 2)
+          error ("delaunay: X must be a matrix with 2 columns");
+      else
+        x = varargin{1}(:,1);
+        y = varargin{1}(:,2);
+      endif
+    else
+      error ("delaunay: OPTIONS must be a string or cell array of strings");
+    endif
+
+  case 3
+    x = varargin{1};
+    y = varargin{2};
+    options = varargin{3};
+
+    if (! (ischar (options) || iscellstr (options)))
+      error ("delaunay: OPTIONS must be a string or cell array of strings");
+    endif
+
+  endswitch
+
+  if (! (isvector (x) && isvector (y) && length (x) == length (y)))
     error ("delaunay: X and Y must be the same size");
-  elseif (nargin == 3 && ! (ischar (options) || iscellstr (options)))
-    error ("delaunay: OPTIONS must be a string or cell array of strings");
   endif
 
-  if (nargin == 2)
-    T = delaunayn ([x(:), y(:)]);
-  else
-    T = delaunayn ([x(:), y(:)], options);
-  endif
+  T = delaunayn ([x(:), y(:)], options);
 
   if (nargout == 0)
     x = x(:).';
@@ -112,6 +147,11 @@
 %! assert (sortrows (sort (delaunay (x, y), 2)), [1,2,4;2,3,4]);
 
 %!testif HAVE_QHULL
+%! x = [-1, 0, 1, 0];
+%! y = [0, 1, 0, -1];
+%! assert (sortrows (sort (delaunay ([x(:) y(:)]), 2)), [1,2,4;2,3,4]);
+
+%!testif HAVE_QHULL
 %! x = [-1, 0, 1, 0, 0];
 %! y = [0, 1, 0, -1, 0];
 %! assert (sortrows (sort (delaunay (x, y), 2)), [1,2,5;1,4,5;2,3,5;3,4,5]);
--- a/scripts/help/__makeinfo__.m
+++ b/scripts/help/__makeinfo__.m
@@ -100,7 +100,7 @@
     error ("unable to open %s for reading", file);
   else
     macros_text = fread (fid, Inf, "*char")';
-    text = cstrcat (macros_text, text);
+    text = [macros_text text];
   endif
   fclose (fid);
 
--- a/scripts/help/__unimplemented__.m
+++ b/scripts/help/__unimplemented__.m
@@ -41,8 +41,9 @@
   ## Some smarter cases, add more as needed.
   switch (fcn)
 
-  case "quad2d"
-    txt = ["quad2d is not implemented.  Consider using dblquad."];
+  case {"avifile", "aviinfo", "aviread"}
+    txt = ["Basic video file support is provided in the video package. ",...
+    "See @url{http://octave.sf.net/video/}."];
 
   case "gsvd"
     txt = ["gsvd is not currently part of core Octave.  See the ",...
@@ -53,34 +54,46 @@
     txt = ["funm is not currently part of core Octave.  See the ",...
     "linear-algebra package at @url{http://octave.sf.net/linear-algebra/}."];
 
+  case "griddedInterpolant"
+    txt = ["griddedInterpolant is not implemented.  Consider using griddata."];
+
+  case "integral"
+    txt = ["Octave provides many routines for 1-D numerical integration.  ",...
+    "Consider quadcc, quad, quadv, quadl, quadgk."];
+
+  case "integral2"
+    txt = ["integral2 is not implemented.  Consider using dblquad."];
+
+  case "integral3"
+    txt = ["integral3 is not implemented.  Consider using triplequad"];
+
   case "linprog"
     txt = ["Octave does not currently provide linprog.  ",...
     "Linear programming problems may be solved using @code{glpk}.  ",...
     "Try @code{help glpk} for more info."];
 
-  case {"ode113", "ode15i", "ode15s", "ode23", "ode23s", "ode23t", "ode45", "odeget", "odeset"}
+  case "matlabrc"
+    txt = ["matlabrc is not implemented.  ",...
+           'Octave uses the file ".octaverc" instead.'];
+
+  case {"ode113", "ode15i", "ode15s", "ode23", "ode23s", "ode23t", "ode23tb", "ode45", "odeget", "odeset"}
     txt = ["Octave provides lsode for solving differential equations.  ",...
     "For more information try @code{help lsode}.  ",...
     "Matlab-compatible ODE functions are provided by the odepkg package.  ",...
     "See @url{http://octave.sourceforge.net/odepkg/}."];
 
-  case {"javaArray", "javaMethod", "javaMethodEDT", "javaObject", "javaObjectEDT", "javaaddpath", "javaclasspath", "javarmpath"}
-    txt = ["Java objects and methods can be used with the java package. ",...
-    "See @url{http://octave.sf.net/java/}."];
+  case "startup"
+    txt = ["startup is not implemented.  ",...
+           'Octave uses the file ".octaverc" instead.'];
 
-  case {"errordlg", "helpdlg", "inputdlg", "listdlg", "questdlg", "warndlg"}
-    txt = ["Several dialog functions are provided in the java package. ",...
-    "See @url{http://octave.sf.net/java/}."];
+  case "quad2d"
+    txt = ["quad2d is not implemented.  Consider using dblquad."];
 
   case {"xlsread", "xlsfinfo", "xlswrite", "wk1read", "wk1finfo", "wk1write"}
     txt = ["Functions for spreadsheet style I/O (.xls .xlsx .sxc .ods .dbf .wk1 etc.) " , ...
     "are provided in the io package. ",...
     "See @url{http://octave.sf.net/io/}."];
 
-  case {"avifile", "aviinfo", "aviread"}
-    txt = ["Basic video file support is provided in the video package. ",...
-    "See @url{http://octave.sf.net/video/}."];
-
   otherwise
     if (ismember (fcn, missing_functions ()))
       txt = sprintf ("the '%s' function is not yet implemented in Octave", fcn);
@@ -105,22 +118,22 @@
 
 function list = missing_functions ()
   persistent list = {
-  "DelaunayTri",
   "MException",
   "RandStream",
-  "TriRep",
-  "TriScatteredInterp",
+  "Tiff",
+  "VideoReader",
+  "VideoWriter",
   "align",
   "alim",
   "alpha",
   "alphamap",
   "annotation",
   "audiodevinfo",
+  "audioinfo",
   "audioplayer",
+  "audioread",
   "audiorecorder",
-  "aufinfo",
-  "auread",
-  "auwrite",
+  "audiowrite",
   "bar3",
   "bar3h",
   "bench",
@@ -155,38 +168,37 @@
   "cdfwrite",
   "cellplot",
   "checkin",
+  "checkcode",
   "checkout",
   "cholinc",
   "clearvars",
   "clipboard",
   "cmopts",
-  "cmpermute",
-  "cmunique",
   "colordef",
   "colormapeditor",
   "commandhistory",
   "commandwindow",
   "condeig",
   "coneplot",
+  "containers.Map",
   "contourslice",
   "createClassFromWsdl",
   "createSoapMessage",
   "customverctrl",
-  "daqread",
   "datacursormode",
-  "datatipinfo",
   "dbmex",
   "dde23",
   "ddeget",
+  "ddensd",
   "ddesd",
   "ddeset",
   "decic",
+  "delaunayTriangulation",
   "depdir",
   "depfun",
   "deval",
   "dialog",
   "dither",
-  "docopt",
   "docsearch",
   "dragrect",
   "dynamicprops",
@@ -197,8 +209,10 @@
   "figurepalette",
   "filebrowser",
   "fill3",
+  "fitsdisp",
   "fitsinfo",
   "fitsread",
+  "fitswrite",
   "flow",
   "frame2im",
   "freqspace",
@@ -206,41 +220,44 @@
   "gammaincinv",
   "getframe",
   "getpixelposition",
+  "gobjects",
   "grabcode",
   "graymon",
+  "griddedInterpolant",
   "gsvd",
   "guidata",
   "guide",
   "guihandles",
   "handle",
-  "hdf",
-  "hdf5",
-  "hdf5info",
-  "hdf5read",
-  "hdf5write",
+  "h5create",
+  "h5disp",
+  "h5info",
+  "h5read",
+  "h5readatt",
+  "h5write",
+  "h5writeatt",
   "hdfinfo",
   "hdfread",
-  "hdftool",
-  "helpbrowser",
-  "helpdesk",
-  "helpwin",
   "hgexport",
   "hgload",
   "hgsave",
   "hgsetget",
   "hgtransform",
-  "hostid",
+  "ichol",
   "ilu",
   "im2frame",
   "im2java",
   "imapprox",
-  "imformats",
   "import",
   "inmem",
   "inputParser",
   "inspect",
+  "instrcallback",
   "instrfind",
   "instrfindall",
+  "integral",
+  "integral2",
+  "integral3",
   "interpstreamspeed",
   "iscom",
   "isinterface",
@@ -266,25 +283,31 @@
   "lsqr",
   "makehgtform",
   "material",
+  "matfile",
   "matlabrc",
-  "maxNumCompThreads",
   "memmapfile",
   "memory",
   "metaclass",
   "methodsview",
   "minres",
-  "mlint",
   "mlintrpt",
   "mmfileinfo",
-  "mmreader",
   "movegui",
   "movie",
   "movie2avi",
-  "msgbox",
   "multibandread",
   "multibandwrite",
   "native2unicode",
+  "nccreate",
+  "ncdisp",
+  "ncinfo",
+  "ncread",
+  "ncreadatt",
+  "ncwrite",
+  "ncwriteatt",
+  "ncwriteschema",
   "noanimate",
+  "notebook",
   "ode113",
   "ode15i",
   "ode15s",
@@ -293,7 +316,6 @@
   "ode23t",
   "ode23tb",
   "ode45",
-  "odefile",
   "odeget",
   "odeset",
   "odextend",
@@ -305,38 +327,37 @@
   "ordqz",
   "ordschur",
   "padecoef",
-  "pagesetupdlg",
   "pan",
   "parseSoapResponse",
-  "path2rc",
   "pathtool",
   "pcode",
   "pdepe",
   "pdeval",
-  "playshow",
   "plotbrowser",
   "plotedit",
   "plottools",
-  "prefdir",
-  "preferences",
   "printdlg",
   "printopt",
   "printpreview",
   "profsave",
   "propedit",
   "propertyeditor",
+  "psi",
   "publish",
   "qmr",
   "quad2d",
   "rbbox",
   "reducepatch",
   "reducevolume",
-  "root",
+  "readasync",
+  "rng",
   "rotate",
   "rotate3d",
+  "scatteredInterpolant",
   "selectmoveresize",
   "sendmail",
   "serial",
+  "serialbreak",
   "setpixelposition",
   "showplottool",
   "smooth3",
@@ -344,6 +365,8 @@
   "sound",
   "soundsc",
   "ss2tf",
+  "startup",
+  "stopasync",
   "stream2",
   "stream3",
   "streamline",
@@ -354,7 +377,6 @@
   "strings",
   "subvolume",
   "superclasses",
-  "support",
   "surf2patch",
   "symmlq",
   "syntax",
@@ -362,10 +384,10 @@
   "textwrap",
   "tfqmr",
   "timer",
-  "timerfind",
-  "timerfindall",
   "timeseries",
+  "todatenum",
   "toolboxdir",
+  "triangulation",
   "tscollection",
   "tstool",
   "uibuttongroup",
@@ -392,19 +414,15 @@
   "unmesh",
   "userpath",
   "validateattributes",
+  "verctrl",
   "verLessThan",
   "viewmtx",
   "visdiff",
   "volumebounds",
-  "waitfor",
-  "wavfinfo",
-  "wavplay",
-  "wavrecord",
   "web",
   "whatsnew",
-  "wk1finfo",
-  "wk1read",
-  "wk1write",
+  "winopen",
+  "winqueryreg",
   "workspace",
   "xmlread",
   "xmlwrite",
--- a/scripts/help/doc.m
+++ b/scripts/help/doc.m
@@ -53,53 +53,60 @@
       fname = "";
     endif
 
-    if (ftype == 2 || ftype == 3)
-      ffile = which (fname);
-    else
-      ffile = "";
-    endif
-
-    if (isempty (ffile))
-      info_dir = octave_config_info ("infodir");
+    # if GUI is running, let it display the function
+    if isguirunning ()
+      __octave_link_show_doc__ (fname);
     else
-      info_dir = fileparts (ffile);
-    endif
-
-    ## Determine if a file called doc.info exist in the same
-    ## directory as the function.
+  
+      if (ftype == 2 || ftype == 3)
+        ffile = which (fname);
+      else
+        ffile = "";
+      endif
 
-    info_file_name = fullfile (info_dir, "doc.info");
-
-    [stat_info, err] = stat (info_file_name);
+      if (isempty (ffile))
+        info_dir = octave_config_info ("infodir");
+      else
+        info_dir = fileparts (ffile);
+      endif
 
-    if (err < 0)
-      info_file_name = info_file ();
-    endif
+      ## Determine if a file called doc.info exist in the same
+      ## directory as the function.
+
+      info_file_name = fullfile (info_dir, "doc.info");
+
+      [stat_info, err] = stat (info_file_name);
 
-    ## FIXME -- don't change the order of the arguments below because
-    ## the info-emacs-info script currently expects --directory DIR as
-    ## the third and fourth arguments.  Someone should fix that.
+      if (err < 0)
+        info_file_name = info_file ();
+      endif
+
+      ## FIXME -- don't change the order of the arguments below because
+      ## the info-emacs-info script currently expects --directory DIR as
+      ## the third and fourth arguments.  Someone should fix that.
+
+      cmd = sprintf ("\"%s\" --file \"%s\" --directory \"%s\"",
+                     info_program (), info_file_name, info_dir);
+
+      have_fname = ! isempty (fname);
 
-    cmd = sprintf ("\"%s\" --file \"%s\" --directory \"%s\"",
-                   info_program (), info_file_name, info_dir);
+      if (have_fname)
+        status = system (sprintf ("%s --index-search \"%s\"", cmd, fname));
+      endif
+   
 
-    have_fname = ! isempty (fname);
+      if (! (have_fname && status == 0))
+        status = system (cmd);
+        if (status == 127)
+          warning ("unable to find info program '%s'", info_program ());
+        endif
+      endif
 
-    if (have_fname)
-      status = system (sprintf ("%s --index-search \"%s\"", cmd, fname));
+      if (nargout > 0)
+        retval = status;
+      endif
+
     endif
-
-    if (! (have_fname && status == 0))
-      status = system (cmd);
-      if (status == 127)
-        warning ("unable to find info program '%s'", info_program ());
-      endif
-    endif
-
-    if (nargout > 0)
-      retval = status;
-    endif
-
   else
     print_usage ();
   endif
rename from scripts/help/gen_doc_cache.m
rename to scripts/help/doc_cache_create.m
--- a/scripts/help/gen_doc_cache.m
+++ b/scripts/help/doc_cache_create.m
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} gen_doc_cache (@var{out_file}, @var{directory})
+## @deftypefn {Function File} {} doc_cache_create (@var{out_file}, @var{directory})
 ## Generate documentation caches for all functions in a given directory.
 ##
 ## A documentation cache is generated for all functions in @var{directory}.
@@ -28,10 +28,10 @@
 ## If no directory is given (or it is the empty matrix), a cache for builtin
 ## operators, etc. is generated.
 ##
-## @seealso{lookfor, path}
+## @seealso{doc_cache_file, lookfor, path}
 ## @end deftypefn
 
-function gen_doc_cache (out_file = "doc-cache", directory = [])
+function doc_cache_create (out_file = "doc-cache", directory = [])
 
   ## Check input
   if (! ischar (out_file))
@@ -45,12 +45,12 @@
     if (all (cellfun (@ischar, directory)))
       cache = gen_doc_cache_in_dir (directory);
     else
-      error ("gen_doc_cache: cell must contain only strings");
+      error ("doc_cache_create: cell must contain only strings");
     endif
   elseif (ischar (directory))
      cache = gen_doc_cache_in_dir (directory);
   else
-     error ("gen_doc_cache: second input argument must be a string or a cell of strings");
+     error ("doc_cache_create: second input argument must be a string or a cell of strings");
   endif
 
   ## Save cache
@@ -82,7 +82,7 @@
 
   ## Did we get the help text?
   if (status != 0 || isempty (text))
-    warning ("gen_doc_cache: unusable help text found in file '%s'", f);
+    warning ("doc_cache_create: unusable help text found in file '%s'", f);
     return;
   endif
 
@@ -156,4 +156,4 @@
 
 %% No true tests desirable for this function.
 %% Test input validation
-%!error gen_doc_cache (1)
+%!error doc_cache_create (1)
--- a/scripts/help/help.m
+++ b/scripts/help/help.m
@@ -155,7 +155,7 @@
     endif
   endfor
 
-  retval = cstrcat (operators, keywords, builtins, flist);
+  retval = [operators, keywords, builtins, flist];
 
 endfunction
 
--- a/scripts/help/module.mk
+++ b/scripts/help/module.mk
@@ -8,7 +8,7 @@
   help/__makeinfo__.m \
   help/__unimplemented__.m \
   help/doc.m \
-  help/gen_doc_cache.m \
+  help/doc_cache_create.m \
   help/get_first_help_sentence.m \
   help/help.m \
   help/lookfor.m \
--- a/scripts/help/print_usage.m
+++ b/scripts/help/print_usage.m
@@ -31,22 +31,22 @@
   if (nargin == 0)
     ## Determine the name of the calling function
     if (numel (x) > 1)
-      name = x (2).name;
+      name = x(2).name;
     else
       error ("Octave:invalid-context", "print_usage: invalid function\n");
     endif
-    fullpath = evalin ("caller", "mfilename (""fullpath"")");
+    fullpath = evalin ("caller", 'mfilename ("fullpath")');
     if (strcmp (fullpath(end-length(name)+1:end), name))
-      fullname = [fullpath, ".m"];
+      fullname = [fullpath ".m"];
     endif
-  elseif (!ischar (name))
+  elseif (! ischar (name))
     error ("Octave:invalid-input-arg",
-                                "print_usage: input argument must be a string");
+           "print_usage: input argument must be a string");
   else
     fullname = name;
   endif
 
-  ## Determine if we're called from top level.
+  ## Determine if we were called from top level.
   at_toplev = length (x) < 2 || (length (x) == 2 && strcmp (x(2).name, name));
 
   ## Do the actual work
@@ -74,7 +74,8 @@
   endif
 
   if (at_toplev)
-    error ("Octave:invalid-fun-call", "Invalid call to %s.  Correct usage is:\n\n%s\n%s",
+    error ("Octave:invalid-fun-call",
+           "Invalid call to %s.  Correct usage is:\n\n%s\n%s",
            name, usage_string, __additional_help_message__ ());
   else
     msg = sprintf ("Invalid call to %s.  Correct usage is:\n\n%s",
@@ -102,25 +103,23 @@
   ## concatenated with the following line.
   help_text = strrep (help_text, "@\n", " ");
 
-  ## Find, and keep, lines that start with @def or @end def. This should include things
-  ## such as @deftypefn, @deftypefnx, @defvar, etc. and their corresponding @end's
+  ## Find, and keep, lines that start with @def or @end def. This should
+  ## include things such as @deftypefn, @deftypefnx, @defvar, etc. and their
+  ## corresponding @end's.
   def_idx = strfind (help_text, "@def");
-  if (!isempty (def_idx))
-    buffer = "";
+  if (! isempty (def_idx))
+    endf_idx = strfind (help_text, "@end def");
+    def_idx = sort ([def_idx, endf_idx]);
     endl_idx = find (help_text == "\n");
+    buffer = "";
     for k = 1:length (def_idx)
-      endl = endl_idx (find (endl_idx > def_idx (k), 1));
+      endl = endl_idx (find (endl_idx > def_idx(k), 1));
       if (isempty (endl))
-        buffer = strcat (buffer, help_text (def_idx (k):end), "\n");
+        buffer = strcat (buffer, help_text (def_idx(k):end), "\n");
       else
-        buffer = strcat (buffer, help_text (def_idx (k):endl));
+        buffer = strcat (buffer, help_text (def_idx(k):endl));
       endif
     endfor
-
-    end_def_idx = strfind (help_text, "@end def");
-    if (!isempty (end_def_idx))
-      buffer = strcat (buffer, help_text (end_def_idx:end));
-    endif
   else
     [retval, status] = get_usage_plain_text (help_text, max_len);
   endif
--- a/scripts/image/colormap.m
+++ b/scripts/image/colormap.m
@@ -24,8 +24,11 @@
 ## @deftypefnx {Function File} {@var{cmap} =} colormap ("list")
 ## @deftypefnx {Function File} {@var{cmap} =} colormap ("register", "@var{name}")
 ## @deftypefnx {Function File} {@var{cmap} =} colormap ("unregister", "@var{name}")
+## @deftypefnx {Command} {} colormap @var{map_name}
 ## Query or set the current colormap.
 ##
+## With no input arguments, @code{colormap} returns the current color map.
+##
 ## @code{colormap (@var{map})} sets the current colormap to @var{map}.  The
 ## colormap should be an @var{n} row by 3 column matrix.  The columns
 ## contain red, green, and blue intensities respectively.  All entries
@@ -34,11 +37,14 @@
 ## @code{colormap ("default")} restores the default colormap (the
 ## @code{jet} map with 64 entries).  The default colormap is returned.
 ##
-## @code{colormap ("list")} returns a cell array with all the available
-## colormaps.  The options `register' and `unregister' will add or remove the
-## colormap @var{name} to it.
+## @code{colormap ("list")} returns a cell array with all of the available
+## colormaps.  The options "register" and "unregister" will add or remove
+## the colormap @var{name} from this list.
 ##
-## With no arguments, @code{colormap} returns the current color map.
+## For convenience, it is also possible to use this function with the
+## command form, where @var{map_name} must be the name of a function
+## that returns a colormap.
+##
 ## @seealso{jet}
 ## @end deftypefn
 
@@ -80,7 +86,7 @@
     endif
 
   elseif (nargin == 2)
-    if (! ischar (map) || all (! strcmp (map, {"register", "unregister"})))
+    if (! ischar (map) || ! any (strcmp (map, {"register", "unregister"})))
       print_usage ();
     elseif (! ischar (name))
       error ("colormap: to register/unregister a colormap, NAME must be a string");
@@ -99,4 +105,58 @@
 endfunction
 
 
-%% FIXME: Need some demos/tests
+%!demo
+%! ## Create an image for displaying a colormap
+%! image (1:64, linspace (0, 1, 64), repmat ((1:64)', 1, 64));
+%! axis ([1, 64, 0, 1], "ticy", "xy");
+%! ## Show 'jet' colormap
+%! colormap (jet (64));
+%! title "colormap (jet (64))"
+%! disp ("Press a key to continue");
+%! pause ();
+%! ## Show 'colorcube' colormap
+%! colormap (colorcube (64));
+%! title "colormap (colorcube (64))"
+
+%!test
+%! figure ("visible", "off");
+%! cmaptst = [0 1 0; 1 0 1; 1 1 1];
+%! cmap = colormap (cmaptst);
+%! assert (cmap, cmaptst);
+%! cmap = colormap ();
+%! assert (cmap, cmaptst);
+%! cmap = (get (gcf, "colormap"));
+%! assert (cmap, cmaptst);
+%! colormap ("default");
+%! assert (colormap (), jet (64));
+%! colormap ("ocean");
+%! assert (colormap, ocean (64));
+%! close ();  # done with temp. figure
+
+%!test
+%! cmaplst = colormap ("list");
+%! assert (iscell (cmaplst));
+%! colormap ("register", "__mycmap__"); 
+%! cmaplst2 = colormap ("list");
+%! assert (numel (cmaplst2), numel (cmaplst) + 1);
+%! assert (any (strcmp (cmaplst2, "__mycmap__")));
+%! colormap ("unregister", "__mycmap__"); 
+%! cmaplst2 = colormap ("list");
+%! assert (numel (cmaplst2), numel (cmaplst));
+%! assert (! any (strcmp (cmaplst2, "__mycmap__")));
+%! ## Unregister again and verify that nothing has happened
+%! colormap ("unregister", "__mycmap__"); 
+%! cmaplst3 = colormap ("list");
+%! assert (isequal (cmaplst2, cmaplst3));
+
+## Test input validation
+%!error colormap (1,2,3)
+%!error <MAP must be a real-valued N x 3> colormap ({1,2,3})
+%!error <MAP must be a real-valued N x 3> colormap ([1 i 1])
+%!error <MAP must be a real-valued N x 3> colormap (ones(3,3,3))
+%!error <MAP must be a real-valued N x 3> colormap ([1 0 1 0])
+%!error <all MAP values must be in the range> colormap ([-1 0 0])
+%!error <all MAP values must be in the range> colormap ([2 0 0])
+%!error colormap ("invalid", "name")
+%!error <NAME must be a string> colormap ("register", 1)
+
--- a/scripts/image/image.m
+++ b/scripts/image/image.m
@@ -53,7 +53,11 @@
 
 function h = image (varargin)
 
-  [ax, varargin, nargin] = __plt_get_axis_arg__ ("image", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("image", varargin{:});
+  
+  if (isempty (hax))
+    hax = gca ();
+  endif
 
   chararg = find (cellfun ("isclass", varargin, "char"), 1, "first");
   
@@ -71,15 +75,9 @@
     img = varargin{3};
     chararg = 4;
   endif
-
-  oldax = gca ();
-  unwind_protect
-    axes (ax);
-    htmp = __img__ (x, y, img, varargin{chararg:end});
-    set (ax, "layer", "top");
-  unwind_protect_cleanup
-    axes (oldax);
-  end_unwind_protect
+  
+  htmp = __img__ (hax, x, y, img, varargin{chararg:end});
+  set (hax, "layer", "top");
 
   if (nargout > 0)
     h = htmp;
@@ -97,9 +95,7 @@
 ## Created: July 1994
 ## Adapted-By: jwe
 
-function h = __img__ (x, y, img, varargin)
-  
-  newplot ();
+function h = __img__ (hax, x, y, img, varargin)
 
   if (isempty (img))
     error ("__img__: matrix is empty");
@@ -136,9 +132,7 @@
     endif
   endif
 
-  ca = gca ();
-
-  htmp = __go_image__ (ca, "cdata", img, "xdata", xdata, "ydata", ydata,
+  htmp = __go_image__ (hax, "cdata", img, "xdata", xdata, "ydata", ydata,
                        "cdatamapping", "direct", varargin {:});
 
   px = __image_pixel_size__ (htmp);
@@ -162,22 +156,22 @@
   ## explicitly setting the values here.  But then what information is
   ## available to axes::update_axis_limits to determine that the
   ## adjustment is necessary?
-  set (ca, "xlim", xlim, "ylim", ylim);
+  set (hax, "xlim", xlim, "ylim", ylim);
 
   if (ndims (img) == 3)
     if (isinteger (img))
       cls = class (img);
       mn = intmin (cls);
       mx = intmax (cls);
-      set (ca, "clim", double ([mn, mx]));
+      set (hax, "clim", double ([mn, mx]));
     endif
   endif
 
-  set (ca, "view", [0, 90]);
+  set (hax, "view", [0, 90]);
 
-  if (strcmp (get (ca, "nextplot"), "replace"))
+  if (strcmp (get (hax, "nextplot"), "replace"))
     # Always reverse y-axis for images, unless hold is on
-    set (ca, "ydir", "reverse");
+    set (hax, "ydir", "reverse");
   endif
 
   if (nargout > 0)
--- a/scripts/image/imfinfo.m
+++ b/scripts/image/imfinfo.m
@@ -1,4 +1,4 @@
-## Copyright (C) 2008-2012 Soren Hauberg <hauberg@gmail.com>
+## Copyright (C) 2008-2012 Soren Hauberg
 ##
 ## This file is part of Octave.
 ##
@@ -18,12 +18,16 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {@var{info} =} imfinfo (@var{filename})
+## @deftypefnx {Function File} {@var{info} =} imfinfo (@var{filename}, @var{ext})
 ## @deftypefnx {Function File} {@var{info} =} imfinfo (@var{url})
 ## Read image information from a file.
 ##
 ## @code{imfinfo} returns a structure containing information about the image
-## stored in the file @var{filename}.  The output structure contains the
-## following fields.
+## stored in the file @var{filename}.  If there is no file @var{filename},
+## and @var{ext} was specified, it will look for a file named @var{filename}
+## and extension @var{ext}, i.e., a file named @var{filename}.@var{ext}.
+##
+## The output structure @var{info} contains the following fields:
 ##
 ## @table @samp
 ## @item Filename
@@ -103,53 +107,18 @@
 ## FlashPix viewing parameters.
 ## @end table
 ##
-## @seealso{imread, imwrite, imshow}
+## @seealso{imread, imwrite, imshow, imformats}
 ## @end deftypefn
 
-function info = imfinfo (filename)
-
-  if (nargin < 1)
-    print_usage ();
-  endif
-
-  if (! ischar (filename))
-    error ("imfinfo: FILENAME must be a string");
-  endif
-
-  filename = tilde_expand (filename);
-
-  delete_file = false;
-
-  unwind_protect
-
-    fn = file_in_path (IMAGE_PATH, filename);
-
-    if (isempty (fn))
-
-      ## Couldn't find file. See if it's an URL.
-
-      tmp = tmpnam ();
+## Author: Soren Hauberg <hauberg@gmail.com>
 
-      [fn, status, msg] = urlwrite (filename, tmp);
-
-      if (! status)
-        error ("imfinfo: cannot find %s", filename);
-      endif
-
-      if (! isempty (fn))
-        delete_file = true;
-      endif
-
-    endif
-
-    info = __magick_finfo__ (fn);
-
-  unwind_protect_cleanup
-
-    if (delete_file)
-      unlink (fn);
-    endif
-
-  end_unwind_protect
-
+function info = imfinfo (varargin)
+  if (nargin < 1 || nargin > 2)
+    print_usage ();
+  elseif (! ischar (varargin{1}))
+    error ("imfinfo: FILENAME must be a string");
+  elseif (nargin > 1 && ! ischar (varargin{2}))
+    error ("imfinfo: EXT must be a string");
+  endif
+  info = imageIO (@__imfinfo__, "info", varargin, varargin{:});
 endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/image/imformats.m
@@ -0,0 +1,321 @@
+## Copyright (C) 2013 Carnë Draug
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn  {Function File} {} imformats ()
+## @deftypefnx {Function File} {@var{formats} =} imformats (@var{ext})
+## @deftypefnx {Function File} {@var{formats} =} imformats (@var{format})
+## @deftypefnx {Function File} {@var{formats} =} imformats ("add", @var{format})
+## @deftypefnx {Function File} {@var{formats} =} imformats ("remove", @var{ext})
+## @deftypefnx {Function File} {@var{formats} =} imformats ("update", @var{ext}, @var{format})
+## @deftypefnx {Function File} {@var{formats} =} imformats ("factory")
+## Manage supported image formats.
+##
+## @var{formats} is a structure with information about each supported file
+## format, or from a specific format @var{ext}, the value displayed on the
+## field @code{ext}.  It contains the following fields:
+##
+## @table @asis
+## @item ext
+## The name of the file format.  This may match the file extension but Octave
+## will automatically detect the file format.
+## @item description
+## A long description of the file format.
+## @item @nospell{isa}
+## A function handle to confirm if a file is of the specified format.
+## @item write
+## A function handle to write if a file is of the specified format.
+## @item read
+## A function handle to open files the specified format.
+## @item info
+## A function handle to obtain image information of the specified format.
+## @item alpha
+## Logical value if format supports alpha channel (transparency or matte).
+## @item multipage
+## Logical value if format supports multipage (multiple images per file).
+## @end table
+##
+## It is possible to change the way Octave manages file formats with the options
+## @code{"add"}, @code{"remove"}, and @code{"update"}, and supplying a
+## structure @var{format} with the required fields.  The option
+## @code{"factory"} resets the configuration to the default.
+##
+## This can be used by Octave packages to extend the image reading capabilities
+## Octave, through use of the PKG_ADD and PKG_DEL commands.
+##
+## @seealso{imfinfo, imread, imwrite}
+## @end deftypefn
+
+## Author: Carnë Draug <carandraug@octave.org>
+
+function varargout = imformats (arg1, arg2, arg3)
+  if (nargin > 3)
+    print_usage ();
+  endif
+
+  persistent formats = default_formats ();
+
+  if (nargin == 0 && nargout == 0)
+    error ("imformats: pretty print not yet implemented.");
+  elseif (nargin >= 1)
+    if (isstruct (arg1))
+      arrayfun (@is_valid_format, arg1);
+      ## FIXME: what is the return value in this situation?
+      formats = arg1;
+
+    elseif (ischar (arg1))
+      switch (tolower (arg1))
+        case "add",
+          if (! isstruct (arg2))
+            error ("imformats: FORMAT to %s must be a structure.", arg1);
+          endif
+          arrayfun (@is_valid_format, arg2);
+          formats(end + 1: end + numel (arg2)) = arg2;
+          varargout{1} = formats;
+
+        case {"remove", "update"},
+          if (! ischar (arg2))
+            error ("imformats: EXT to %s must be a string.", arg1);
+          endif
+          ## FIXME: suppose a format with multiple extensions. If one of
+          ##        them is requested to be removed, should we remove the
+          ##        whole format, or just that extension from the format?
+          match = find_ext_idx (formats, arg2);
+          if (! any (match))
+            error ("imformats: no EXT `%s' found.", arg2);
+          endif
+          if (strcmpi (arg1, "remove"))
+            formats(match) = [];
+          else
+            ## then it's update
+            if (! isstruct (arg3))
+              error ("imformats: FORMAT to update must be a structure.");
+            endif
+            is_valid_format (arg3);
+            formats(match) = arg3;
+          endif
+          varargout{1} = formats;
+
+        case "factory",
+          formats = default_formats ();
+        otherwise
+          ## then we look for a format with that extension.
+          match = find_ext_idx (formats, arg1);
+          ## For matlab compatibility, if we don't find any format we must
+          ## return an empty struct with NO fields. We can't use match as mask
+          if (any (match))
+            varargout{1} = formats(match);
+          else
+            varargout{1} = struct ();
+          endif
+      endswitch
+    else
+      error ("imformats: first argument must be either a structure or string.");
+    endif
+  else
+    varargout{1} = formats;
+  endif
+endfunction
+
+function formats = default_formats ()
+
+  ## The available formats are dependent on what the user has installed at
+  ## a given time, and how GraphicsMagick was built. Checking for
+  ## GraphicsMagick features when building Octave is not enough since it
+  ## delegates some of them to external programs which can be removed or
+  ## installed at any time.
+  ## The recommended method would be to use CoderInfoList() to get a list of
+  ## all available coders and try to write and read back a small test image.
+  ## But this will not work since some coders are readable or writable only.
+  ## It will still fail if we test only the ones marked as readable and
+  ## writable because some RW coders are not of image formats (NULL, 8BIM,
+  ## or EXIF for example).
+  ## So we'd need a blacklist (unacceptable because a `bad' coder may be
+  ## added later) or a whitelist. A whitelist means that even with a
+  ## super-fancy recent build of GraphicsMagick, some formats won't be listed
+  ## by imformats but in truth, we will still be able to read and write them
+  ## since imread() and imwrite() will give it a try anyway.
+  ##
+  ## For more info and comments from the GraphicsMagick main developer, see
+  ## http://sourceforge.net/mailarchive/forum.php?thread_name=alpine.GSO.2.01.1304301916050.2267%40freddy.simplesystems.org&forum_name=graphicsmagick-help
+
+  persistent formats = struct ( "coder", {},
+                                "ext", {},
+                                "isa", {},
+                                "info", {},
+                                "read", {},
+                                "write", {},
+                                "alpha", {},
+                                "description", {},
+                                "multipage", {});
+
+  ## Image IO abilities won't change during the same Octave session,
+  ## there's no need to go and calculate it all over again if we are
+  ## requested to reset back to factory.
+  if (! isempty (formats))
+    return
+  endif
+
+  ##      Building the formats info
+  ##
+  ## As mentioned above we start with a whitelist of coders. Since the
+  ## GraphicsMagick build may be missing some coders, we will remove those
+  ## from the list. Some info can be obtained directly from GraphicsMagick
+  ## through the CoderInfo object. However, some will need to be hardcoded.
+  ##
+  ## The association between file extensions and coders needs to be done
+  ## with a manually coded list (file extensions do not define the image
+  ## format and GraphicsMagick will not be fooled by changing the extension).
+  ##
+  ## We can get the read, write, description and multipage fields from
+  ## CoderInfo in C++. We should do the same for alpha (GraphicsMagick
+  ## calls it matte) but it's not available from CoderInfo. The only way to
+  ## check it is to create a sample image with each coder, then try to read
+  ## it back with GraphicsMagick and use the matte method on the Image class.
+  ## But making such test for each Octave session... meh! While technically
+  ## it may be possible that the same coder has different support for alpha
+  ## channel in different versions and builds, this doesn't seem to happen.
+  ## So we also hardcode those. In the future, maybe the CoderInfo class will
+  ## have a matte method like it does for multipage.
+  ##
+  ## Other notes: some formats have more than one coder that do the same. For
+  ## example, for jpeg images there is both the JPG and JPEG coders. However,
+  ## it seems that when reading images, GraphicsMagick only uses one of them
+  ## and that's the one we list (it's the one reported by imfinfo and that we
+  ## can use for isa). However, in some cases GraphicsMagick seems to rely
+  ## uniquely on the file extension ((JBIG and JBG at least. Create an image
+  ## with each of those coders, swap their extension and it will report the
+  ## other coder). We don't have such cases on the whitelist but if we did, we
+  ## would need two entries for such cases.
+
+  ## each row: 1st => Coder, 2nd=> file extensions, 3rd=> alpha
+  coders = {"BMP",  {"bmp"},          true;
+            "CUR",  {"cur"},          false;
+            "GIF",  {"gif"},          true;
+            "ICO",  {"ico"},          true;
+            "JBG",  {"jbg"},          false;
+            "JBIG", {"jbig"},         false;
+            "JP2",  {"jp2", "jpx"},   true;
+            "JPEG", {"jpg", "jpeg"},  false; # there is also a JPG coder
+            "PBM",  {"pbm"},          false;
+            "PCX",  {"pcx"},          true;
+            "PGM",  {"pgm"},          false;
+            "PGM",  {"pgm"},          false;
+            "PNG",  {"png"},          true;
+            ## PNM is a family of formats supporting portable bitmaps (PBM),
+            ## graymaps (PGM), and pixmaps (PPM). There is no file format
+            ## associated with pnm itself. If PNM is used as the output format
+            ## specifier, then GraphicsMagick automatically selects the most
+            ## appropriate format to represent the image.
+            "PNM",  {"pnm"},          true;
+            "PPM",  {"ppm"},          false;
+            "SUN",  {"ras"},          true; # SUN Rasterfile
+            "TGA",  {"tga", "tpic"},  true;
+            "TIFF", {"tif", "tiff"},  true;
+            "XBM",  {"xbm"},          false;
+            "XPM",  {"xpm"},          true;
+            "XWD",  {"xwd"},          false;
+            };
+
+  for fidx = 1: rows(coders)
+    formats(fidx).coder = coders{fidx, 1};
+    formats(fidx).ext   = coders{fidx, 2};
+    formats(fidx).alpha = coders{fidx, 3};
+    ## default isa is to check if the format returned by imfinfo is the coder
+    formats(fidx).isa   = @(x) isa_magick (coders{fidx,1}, x);
+  endfor
+
+  ## the default info, read, and write functions
+  [formats.info ] = deal (@__imfinfo__);
+  [formats.read ] = deal (@__imread__);
+  [formats.write] = deal (@__imwrite__);
+
+  ## fills rest of format information by checking with GraphicsMagick
+  formats = __magick_formats__ (formats);
+endfunction
+
+function is_valid_format (format)
+  ## the minimal list of fields required in the structure. We don't
+  ## require multipage because it doesn't exist in matlab
+  min_fields  = {"ext", "read", "isa", "write", "info", "alpha", "description"};
+  fields_mask = cellfun (@(x) isfield (format, x), min_fields);
+  if (! all (fields_mask))
+    error ("imformats: structure has missing field `%s'.", min_fields(! fields_mask){1});
+  endif
+endfunction
+
+function match = find_ext_idx (formats, ext)
+  ## FIXME: is matlab sensitive to file extensions?
+  ## XXX: what should we do if there's more than one hit?
+  ##      Should this function prevent the addition of
+  ##      duplicated extensions?
+  match = cellfun (@(x) any (strcmp (x, ext)), {formats.ext});
+endfunction
+
+function bool = isa_magick (coder, filename)
+  bool = false;
+  try
+    info = __imfinfo__ (filename);
+    bool = strcmp (coder, info.Format);
+  end_try_catch
+endfunction
+
+## changing the function to read
+%!testif HAVE_MAGICK
+%! fmt = imformats ("jpg");
+%! fmt.read = @(x) size (x, 2);
+%! imformats ("update", "jpg", fmt);
+%! assert (imread ("this is 30 characters long.jpg"), 30);
+
+## adding a new format
+%!testif HAVE_MAGICK
+%! fmt = imformats ("jpg");
+%! fmt.ext = "junk";
+%! fmt.read = @(x) true();
+%! imformats ("add", fmt);
+%! assert (imread ("some file.junk"), true);
+
+## adding multiple formats in one way
+%!testif HAVE_MAGICK
+%! fmt = imformats ("jpg");
+%! fmt.ext = "junk1";
+%! fmt.read = @(x) true();
+%! fmt(2) = fmt(1);
+%! fmt(2).ext = "junk2";
+%! imformats ("add", fmt);
+%! assert (imread ("some file.junk1"), true);
+%! assert (imread ("some file.junk2"), true);
+
+## changing format
+%!testif HAVE_MAGICK
+%! ori_fmt = mod_fmt = imformats ("jpg");
+%! mod_fmt.description = "Another description";
+%! imformats ("update", "jpg", mod_fmt);
+%! new_fmt = imformats ("jpg");
+%! assert (new_fmt.description, mod_fmt.description);
+%! imformats ("factory");
+%! new_fmt = imformats ("jpg");
+%! assert (new_fmt.description, ori_fmt.description);
+
+## FIXME: how to test for error together with testif?
+## update to an invalid format
+#%!testif HAVE_MAGICK
+#%! fmt = imformats ("jpg");
+#%! fmt = rmfield (fmt, "read");
+#%! error imformats ("update", "jpg", fmt);
+
--- a/scripts/image/imread.m
+++ b/scripts/image/imread.m
@@ -1,7 +1,8 @@
-## Copyright (C) 2008-2012 Thomas L. Scofield <scofield@calvin.edu>
-## Copyright (C) 2008 Kristian Rumberg <kristianrumberg@gmail.com>
-## Copyright (C) 2006 Thomas Weber <thomas.weber.mail@gmail.com>
-## Copyright (C) 2005 Stefan van der Walt <stefan@sun.ac.za>
+## Copyright (C) 2013 Carnë Draug
+## Copyright (C) 2008-2012 Thomas L. Scofield
+## Copyright (C) 2008 Kristian Rumberg
+## Copyright (C) 2006 Thomas Weber
+## Copyright (C) 2005 Stefan van der Walt
 ## Copyright (C) 2002 Andy Adler
 ##
 ## This file is part of Octave.
@@ -21,75 +22,80 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{img}, @var{map}, @var{alpha}] =} imread (@var{filename})
+## @deftypefn  {Function File} {[@var{img}, @var{map}, @var{alpha}] =} imread (@var{filename})
+## @deftypefnx {Function File} {[@dots{}] =} imread (@var{filename}, @var{ext})
+## @deftypefnx {Function File} {[@dots{}] =} imread (@var{url})
+## @deftypefnx {Function File} {[@dots{}] =} imread (@dots{}, @var{idx})
+## @deftypefnx {Function File} {[@dots{}] =} imread (@dots{}, @var{param1}, @var{val1}, @dots{})
 ## Read images from various file formats.
 ##
-## The size and numeric class of the output depends on the
+## Reads an image as a matrix from the file @var{filename}.  If there is
+## no file @var{filename}, and @var{ext} was specified, it will look for
+## a file named @var{filename} and extension @var{ext}, i.e., a file named
+## @var{filename}.@var{ext}.
+##
+## The size and class of the output depends on the
 ## format of the image.  A color image is returned as an
 ## @nospell{MxNx3} matrix.  Gray-level and black-and-white images are
-## of size @nospell{MxN}.
-## The color depth of the image determines the numeric
+## of size @nospell{MxN}.  Multipage images will have an additional 4th
+## dimension.
+## The bit depth of the image determines the
 ## class of the output: "uint8" or "uint16" for gray
 ## and color, and "logical" for black and white.
+## Note that indexed images always return the indexes for a colormap,
+## independent if @var{map} is a requested output.  To obtain the actual
+## RGB image, use @code{ind2rgb}.
+## See the Octave manual for more information in representing images.
 ##
-## @seealso{imwrite, imfinfo}
+## Some file formats, such as TIFF and GIF, are able to store multiple
+## images in a single file.  @var{idx} can be a scalar or vector
+## specifying the index of the images to read.  By default, Octave
+## will only read the first page.
+##
+## Depending on the file format, it is possible to configure the reading
+## of images with @var{param}, @var{val} pairs.  The following options
+## are supported:
+##
+## @table @samp
+## @item "Frames" or "Index"
+## This is an alternative method to specify @var{idx}.  When specifying it
+## in this way, its value can also be the string "all".
+##
+## @item "Info"
+## This option exists for @sc{Matlab} compatibility and has no effect.  For
+## maximum performance while reading multiple images from a single file,
+## use the Index option.
+## @end table
+##
+## @seealso{imwrite, imfinfo, imformats}
 ## @end deftypefn
 
-function varargout = imread (filename, varargin)
+## Author: Carnë Draug <carandraug@octave.org>
+## Author: Thomas L. Scofield <scofield@calvin.edu>
+## Author: Kristian Rumberg <kristianrumberg@gmail.com>
+## Author: Thomas Weber <thomas.weber.mail@gmail.com>
+## Author: Stefan van der Walt <stefan@sun.ac.za>
+## Author: Andy Adler
 
+function varargout = imread (varargin)
   if (nargin < 1)
     print_usage ();
-  endif
-
-  if (! ischar (filename))
+  elseif (! ischar (varargin{1}))
     error ("imread: FILENAME must be a string");
   endif
-
-  filename = tilde_expand (filename);
-
-  fn = file_in_path (IMAGE_PATH, filename);
-
-  if (isempty (fn))
-    error ("imread: cannot find %s", filename);
+  ## In case the file format was specified as a separate argument we
+  ## do this. imageIO() will ignore the second part if filename on its
+  ## own is enough. And if the second argument was a parameter name instead
+  ## of an extension, it is still going to be passed to the next function
+  ## since we are passing the whole function input as well.
+  filename = {varargin{1}};
+  if (nargin > 1 && ischar (varargin {2}))
+    filename{2} = varargin{2};
   endif
 
-  try
-    [varargout{1:nargout}] = __magick_read__ (fn, varargin{:});
-  catch
-
-    magick_error = lasterr ();
-
-    img_field = false;
-    x_field = false;
-    map_field = false;
-
-    try
-      vars = load (fn);
-      if (isstruct (vars))
-        img_field = isfield (vars, "img");
-        x_field = isfield (vars, "X");
-        map_field = isfield (vars, "map");
-      endif
-    catch
-      error ("imread: invalid image file: %s", magick_error);
-    end_try_catch
-
-    if (map_field && (img_field || x_field))
-      varargout{2} = vars.map;
-      if (img_field)
-        varargout{1} = vars.img;
-      else
-        varargout{1} = vars.X;
-      endif
-    else
-      error ("imread: invalid Octave image file format");
-    endif
-
-  end_try_catch
-
+  [varargout{1:nargout}] = imageIO (@__imread__, "read", filename, varargin{:});
 endfunction
 
-
 %!testif HAVE_MAGICK
 %! vpng = [ ...
 %!  137,  80,  78,  71,  13,  10,  26,  10,   0,   0, ...
@@ -108,11 +114,15 @@
 %!   16,  28, 160,  16,   0, 197, 214,  13,  34,  74, ...
 %!  117, 213,  17,   0,   0,   0,   0,  73,  69,  78, ...
 %!   68, 174,  66,  96, 130];
-%! fid = fopen ("test.png", "wb");
-%! fwrite (fid, vpng);
-%! fclose (fid);
-%! A = imread ("test.png");
-%! delete ("test.png");
+%! filename = [tmpnam() ".png"];
+%! unwind_protect
+%!   fid = fopen (filename, "wb");
+%!   fwrite (fid, vpng);
+%!   fclose (fid);
+%!   A = imread (filename);
+%! unwind_protect_cleanup
+%!   unlink (filename);
+%! end_unwind_protect
 %! assert (A(:,:,1), uint8 ([0, 255, 0; 255, 237, 255; 0, 255, 0]));
 %! assert (A(:,:,2), uint8 ([0, 255, 0; 255,  28, 255; 0, 255, 0]));
 %! assert (A(:,:,3), uint8 ([0, 255, 0; 255,  36, 255; 0, 255, 0]));
--- a/scripts/image/imwrite.m
+++ b/scripts/image/imwrite.m
@@ -1,4 +1,5 @@
 ## Copyright (C) 2008-2012 John W. Eaton
+## Copyright (C) 2013 Carnë Draug
 ##
 ## This file is part of Octave.
 ##
@@ -18,171 +19,72 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} imwrite (@var{img}, @var{filename})
-## @deftypefnx {Function File} {} imwrite (@var{img}, @var{filename}, @var{fmt})
-## @deftypefnx {Function File} {} imwrite (@var{img}, @var{filename}, @var{fmt}, @var{p1}, @var{v1}, @dots{})
-## @deftypefnx {Function File} {} imwrite (@var{img}, @var{map}, @var{filename}, @dots{})
+## @deftypefnx {Function File} {} imwrite (@var{img}, @var{filename}, @var{ext})
+## @deftypefnx {Function File} {} imwrite (@var{img}, @var{map}, @var{filename})
+## @deftypefnx {Function File} {} imwrite (@dots{}, @var{param1}, @var{val1}, @dots{})
 ## Write images in various file formats.
 ##
-## If @var{fmt} is not supplied, the file extension of @var{filename} is used
-## to determine the format.
+## The image @var{img} can be a binary, grayscale, RGB, or multidimensional
+## image.  The size and class of @var{img} should be the same as what should
+## be expected when reading it with @code{imread}: the 3rd and 4th dimensions
+## reserved for colorspace, and multiple pages respectively.  If it's an
+## indexed image, the colormap @var{map} must also be specified.
 ##
-## The parameter-value pairs (@var{p1}, @var{v1}, @dots{}) are optional.
-## Currently the following options are supported for @t{JPEG} images:
+## If @var{ext} is not supplied, the file extension of @var{filename} is used
+## to determine the format.  The actual supported formats are dependent on
+## options made during the build of Octave.  Use @code{imformats} to check
+## the support of the different image formats.
+##
+## Depending on the file format, it is possible to configure the writing
+## of images with @var{param}, @var{val} pairs.  The following options
+## are supported:
 ##
 ## @table @samp
 ## @item Quality
 ## Set the quality of the compression.  The value should be an
 ## integer between 0 and 100, with larger values indicating higher visual
-## quality and lower compression.
+## quality and lower compression. Defaults to 75.
+##
+## @item WriteMode
+## Some file formats, such as TIFF and GIF, are able to store multiple
+## images in a single file.  This option specifies if @var{img} should be
+## appended to the file (if it exists) or if a new file should be created
+## for it (possibly overwriting an existing file).  The value should be
+## the string "Overwrite" (default), or "Append".
+##
+## Despite this option, the most efficient method of writing a multipage
+## image is to pass a 4 dimensional @var{img} to @code{imwrite}, the
+## same matrix that could be expected when using @code{imread} with the
+## option "Index" set to "all".
+##
 ## @end table
 ##
-## @strong{Supported Formats}
-## @multitable @columnfractions .33 .66
-## @headitem Extension @tab Format
-## @item bmp @tab Windows Bitmap
-## @item gif @tab Graphics Interchange Format
-## @item jpg and jpeg @tab Joint Photographic Experts Group
-## @item pbm @tab Portable Bitmap
-## @item pcx @tab
-## @item pgm @tab Portable Graymap
-## @item png @tab Portable Network Graphics
-## @item pnm @tab Portable Anymap
-## @item ppm @tab Portable Pixmap
-## @item ras @tab Sun Raster
-## @item tif and tiff @tab Tagged Image File Format
-## @item xwd @tab X11 Dump
-## @end multitable
-##
-## @strong{Unsupported Formats}
-## @multitable @columnfractions .33 .66
-## @headitem Extension @tab Format
-## @item hdf @tab Hierarchical Data Format V4
-## @item @nospell{jp2} and jpx @tab Joint Photographic Experts Group 2000
-## @end multitable
-##
-## @seealso{imread, imfinfo}
+## @seealso{imread, imfinfo, imformats}
 ## @end deftypefn
 
-function imwrite (img, varargin)
-
-  persistent imwrite_possible_formats = {
-    "bmp"; "gif"; "jp2"; "jpg"; "jpx"; "jpeg"; "hdf"; "pbm"; "pcx";
-    "pgm"; "png"; "pnm"; "ppm"; "ras"; "tif"; "tiff"; "xwd" };
-
-  persistent accepted_formats = __magick_format_list__ (imwrite_possible_formats);
-
-  if (nargin < 2 || ! (isnumeric (img) || islogical (img)))
-    print_usage ();
-  endif
-
-  map = [];
-  fmt = "";
-
-  offset = 1;
-  if (isnumeric (varargin{1}))
-    map = varargin{1};
-    if (isempty (map))
-      error ("imwrite: colormap must not be empty");
-    endif
-    offset = 2;
-  endif
-  if (offset <= length (varargin) && ischar (varargin{offset}))
-    filename = varargin{offset};
-    offset++;
-    if (rem (length (varargin) - offset, 2) == 0 && ischar (varargin{offset}))
-      fmt = varargin{offset};
-      offset++;
-    endif
-  else
+function imwrite (varargin)
+  if (nargin < 2)
     print_usage ();
   endif
-  if (offset < length (varargin))
-    has_param_list = 1;
-    for ii = offset:2:(length (varargin) - 1)
-      options.(varargin{ii}) = varargin{ii + 1};
-    endfor
-  else
-    has_param_list = 0;
-  endif
-
-  filename = tilde_expand (filename);
-
-  if (isempty (fmt))
-    [d, n, fmt] = fileparts (filename);
-    if (! isempty (fmt))
-      fmt = fmt(2:end);
-    endif
-  endif
-
-  if (isempty (img))
-    error ("imwrite: invalid empty image");
-  endif
-
-  if (issparse (img) || issparse (map))
-    error ("imwrite: sparse images not supported");
-  endif
-
-  if (! strcmp (fmt, accepted_formats))
-    error ("imwrite: %s: unsupported or invalid image format", fmt);
-  endif
-
-  img_class = class (img);
-  map_class = class (map);
-  nd = ndims (img);
+  [filename, ext] = imwrite_filename (varargin{2:end});
 
-  if (isempty (map))
-    if (any (strcmp (img_class, {"logical", "uint8", "uint16", "double"})))
-      if ((nd == 2 || nd == 3) && strcmp (img_class, "double"))
-        img = uint8 (img * 255);
-      endif
-      ## FIXME: should we handle color images with alpha channel here?
-      if (nd == 3 && size (img, 3) < 3)
-        error ("imwrite: invalid dimensions for truecolor image");
-      endif
-      if (nd > 5)
-        error ("imwrite: invalid %d-dimensional image data", nd);
-      endif
-    else
-      error ("imwrite: %s: invalid class for truecolor image", img_class);
+  fmt = imformats (ext);
+  ## When there is no match, fmt will be a 1x1 structure with
+  ## no fields, so we can't just use `isempty (fmt)'.
+  if (isempty (fieldnames (fmt)))
+    if (isempty (ext))
+      error ("imwrite: no extension found for %s to identify the image format",
+             filename);
     endif
-    if (has_param_list)
-      __magick_write__ (filename, fmt, img, options);
-    else
-      __magick_write__ (filename, fmt, img);
-    endif
+    warning ("imwrite: unlisted image format %s (see imformats). Trying to save anyway.",
+             ext);
+    __imwrite__ (varargin{:});
   else
-    if (any (strcmp (img_class, {"uint8", "uint16", "double"})))
-      if (strcmp (img_class, "double"))
-        img = uint8 (img - 1);
-      endif
-      if (nd != 2 && nd != 4)
-        error ("imwrite: invalid size for indexed image");
-      endif
-    else
-      error ("imwrite: %s: invalid class for indexed image data", img_class);
-    endif
-    if (! iscolormap (map))
-      error ("imwrite: invalid indexed image colormap");
-    endif
-
-    ## FIXME: we should really be writing indexed images here but
-    ##        __magick_write__ needs to be fixed to handle them.
-
-    [r, g, b] = ind2rgb (img, map);
-    tmp = uint8 (cat (3, r, g, b) * 255);
-
-    if (has_param_list)
-      __magick_write__ (filename, fmt, tmp, options);
-      ## __magick_write__ (filename, fmt, img, map, options);
-    else
-      __magick_write__ (filename, fmt, tmp);
-      ## __magick_write__ (filename, fmt, img, map);
-    endif
+    fmt.write (varargin{:});
   endif
 
 endfunction
 
-
 %% Test input validation
 %!error imwrite ()                            # Wrong # of args
 %!error imwrite (1)                           # Wrong # of args
--- a/scripts/image/ind2rgb.m
+++ b/scripts/image/ind2rgb.m
@@ -26,12 +26,13 @@
 ## image, pixels in @var{x} outside the range are mapped to the last color in
 ## the map.
 ##
-## The output may be a single RGB image (MxNx3 matrix where M and N are the
-## original image @var{x} dimensions, one for each of the red, green and blue
-## channels).  Alternatively, the individual red, green, and blue color matrices
-## of size MxN may be returned.
+## The output may be a single RGB image (@nospell{MxNx3} matrix where M and N
+## are the original image @var{x} dimensions, one for each of the red, green
+## and blue channels).  Alternatively, the individual red, green, and blue
+## color matrices of size @nospell{MxN} may be returned.
 ##
-## Multidimensional indexed images (of size MxNx1xK) are also supported.
+## Multi-dimensional indexed images (of size @nospell{MxNx1xK}) are also
+## supported.
 ##
 ## @seealso{rgb2ind, ind2gray, hsv2rgb, ntsc2rgb}
 ## @end deftypefn
--- a/scripts/image/module.mk
+++ b/scripts/image/module.mk
@@ -1,6 +1,11 @@
 FCN_FILE_DIRS += image
 
 image_PRIVATE_FCN_FILES = \
+  image/private/__imfinfo__.m \
+  image/private/__imread__.m \
+  image/private/__imwrite__.m \
+  image/private/imageIO.m \
+  image/private/imwrite_filename.m \
   image/private/ind2x.m
 
 image_FCN_FILES = \
@@ -25,6 +30,7 @@
   image/image.m \
   image/imagesc.m \
   image/imfinfo.m \
+  image/imformats.m \
   image/imread.m \
   image/imshow.m \
   image/imwrite.m \
new file mode 100644
--- /dev/null
+++ b/scripts/image/private/__imfinfo__.m
@@ -0,0 +1,71 @@
+## Copyright (C) 2008-2012 Soren Hauberg
+## Copyright (C) 2013 Carnë Draug
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## This function does al the work of imfinfo. It exists here as private
+## function so that imfinfo can use other functions if imformats is
+## configured to. It is also needed so that imformats can create a
+## function handle for it.
+
+## Author: Soren Hauberg <hauberg@gmail.com>
+
+function info = __imfinfo__ (filename, ext)
+
+  if (nargin < 1 || nargin > 2)
+    print_usage ("imfinfo");
+  endif
+
+  if (! ischar (filename))
+    error ("imfinfo: FILENAME must be a string");
+  elseif (nargin >= 2 && ! ischar (ext))
+    error ("imfinfo: EXT must be a string");
+  endif
+  filename = tilde_expand (filename);
+
+  delete_file = false;
+  unwind_protect
+
+    fn = file_in_path (IMAGE_PATH, filename);
+    if (isempty (fn))
+      ## We couldn't find the file so...
+      if (nargin >= 2)
+        ## try adding a possible file extesion
+        filename  = [filename "." ext];
+        fn        = file_in_path (IMAGE_PATH, filename);
+        if (isempty (fn))
+          error ("imfinfo: cannot find file %s", filename);
+        endif
+      else
+        ## try filename as an URL
+        [fn, status, msg] = urlwrite (filename, tmpnam ());
+        if (! status)
+          error ("imfinfo: cannot find or download %s: %s", filename, msg);
+        endif
+        delete_file = true;
+      endif
+    endif
+
+    info = __magick_finfo__ (fn);
+
+  unwind_protect_cleanup
+    if (delete_file)
+      unlink (fn);
+    endif
+  end_unwind_protect
+
+endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/image/private/__imread__.m
@@ -0,0 +1,185 @@
+## Copyright (C) 2013 Carnë Draug
+## Copyright (C) 2008-2012 Thomas L. Scofield
+## Copyright (C) 2008 Kristian Rumberg
+## Copyright (C) 2006 Thomas Weber
+## Copyright (C) 2005 Stefan van der Walt
+## Copyright (C) 2002 Andy Adler
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## This function does all the work of imread. It exists here as private
+## function so that imread can use other functions if imformats is
+## configured to. It is also needed so that imformats can create a
+## function handle for it.
+
+## Author: Carnë Draug <carandraug@octave.org>
+## Author: Thomas L. Scofield <scofield@calvin.edu>
+## Author: Kristian Rumberg <kristianrumberg@gmail.com>
+## Author: Thomas Weber <thomas.weber.mail@gmail.com>
+## Author: Stefan van der Walt <stefan@sun.ac.za>
+## Author: Andy Adler
+
+function varargout = __imread__ (filename, varargin)
+
+  if (nargin < 1)
+    print_usage ("imread");
+  elseif (! ischar (filename))
+    error ("imread: FILENAME must be a string");
+  endif
+
+  ## keep track of the varargin offset we're looking at each moment
+  offset    = 1;
+
+  filename  = tilde_expand (filename);
+  fn        = file_in_path (IMAGE_PATH, filename);
+  if (isempty (fn) && nargin >= offset + 1 && ischar (varargin{offset}))
+    ## if we can't find the file, check if the next input is the file extension
+    filename  = [filename "." varargin{offset}];
+    fn        = file_in_path (IMAGE_PATH, filename);
+    offset++;
+  endif
+  if (isempty (fn))
+    error ("imread: cannot find %s", filename);
+  endif
+
+  ## set default for options
+  options = struct ("index", 1);
+
+  ## Index is the only option that can be defined without the parameter/value
+  ## pair style. When defining it here, the string "all" is invalid though.
+  if (nargin >= offset + 1 && ! ischar (varargin{offset}))
+    if (! is_valid_index_option (options.index))
+      error ("imread: IDX must be a numeric vector");
+    endif
+    options.index = varargin{offset};
+    offset++;
+  endif
+
+  if (rem (numel (varargin) - offset + 1, 2) != 0)
+    error ("imread: no pair for all arguments (even number left)");
+  endif
+
+  for idx = offset:2:(numel (varargin) - offset + 1)
+
+    switch (tolower (varargin{idx}))
+
+      case {"frames", "index"},
+        options.index = varargin{idx+1};
+        if (! (is_valid_index_option (options.index)) &&
+            ! (ischar (options.index) && strcmpi (options.index, "all")))
+          error ("imread: value for %s must be a vector or the string `all'");
+        endif
+
+## FIXME: commented until it's implemented in __magick_read__
+##      case "pixelregion",
+##        options.region = varargin{idx+1};
+##        if (! iscell (options.region) || numel (options.region) != 2)
+##          error ("imread: value for %s must be a 2 element cell array",
+##                 varargin{idx});
+##        endif
+##        for reg_idx = 1:2
+##          if (numel (options.region{reg_idx}) == 3)
+##            ## do nothing
+##          elseif (numel (options.region{reg_idx}) == 2)
+##            options.region{reg_idx}(3) = options.region{reg_idx}(2);
+##            options.region{reg_idx}(2) = 1;
+##          else
+##            error ("imread: range for %s must be a 2 or 3 element vector",
+##                   varargin{idx});
+##          endif
+##          options.region{reg_idx} = floor (options.region{reg_idx}(1)): ...
+##                                    floor (options.region{reg_idx}(2)): ...
+##                                    floor (options.region{reg_idx}(3));
+##        endfor
+
+      case "info",
+        ## We ignore this option. This parameter exists in Matlab to
+        ## speed up the reading of multipage TIFF.  It makes no difference
+        ## for us since we're already quite efficient.
+
+      otherwise
+        error ("imread: invalid PARAMETER `%s'", varargin{idx});
+
+    endswitch
+  endfor
+
+  try
+    [varargout{1:nargout}] = __magick_read__ (fn, options);
+
+  catch
+    ## If we can't read it with Magick, maybe the image is in Octave's
+    ## native image format.  This is from back before Octave had 'imread'
+    ## and 'imwrite'. Then we had the functions 'loadimage' and 'saveimage'.
+    ##
+    ## This "image format" seems to be any file that can be read with
+    ## load() and contains 2 variables.  The variable named "map" is a
+    ## colormap and must exist whether the image is indexed or not. The
+    ## other variable must be named "img" or "X" for a "normal" or
+    ## indexed image.
+    ##
+    ## FIXME: this has been deprecated for the next major release (3.8 or 4.0).
+    ##        If someone wants to revive this as yet another image format, a
+    ##        separate Octave package can be written for it, that register the
+    ##        format through imformats.
+
+    magick_error = lasterr ();
+
+    img_field = false;
+    x_field   = false;
+    map_field = false;
+
+    try
+      vars = load (fn);
+      if (isstruct (vars))
+        img_field = isfield (vars, "img");
+        x_field   = isfield (vars, "X");
+        map_field = isfield (vars, "map");
+      endif
+    catch
+      error ("imread: invalid image file: %s", magick_error);
+    end_try_catch
+
+    if (map_field && (img_field || x_field))
+      varargout{2} = vars.map;
+      if (img_field)
+        varargout{1} = vars.img;
+      else
+        varargout{1} = vars.X;
+      endif
+      persistent warned = false;
+      if (! warned)
+        warning ("Octave's native image format has been deprecated.");
+        warned = true;
+      endif
+    else
+      error ("imread: invalid Octave image file format");
+    endif
+
+  end_try_catch
+
+endfunction
+
+## Tests if the value passed to the Index or Frames is valid. This option
+## can be defined in two places, but only in one place can it also be the
+## string "all"
+function bool = is_valid_index_option (arg)
+  ## is the index option
+  bool = false;
+  if (isvector (arg) && isnumeric (arg) && isreal (arg))
+    bool = true;
+  endif
+endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/image/private/__imwrite__.m
@@ -0,0 +1,105 @@
+## Copyright (C) 2008-2012 John W. Eaton
+## Copyright (C) 2013 Carnë Draug
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## This function does all the work of imwrite. It exists here as private
+## function so that imwrite can use other functions if imformats is
+## configured to. It is also needed so that imformats can create a
+## function handle for it.
+
+function __imwrite__ (img, varargin)
+
+  if (nargin < 2 || ! (isnumeric (img) || islogical (img)))
+    print_usage ("imwrite");
+  endif
+
+  [filename, ext, map, param_list] = imwrite_filename (varargin{:});
+
+  if (rem (numel (param_list), 2) != 0)
+    error ("imwrite: no pair for all arguments (even number left)");
+  endif
+
+  ## set default for options
+  options        = struct ("writemode", "overwrite",
+                           "quality",   75);
+
+  for idx = 1:2:numel (param_list)
+
+    switch (tolower (param_list{idx}))
+
+      case "writemode",
+        options.writemode = param_list{idx+1};
+        if (! ischar (options.writemode) ||
+            ! any (strcmpi (options.writemode, {"append", "overwrite"})))
+          error ("imwrite: value for %s option must be \"append\" or \"overwrite\"",
+                 param_list{idx});
+        endif
+        options.writemode = tolower (options.writemode);
+
+      case "quality",
+        options.quality = param_list{idx+1};
+        if (! isnumeric (options.quality) || ! isscalar (options.quality) ||
+            options.quality < 0 || options.quality > 100)
+          error ("imwrite: value for %s option must be a scalar between 0 and 100",
+                 param_list{idx});
+        endif
+        options.quality = round (options.quality);
+
+      otherwise
+        error ("imwrite: invalid PARAMETER `%s'", varargin{idx});
+
+    endswitch
+  endfor
+
+  if (isempty (img))
+    error ("imwrite: invalid empty image");
+  elseif (issparse (img) || issparse (map))
+    error ("imwrite: sparse images not supported");
+  endif
+
+  if (! isempty (map))
+    if (! iscolormap (map))
+      error ("imwrite: invalid MAP for indexed image");
+    elseif (ndims (img) != 2 && ndims (img) != 4)
+      error ("imwrite: indexed image must have 2 or 4 dimensions (found %i)", ndims (img));
+    endif
+    ## FIXME: we should really be writing indexed images but that needs
+    ##        to be implemented in  __magick_write__(). So we convert
+    ##        them to RGB and write them "normally".
+    warned = false;
+    if (! warned)
+      warning ("imwrite: saving of indexed images is not yet implemented. Will save a RGB image.");
+      warned = true;
+    endif
+    img = ind2rgb (img, map);
+    map = [];
+  endif
+
+  if (ndims (img) > 4)
+    error ("imwrite: invalid %d-dimensional image data", ndims (img));
+  elseif (all (size (img, 3) != [1 3]))
+    ## This test needs to be adjusted if one day we implement alternative
+    ## colorspaces. In the mean time, we only have grayscale and RGB images,
+    ## but CMYK means length 4 in the 3rd dimension.
+    error ("imwrite: IMG 3rd dimension must be 1 or 3");
+  endif
+
+  ## FIXME: do we need to convert the image class?
+  __magick_write__ (filename, ext, img, map, options);
+
+endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/image/private/imageIO.m
@@ -0,0 +1,68 @@
+## Copyright (C) 2013 Carnë Draug
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## This function simply connects imread and imfinfo() to the function
+## to be used based on their format. It does it by checking the file extension
+## of the file and redirecting to the appropriate function after checking
+## with imformats.
+##
+## First argument is a function handle for the default imageIO function (what
+## to use if the file extension for the image file is not listed by imformats).
+## Second argument is the fieldname in the struct returned by imformats with a
+## function handle for the function to use. Third argument is a cell array, its
+## first element the filename, and the second, an optional file extension to
+## add to filename, if filename alone does not exist. All the others are the
+## original input arguments passed to the original imageIO function which will
+## be passed on to the destination function.
+##
+## No input checking whatsoever is performed. That should be performed by the
+## function calling it.
+
+function varargout = imageIO (core_func, fieldname, filename, varargin)
+
+  ## It should not be this function job to check if the file exists or not.
+  ## However, we need to know the file extension to use with imformats and
+  ## that means we need to know the actual filename that will be used which
+  ## is dependent on whether a file exists.
+  ##
+  ## If a file named filename{1} exists, then that's it, we will use that
+  ## wether it has an extension or not. If it does not exist and we have
+  ## something in filename{2}, then we will consider it the file extension.
+  ## Note the detail that if we find a file using filename{1} only, then we
+  ## should completely ignore filename{2}. It won't even be used by
+  ## imformats() at all, even if filename{1} has no extension to use with
+  ## imformats().
+  if (isscalar (filename) || ! isempty (file_in_path (IMAGE_PATH, filename{1})))
+    [~, ~, ext] = fileparts (filename{1});
+    if (! isempty (ext))
+      ## remove dot from extension
+      ext = ext(2:end);
+    endif
+  else
+    ext = filename{2};
+  endif
+
+  fmt = imformats (ext);
+  ## When there is no match, fmt will be a 1x1 structure with no fields,
+  ## so we can't just use `isempty (fmt)'.
+  if (isempty (fieldnames (fmt)))
+    [varargout{1:nargout}] = core_func (varargin{:});
+  else
+    [varargout{1:nargout}] = fmt.(fieldname) (varargin{:});
+  endif
+endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/image/private/imwrite_filename.m
@@ -0,0 +1,68 @@
+## Copyright (C) 2013 Carnë Draug
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## The input check for imwrite needs to be done twice, once when imwrite
+## is called the first time to find where the filename is, and a second
+## time by __imwrite__ after imformats decides what function to use.
+## Because a user can, and is encouraged to, get a function handle to
+## __imwrite__, the input check is also done there.
+## In addition, the input check for imwrite is not that straightforward
+## in order to support the multiple ways the function can be called,
+## and interpretations of Matlab documentation.
+##
+## Anyway, this will only do the input check until it finds the filename
+## to be used, the only part that imwrite actually needs.
+
+function [filename, ext, cmap, options] = imwrite_filename (varargin)
+
+  ## First, we check if the first argument is a colormap or a filename.
+  cmap = [];
+  if (ischar (varargin{1}))
+    filename_idx = 1;
+  elseif (numel (varargin) >= 2 && iscolormap (varargin{1}) && ischar (varargin{2}))
+    filename_idx = 2;
+    cmap = varargin{1};
+  else
+    error ("imwrite: no FILENAME specified");
+  endif
+  filename = tilde_expand (varargin{filename_idx});
+
+  ## Next, we get the file extension.
+  ## if we have an odd number of leftover arguments, and the next argument
+  ## is a string, we consider it the file extension. Otherwise we will
+  ## extract what we can from the previously found filename.
+  options_idx = filename_idx + 1;
+  if (numel (varargin) > filename_idx &&
+      rem (length (varargin) - filename_idx, 2) != 0 &&
+      ischar (varargin{filename_idx + 1}))
+    ext = varargin{filename_idx + 1};
+    filename = [filename "." ext];
+    options_idx++;
+  else
+    [~, ~, ext] = fileparts (filename);
+    if (! isempty (ext))
+      ## remove dot from extension
+      ext = ext(2:end);
+    endif
+  endif
+
+  ## After all the work finding where the filename was, we might as well
+  ## send the leftovers list (they should be in key value pairs)
+  options = varargin(options_idx:end);
+
+endfunction
--- a/scripts/image/rgb2ind.m
+++ b/scripts/image/rgb2ind.m
@@ -36,16 +36,17 @@
 ## Convert an image in red-green-blue (RGB) color space to an indexed image.
 ##
 ## The input image @var{rgb} must be an N-dimensional RGB image
-## (MxNxO...x3 array) where M,N,O... are the image dimensions, and the
+## (@nospell{MxNxO}@dots{}x3 array) where M,N,O@dots{} are the image
+## dimensions, and the
 ## final dimension contains the values in the red, green and blue
-## channels. Alternatively, the red, green and blue color channels can
+## channels.  Alternatively, the red, green and blue color channels can
 ## be input as separate arrays @var{R}, @var{G} and  @var{B}.
 ##
 ## The input @var{map} defines the colormap to be used.  Alternatively,
 ## @var{n} or @var{tol} may be used to define the maximum number of
 ## colors to use in an automatically generated colormap.  @var{n} is
 ## related to @var{tol} by:  @var{n} = (floor (1/@var{tol}) + 1)^3;
-## @var{tol} must be >0 and <=1.
+## @var{tol} must be >0 and @leq{}1.
 ##
 ## @var{dither_option} is a string which enables or disables dithering:
 ## 'dither' (default) or 'nodither'.
@@ -65,7 +66,7 @@
   else
 
     ## Test for dither_option, by checking if the final input is a string
-    if ischar (varargin{end})
+    if (ischar (varargin{end}))
       dither_option = varargin{end};
       dither_check  = true;
     else
@@ -142,14 +143,14 @@
   
     ## If image is an ND array, convert it to a tiled 2D image
     ## before processing it with Graphicsmagick
-    if numel (sz)>3
+    if (numel (sz) > 3)
      rgb = reshape (rgb, [prod(sz(1:end-2)), sz(end-1), 3]);
     end
 
     ## Prepare the Graphicsmagick dithering option
-    if strcmp (dither_option, "nodither")
+    if (strcmp (dither_option, "nodither"))
       ditherstr = "+dither";
-    elseif strcmp (dither_option, "dither")
+    elseif (strcmp (dither_option, "dither"))
       ditherstr = "-dither";
     endif
       
--- a/scripts/image/rgbplot.m
+++ b/scripts/image/rgbplot.m
@@ -65,7 +65,7 @@
       set (gca, 'ytick', []);
       colormap (cmap);
     otherwise
-      error ("rgbplot: unknown style `%s'", style);
+      error ("rgbplot: unknown style '%s'", style);
   endswitch
   xlabel ("color index");
 
@@ -88,5 +88,5 @@
 %!error rgbplot (1,2)
 %!error <CMAP must be a valid colormap> rgbplot ({0 1 0})
 %!error <STYLE must be a string> rgbplot ([0 1 0], 2)
-%!error <unknown style `nostyle'> rgbplot ([0 1 0], "nostyle")
+%!error <unknown style 'nostyle'> rgbplot ([0 1 0], "nostyle")
 
--- a/scripts/io/csvwrite.m
+++ b/scripts/io/csvwrite.m
@@ -41,14 +41,15 @@
 
 %!test
 %! csvwrite (fname, magic (3));
-%! assert (csvread (fname), magic (3));
+%! data = csvread (fname);
 %! unlink (fname);
+%! assert (data, magic (3));
 
 %!test
 %! csvwrite (fname, magic (3), "precision", "%2.1f", "newline", "unix");
 %! fid = fopen (fname, "rt");
 %! txt = char (fread (fid,Inf,'char')');
 %! fclose (fid);
+%! unlink (fname);
 %! assert (txt, "8.0,1.0,6.0\n3.0,5.0,7.0\n4.0,9.0,2.0\n");
-%! unlink (fname);
 
--- a/scripts/io/dlmwrite.m
+++ b/scripts/io/dlmwrite.m
@@ -151,6 +151,11 @@
     endif
   endwhile
 
+  ## Expand '\t' to TAB for Matlab compatibility
+  if (strcmp (delim, '\t'))
+    delim = "\t";
+  endif
+
   if (ischar (file))
     [fid, msg] = fopen (file, opentype);
   elseif (isscalar (file) && isnumeric (file))
--- a/scripts/io/fileread.m
+++ b/scripts/io/fileread.m
@@ -53,8 +53,8 @@
 %! fprintf (fid, "%s\n", cstr{:});
 %! fclose (fid);
 %! str = fileread (fname);
+%! unlink (fname);
 %! assert (str, [cstr{1} "\n" cstr{2} "\n" cstr{3} "\n"]);
-%! unlink (fname);
 
 %% Test input validation
 %!error fileread ()
--- a/scripts/io/importdata.m
+++ b/scripts/io/importdata.m
@@ -1,4 +1,4 @@
-## Copyright (C) 2012-2013 Erik Kjellson <erikiiofph7@users.sourceforge.net>
+## Copyright (C) 2012-2013 Erik Kjellson
 ##
 ## This file is part of Octave.
 ##
@@ -27,38 +27,41 @@
 ## Importing the contents of file @var{fname} into workspace.
 ##
 ## Input parameters:
+##
 ## @itemize
 ## @item @var{fname}
 ## The file name for the file to import.
 ## 
 ## @item @var{delimiter}
-## The character separating columns of data. Use @code{\t} for tab.
+## The character separating columns of data.  Use @code{\t} for tab.
 ## (Only valid for ascii files)
 ##
 ## @item @var{header_rows}
-## Number of header rows before the data begins. (Only valid for ascii files)
+## Number of header rows before the data begins.  (Only valid for ascii files)
 ## @end itemize
 ##
 ## Different file types are supported:
+##
 ## @itemize
-## @item Ascii table
+## @item ASCII table
 ##
-## Importing ascii table using the specified number of header rows and
+## Importing ASCII table using the specified number of header rows and
 ## the specified delimiter.
 ##
 ## @item Image file
 ##
-## @item @sc{Matlab} file
+## @item @sc{matlab} file
 ##
 ## @item Spreadsheet files (depending on external software)
 ##
-## @item Wav file
+## @item WAV file
 ##
 ## @end itemize
 ##
 ## @seealso{textscan, dlmread, csvread, load}
 ## @end deftypefn
 
+## Author: Erik Kjellson <erikiiofph7@users.sourceforge.net>
 
 function [output, delimiter, header_rows] = importdata (varargin)
 
@@ -117,13 +120,11 @@
   ## Make sure file extension is in lower case.
   fileExt = lower (fileExt);
 
-  switch fileExt
+  switch (fileExt)
     case {".au", ".snd"}
-      error (sprintf ("importdata: not implemented for file format %s", 
-                      fileExt));
+      error ("importdata: not implemented for file format %s", fileExt);
     case ".avi"
-      error (sprintf ("importdata: not implemented for file format %s", 
-                      fileExt));
+      error ("importdata: not implemented for file format %s", fileExt);
     case {".bmp", ".cur", ".gif", ".hdf", ".ico", ".jpe", ".jpeg", ".jpg", \
           ".pbm", ".pcx", ".pgm", ".png", ".pnm", ".ppm", ".ras", \
           ".tif", ".tiff", ".xwd"}
--- a/scripts/io/strread.m
+++ b/scripts/io/strread.m
@@ -479,7 +479,7 @@
       iwrd = 1; iwrdp = 0; iwrdl = length (words{1});
       fwptr = zeros (1, numel (fmt_words));
       ii = 1;
-      while ii <= numel (fmt_words)
+      while (ii <= numel (fmt_words))
 
         nxt_wrd = 0;
         ## Keep track of which words nr. every fmt_words{} is (starts) in.
@@ -679,7 +679,7 @@
       ## Map to format
       ## FIXME - add support for formats like "<%s>", "%[a-zA-Z]"
       ##         Someone with regexp experience is needed.
-      switch fmt_words{m}(1:min (2, length (fmt_words{m})))
+      switch (fmt_words{m}(1:min (2, length (fmt_words{m}))))
         case "%s"
           if (pad_out)
             data(end+1:num_lines) = {""};
@@ -706,7 +706,7 @@
           ew = regexp (fmt_words{m}, '[nfudsq]') - 1;
           nfmt = ostrsplit (fmt_words{m}(2:ew), ".");
           swidth = str2double (nfmt{1});
-          switch fmt_words{m}(ew+1)
+          switch (fmt_words{m}(ew+1))
             case {"d", "u", "f", "n"}
               n = cellfun ("isempty", data);
               ### FIXME - erroneously formatted data lead to NaN, not an error
--- a/scripts/io/textread.m
+++ b/scripts/io/textread.m
@@ -47,7 +47,7 @@
 ## If the format string is empty (not: omitted) and the file contains only
 ## numeric data (excluding headerlines), textread will return a rectangular
 ## matrix with the number of columns matching the number of numeric fields on
-## the first data line of the file. Empty fields are returned as zero values.
+## the first data line of the file.  Empty fields are returned as zero values.
 ##
 ## @seealso{strread, load, dlmread, fscanf, textscan}
 ## @end deftypefn
--- a/scripts/io/textscan.m
+++ b/scripts/io/textscan.m
@@ -1,4 +1,4 @@
-## Copyright (C) 2010-2013 Ben Abbott <bpabbott@mac.com>
+## Copyright (C) 2010-2013 Ben Abbott
 ##
 ## This file is part of Octave.
 ##
@@ -75,6 +75,8 @@
 ## @seealso{dlmread, fscanf, load, strread, textread}
 ## @end deftypefn
 
+## Author: Ben Abbott <bpabbott@mac.com>
+
 function [C, position] = textscan (fid, format = "%f", varargin)
 
   BUFLENGTH = 4096;               ## Read buffer
--- a/scripts/java/javamem.m
+++ b/scripts/java/javamem.m
@@ -35,7 +35,8 @@
 ## @file{java.opts}.  The directory where this file resides is
 ## determined by the environment variable @w{@env{OCTAVE_JAVA_DIR}}.
 ## If unset, the directory where @file{javaaddpath.m} resides is used instead
-## (typically @file{@env{OCTAVE_HOME}/share/octave/@env{OCTAVE_VERSION}/m/java/}
+## (typically
+## @file{@w{@env{OCTAVE_HOME}}/share/octave/@w{@env{OCTAVE_VERSION}}/m/java/}
 ##
 ## @file{java.opts} is a plain text file with one option per line.  The
 ## default initial memory size and default maximum memory size (which
--- a/scripts/java/usejava.m
+++ b/scripts/java/usejava.m
@@ -1,5 +1,5 @@
 ## Copyright (C) 2012 Rik Wehbring
-## Parts Copyright (C) 2012 Philip Nienhuis <prnienhuis@users.sf.net>
+## Parts Copyright (C) 2012 Philip Nienhuis
 ##
 ## This file is part of Octave.
 ##
@@ -45,6 +45,9 @@
 ## and Java is installed.
 ## @end deftypefn
 
+## Author: Rik Wehbring
+## Author: Philip Nienhuis <prnienhuis@users.sf.net>
+
 function retval = usejava (feature)
 
   if (nargin != 1 || ! ischar (feature))
--- a/scripts/linear-algebra/cond.m
+++ b/scripts/linear-algebra/cond.m
@@ -21,7 +21,7 @@
 ## @deftypefnx {Function File} {} cond (@var{A}, @var{p})
 ## Compute the @var{p}-norm condition number of a matrix.
 ##
-## @code{cond (@var{A})} is ## defined as
+## @code{cond (@var{A})} is defined as
 ## @tex
 ## $ {\parallel A \parallel_p * \parallel A^{-1} \parallel_p .} $
 ## @end tex
@@ -29,47 +29,49 @@
 ## @code{norm (@var{A}, @var{p}) * norm (inv (@var{A}), @var{p})}.
 ## @end ifnottex
 ##
-## By default @code{@var{p} = 2} is used which implies a (relatively slow)
+## By default, @code{@var{p} = 2} is used which implies a (relatively slow)
 ## singular value decomposition.  Other possible selections are
 ## @code{@var{p} = 1, Inf, "fro"} which are generally faster.  See
 ## @code{norm} for a full discussion of possible @var{p} values.
+##
+## The condition number of a matrix quantifies the sensitivity of the matrix
+## inversion operation when small changes are made to matrix elements.  Ideally
+## the condition number will be close to 1.  When the number is large this
+## indicates small changes (such as underflow or roundoff error) will produce
+## large changes in the resulting output.  In such cases the solution results
+## from numerical computing are not likely to be accurate.
 ## @seealso{condest, rcond, norm, svd}
 ## @end deftypefn
 
 ## Author: jwe
 
-function retval = cond (A, p)
+function retval = cond (A, p = 2)
 
-  if (nargin && nargin < 3)
-    if (ndims (A) > 2)
-      error ("cond: only valid on 2-D objects");
-    endif
+  if (nargin < 1 || nargin > 2)
+    print_usage ();
+  endif
 
-    if (nargin <2)
-      p = 2;
-    endif
+  if (ndims (A) > 2)
+    error ("cond: A must be a 2-D matrix");
+  endif
 
-    if (! ischar (p) && p == 2)
-      [nr, nc] = size (A);
-      if (nr == 0 || nc == 0)
-        retval = 0.0;
-      elseif (any (any (isinf (A) | isnan (A))))
-        error ("cond: argument must not contain Inf or NaN values");
+  if (p == 2)
+    if (isempty (A))
+      retval = 0.0;
+    elseif (any (! isfinite (A(:))))
+      error ("cond: A must not contain Inf or NaN values");
+    else
+      sigma   = svd (A);
+      sigma_1 = sigma(1);
+      sigma_n = sigma(end);
+      if (sigma_1 == 0 || sigma_n == 0)
+        retval = Inf;
       else
-        sigma   = svd (A);
-        sigma_1 = sigma(1);
-        sigma_n = sigma(end);
-        if (sigma_1 == 0 || sigma_n == 0)
-          retval = Inf;
-        else
-          retval = sigma_1 / sigma_n;
-        endif
+        retval = sigma_1 / sigma_n;
       endif
-    else
-      retval = norm (A, p) * norm (inv (A), p);
     endif
   else
-    print_usage ();
+    retval = norm (A, p) * norm (inv (A), p);
   endif
 
 endfunction
@@ -89,4 +91,7 @@
 
 %!error cond ()
 %!error cond (1, 2, 3)
+%!error <A must be a 2-D matrix> cond (ones (1,3,3))
+%!error <A must not contain Inf or NaN value> cond ([1, 2;Inf 4])
+%!error <A must not contain Inf or NaN value> cond ([1, 2;NaN 4])
 
--- a/scripts/linear-algebra/condest.m
+++ b/scripts/linear-algebra/condest.m
@@ -56,6 +56,7 @@
 ## approximate null vector.
 ##
 ## References:
+##
 ## @itemize
 ## @item
 ## N.J. Higham and F. Tisseur, @cite{A Block Algorithm
--- a/scripts/linear-algebra/duplication_matrix.m
+++ b/scripts/linear-algebra/duplication_matrix.m
@@ -23,7 +23,7 @@
 ##  $D_n$
 ## @end tex
 ## @ifnottex
-##  @math{Dn}
+##  @nospell{@math{Dn}}
 ## @end ifnottex
 ##  which is the unique
 ## @tex
@@ -37,7 +37,7 @@
 ##  $D_n * {\rm vech} (A) = {\rm vec} (A)$
 ## @end tex
 ## @ifnottex
-##  @math{Dn vech (A) = vec (A)}
+##  @nospell{@math{Dn vech (A) = vec (A)}}
 ## @end ifnottex
 ##  for all symmetric
 ## @tex
--- a/scripts/linear-algebra/housh.m
+++ b/scripts/linear-algebra/housh.m
@@ -47,7 +47,7 @@
 ##
 ## @table @var
 ## @item beta
-## If beta = 0, then no reflection need be applied (zer set to 0)
+## If beta = 0, then no reflection need be applied (@nospell{zer} set to 0)
 ##
 ## @item housv
 ## householder vector
--- a/scripts/linear-algebra/logm.m
+++ b/scripts/linear-algebra/logm.m
@@ -1,6 +1,6 @@
-## Copyright (C) 2008-2012 N.J. Higham
-## Copyright (C) 2010 Richard T. Guy <guyrt7@wfu.edu>
-## Copyright (C) 2010 Marco Caliari <marco.caliari@univr.it>
+## Copyright (C) 2008-2012 N. J. Higham
+## Copyright (C) 2010 Richard T. Guy
+## Copyright (C) 2010 Marco Caliari
 ##
 ## This file is part of Octave.
 ##
@@ -39,6 +39,10 @@
 ##            (SIAM, 2008.)
 ##
 
+## Author: N. J. Higham
+## Author: Richard T. Guy <guyrt7@wfu.edu>
+## Author: Marco Caliari <marco.caliari@univr.it>
+
 function [s, iters] = logm (A, opt_iters = 100)
 
   if (nargin == 0 || nargin > 2)
--- a/scripts/linear-algebra/onenormest.m
+++ b/scripts/linear-algebra/onenormest.m
@@ -38,6 +38,7 @@
 ## iterations is limited to 10 and is at least 2.
 ##
 ## References:
+##
 ## @itemize
 ## @item
 ## N.J. Higham and F. Tisseur, @cite{A Block Algorithm
--- a/scripts/linear-algebra/qzhess.m
+++ b/scripts/linear-algebra/qzhess.m
@@ -39,6 +39,8 @@
 ##
 ## Algorithm taken from Golub and Van Loan,
 ## @cite{Matrix Computations, 2nd edition}.
+## 
+## @seealso{lu, chol, hess, qr, qz, schur, svd}
 ## @end deftypefn
 
 ## Author: A. S. Hodel <scotte@eng.auburn.edu>
--- a/scripts/linear-algebra/rank.m
+++ b/scripts/linear-algebra/rank.m
@@ -19,7 +19,8 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} rank (@var{A})
 ## @deftypefnx {Function File} {} rank (@var{A}, @var{tol})
-## Compute the rank of @var{A}, using the singular value decomposition.
+## Compute the rank of matrix @var{A}, using the singular value decomposition.
+##
 ## The rank is taken to be the number of singular values of @var{A} that
 ## are greater than the specified tolerance @var{tol}.  If the second
 ## argument is omitted, it is taken to be
@@ -31,6 +32,29 @@
 ## @noindent
 ## where @code{eps} is machine precision and @code{sigma(1)} is the largest
 ## singular value of @var{A}.
+##
+## The rank of a matrix is the number of linearly independent rows or
+## columns and determines how many particular solutions exist to a system
+## of equations.  Use @code{null} for finding the remaining homogenous
+## solutions.
+##
+## Example:
+##
+## @example
+## @group
+## x = [1 2 3
+##      4 5 6
+##      7 8 9];
+## rank (x)
+##   @result{} 2
+## @end group
+## @end example
+##
+## @noindent
+## The number of linearly independent rows is only 2 because the final row
+## is a linear combination of -1*row1 + 2*row2.
+##
+## @seealso{null, sprank, svd}
 ## @end deftypefn
 
 ## Author: jwe
@@ -104,6 +128,10 @@
 %! A = eye (100);
 %! assert (rank (A), 100);
 
+%!assert (rank ([]), 0)
+%!assert (rank ([1:9]), 1)
+%!assert (rank ([1:9]'), 1)
+
 %!test
 %! A = [1, 2, 3; 1, 2.001, 3; 1, 2, 3.0000001];
 %! assert (rank (A), 3);
--- a/scripts/linear-algebra/trace.m
+++ b/scripts/linear-algebra/trace.m
@@ -18,7 +18,11 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} trace (@var{A})
-## Compute the trace of @var{A}, @code{sum (diag (@var{A}))}.
+## Compute the trace of @var{A}, the sum of the elements along the main
+## diagonal.
+##
+## The implementation is straightforward: @code{sum (diag (@var{A}))}.
+## @seealso{eig}
 ## @end deftypefn
 
 ## Author: jwe
@@ -33,7 +37,7 @@
     error ("trace: only valid on 2-D objects");
   elseif (isempty (A))
     y = 0;
-  elseif (any (size (A) == 1))
+  elseif (isvector (A))
     y = A(1);
   else
     y = sum (diag (A));
@@ -46,7 +50,8 @@
 %!assert (trace ([1, 2; 3, 4; 5, 6]), 5)
 %!assert (trace ([1, 3, 5; 2, 4, 6]), 5)
 %!assert (trace ([]), 0)
-%!assert (trace (randn (1,0)), 0)
+%!assert (trace (rand (1,0)), 0)
+%!assert (trace ([3:10]), 3)
 
 %!error trace ()
 %!error trace (1, 2)
--- a/scripts/miscellaneous/citation.m
+++ b/scripts/miscellaneous/citation.m
@@ -19,12 +19,12 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Command} {} citation
 ## @deftypefnx {Command} {} citation @var{package}
-## Display instructions to cite GNU Octave and packages in publications.
+## Display instructions for citing GNU Octave or its packages in publications.
 ##
-## When called without an argument, displays information on how to cite the core
-## GNU Octave system in publications.  When given a package name @var{package},
-## display information on to cite it.  However, note that some packages may not
-## have instructions on how to cite them.
+## When called without an argument, display information on how to cite the core
+## GNU Octave system.  When given a package name @var{package}, display
+## information on citing the specific named package.  Note that some packages
+## may not yet have instructions on how to cite them.
 ##
 ## The GNU Octave developers and its active community of package authors have
 ## invested a lot of time and effort in creating GNU Octave as it is today.
@@ -46,6 +46,9 @@
 
 endfunction
 
+
+%% Test input validation
 %!error citation (1, 2)
 %!error <citation: PACKAGE must be a string> citation (1)
 %!error <citation: package .* is not installed> citation ("__NOT_A_VALID_PKG_NAME__")
+
--- a/scripts/miscellaneous/copyfile.m
+++ b/scripts/miscellaneous/copyfile.m
@@ -62,7 +62,7 @@
     endif
 
     if (nargin == 3 && strcmp (force, "f"))
-      cmd = cstrcat (cmd, " ", cmd_force_flag);
+      cmd = [cmd " " cmd_force_flag];
     endif
 
     ## If f1 isn't a cellstr convert it to one.
--- a/scripts/miscellaneous/dir.m
+++ b/scripts/miscellaneous/dir.m
@@ -111,7 +111,7 @@
             endif
           endif
           [dummy, fn, ext] = fileparts (fn);
-          fn = cstrcat (fn, ext);
+          fn = [fn ext];
           info(i,1).name = fn;
           lt = localtime (st.mtime);
           info(i,1).date = strftime ("%d-%b-%Y %T", lt);
--- a/scripts/miscellaneous/edit.m
+++ b/scripts/miscellaneous/edit.m
@@ -30,7 +30,7 @@
 ## If the function @var{name} is available in a file on your path and
 ## that file is modifiable, then it will be edited in place.  If it
 ## is a system function, then it will first be copied to the directory
-## @env{HOME} (see further down) and then edited.
+## @env{HOME} (see below) and then edited.
 ## If no file is found, then the m-file
 ## variant, ending with ".m", will be considered.  If still no file
 ## is found, then variants with a leading "@@" and then with both a
@@ -42,26 +42,27 @@
 ## to contain that function along with its current definition.
 ##
 ## @item
-## If @code{name.cc} is specified, then it will search for @code{name.cc}
-## in the path and try to modify it, otherwise it will create a new
-## @file{.cc} file in @env{HOME}.  If @var{name} happens to be an
+## If @code{@var{name}.cc} is specified, then it will search for
+## @code{@var{name}.cc} in the path and try to modify it, otherwise it will
+## create a new @file{.cc} file in @env{HOME}.  If @var{name} happens to be an
 ## m-file or interpreter defined function, then the text of that
 ## function will be inserted into the .cc file as a comment.
 ##
 ## @item
-## If @var{name.ext} is on your path then it will be edited, otherwise
-## the editor will be started with @file{HOME/name.ext} as the
-## filename.  If @file{name.ext} is not modifiable, it will be copied to
+## If @file{@var{name}.ext} is on your path then it will be edited, otherwise
+## the editor will be started with @file{@env{HOME}/@var{name}.ext} as the
+## filename.  If @file{@var{name}.ext} is not modifiable, it will be copied to
 ## @env{HOME} before editing.
 ##
-## @strong{Warning:} You may need to clear name before the new definition
+## @strong{Warning:} You may need to clear @var{name} before the new definition
 ## is available.  If you are editing a .cc file, you will need
-## to mkoctfile @file{name.cc} before the definition will be available.
+## to execute @code{mkoctfile @file{@var{name}.cc}} before the definition
+## will be available.
 ## @end itemize
 ##
 ## If @code{edit} is called with @var{field} and @var{value} variables,
-## the value of the control field @var{field} will be @var{value}.
-## If an output argument is requested and the first argument is @code{get}
+## the value of the control field @var{field} will be set to @var{value}.
+## If an output argument is requested and the first input argument is @code{get}
 ## then @code{edit} will return the value of the control field @var{field}.
 ## If the control field does not exist, edit will return a structure
 ## containing all fields and values.  Thus, @code{edit get all} returns
@@ -75,8 +76,8 @@
 ## @code{getenv ("EDITOR")} and defaults to @code{emacs}.  Use @code{%s}
 ## In place of the function name.  For example,
 ##
-## @table @samp
-## @item [EDITOR, " %s"]
+## @table @asis
+## @item @code{[EDITOR, " %s"]}
 ## Use the editor which Octave uses for @code{edit_history}.
 ##
 ## @item "xedit %s &"
@@ -97,18 +98,18 @@
 ## @end smallexample
 ##
 ## @item home
-## This is the location of user local m-files.  Be be sure it is in your
+## This is the location of user local m-files.  Be sure it is in your
 ## path.  The default is @file{~/octave}.
 ##
 ## @item author
 ## This is the name to put after the "## Author:" field of new functions.
-## By default it guesses from the @code{gecos} field of password database.
+## By default it guesses from the @code{gecos} field of the password database.
 ##
 ## @item email
 ## This is the e-mail address to list after the name in the author field.
 ## By default it guesses @code{<$LOGNAME@@$HOSTNAME>}, and if @code{$HOSTNAME}
 ## is not defined it uses @code{uname -n}.  You probably want to override this.
-## Be sure to use @code{<user@@host>} as your format.
+## Be sure to use the format @code{<user@@host>}.
 ##
 ## @item license
 ##
@@ -133,7 +134,7 @@
 ## This value determines whether the editor should be started in async mode
 ## (editor is started in the background and Octave continues) or sync mode
 ## (Octave waits until the editor exits).  Set it to "sync" to start the editor
-## in sync mode.  The default is "async" (see also "system").
+## in sync mode.  The default is "async" (@pxref{XREFsystem,,system}).
 ##
 ## @item editinplace
 ## Determines whether files should be edited in place, without regard to
@@ -150,56 +151,55 @@
 
   ## Pick up globals or default them.
 
-  persistent FUNCTION = struct ("EDITOR", cstrcat (EDITOR (), " %s"),
+  persistent FUNCTION = struct ("EDITOR", [EDITOR() " %s"],
                                 "HOME", fullfile (default_home, "octave"),
                                 "AUTHOR", default_user(1),
-                                "EMAIL",  [],
-                                "LICENSE",  "GPL",
+                                "EMAIL", [],
+                                "LICENSE", "GPL",
                                 "MODE", "async",
                                 "EDITINPLACE", false);
   ## Make sure the stateval variables survive "clear functions".
-  mlock;
+  #mlock;
 
   if (nargin == 1)
     ## User has supplied one arg, this can be a single file name
-    ## or a cell array of strings containing multiple files to be
-    ## opened
-    if (iscellstr(varargin{1}))
-      ## If first arg is a cell array of strings, it becomes the
-      ## list of files to be edited
+    ## or a cell array of strings containing multiple files to be opened
+    if (iscellstr (varargin{1}))
+      ## If first arg is a cell array of strings, 
+      ## it becomes the list of files to be edited
       editfilelist = varargin{1};
-    elseif (ischar(varargin{1}))
+    elseif (ischar (varargin{1}))
       ## If first arg is a string, create a cell array of strings
-      ## of length one (by copying the input cell array)
+      ## of length 1 (by copying the input cell array)
       editfilelist = varargin(1);
     else
-      error('edit: expected file to be a string or cell array of strings');
+      error ("edit: expected file to be a string or cell array of strings");
     endif
   elseif (nargin == 2)
-    ## User has supplied two arguments, these could be two file
-    ## names, or a combination of editor state name and new value
-    ## for that state, so first check for the various states
+    ## User has supplied two arguments, these could be two file names,
+    ## or a combination of editor state name and new value for that state,
+    ## so first check for the various states
     statevar = varargin{1};
     stateval = varargin{2};
     switch (toupper (statevar))
     case "EDITOR"
       FUNCTION.EDITOR = stateval;
-      return
+      return;
     case "HOME"
       if (! isempty (stateval) && stateval(1) == "~")
         stateval = [ default_home, stateval(2:end) ];
       endif
       FUNCTION.HOME = stateval;
-      return
+      return;
     case "AUTHOR"
       FUNCTION.AUTHOR = stateval;
-      return
+      return;
     case "EMAIL"
       FUNCTION.EMAIL = stateval;
-      return
+      return;
     case "LICENSE"
       FUNCTION.LICENSE = stateval;
-      return
+      return;
     case "MODE"
       if (strcmp (stateval, "sync") || strcmp (stateval, "async"))
         FUNCTION.MODE = stateval;
@@ -232,15 +232,15 @@
       editfilelist = varargin;
     endswitch
   elseif (nargin > 2)
-    if (iscellstr(varargin))
+    if (iscellstr (varargin))
       editfilelist = varargin;
     else
-      error('edit: if supplying more than one input all inputs must be strings containing fiel names to open.');
+      error ("edit: if supplying more than one input all inputs must be strings containing field names to open.");
     endif
   endif
 
   ## Start the editor without a file if no file is given.
-  if (nargin < 1)
+  if (nargin == 0)
     if (exist (FUNCTION.HOME, "dir") == 7)
       curr_dir = pwd ();
       unwind_protect
@@ -255,11 +255,11 @@
     return;
   endif
 
-  if (numel(editfilelist) > 1)
+  if (numel (editfilelist) > 1)
 
     ## Call edit on each of the files in the list if there are more than 1
-    for i = 1:numel(editfilelist)
-      edit(editfilelist{i});
+    for i = 1:numel (editfilelist)
+      edit (editfilelist{i});
     endfor
 
   else
@@ -296,15 +296,13 @@
     ## If file has no extension, add file.m and file.cc to the list.
     idx = rindex (file, ".");
     if (idx == 0)
-      ## Create the list of files to look for
-      filelist = {file};
       if (isempty (regexp (file, '\.m$')))
         ## No ".m" at the end of the file, add to the list.
-        filelist{end+1} = cat (2, file, ".m");
+        filelist{end+1} = [file ".m"];
       endif
       if (isempty (regexp (file, '\.cc$')))
         ## No ".cc" at the end of the file, add to the list.
-        filelist{end+1} = cat (2, file, ".cc");
+        filelist{end+1} = [file ".cc"];
       endif
     endif
 
@@ -313,7 +311,7 @@
       ## No "@" at the beginning of the file, add to the list.
       numfiles = numel (filelist);
       for n = 1:numfiles
-        filelist{n+numfiles} = cat (2, "@", filelist{n});
+        filelist{n+numfiles} = ["@" filelist{n}];
       endfor
     endif
 
@@ -335,12 +333,12 @@
         do_edit (FUNCTION.EDITOR, fileandpath, FUNCTION.MODE);
         return;
       else
-        ## If the file is modifiable in place then edit it, otherwise make
-        ## a copy in HOME and then edit it.
+        ## If the file is modifiable in place then edit it,
+        ## otherwise make a copy in HOME and then edit it.
         fid = fopen (fileandpath, "r+t");
         if (fid < 0)
           from = fileandpath;
-          fileandpath = cstrcat (FUNCTION.HOME, from (rindex (from, filesep):end));
+          fileandpath = [FUNCTION.HOME, from(rindex(from, filesep):end)];
           [status, msg] = copyfile (from, fileandpath, 1);
           if (status == 0)
             error (msg);
@@ -359,16 +357,14 @@
     idx = rindex (file, ".");
     name = file(1:idx-1);
     ext = file(idx+1:end);
-    switch (ext)
-      case {"cc", "m"}
-        0;
-      otherwise
-        do_edit (FUNCTION.EDITOR, fileandpath, FUNCTION.MODE);
-        return;
-    endswitch
+    if (! any (strcmp (ext, {"cc", "m"})))
+      ## Some unknown file.  Just open it up.
+      do_edit (FUNCTION.EDITOR, fileandpath, FUNCTION.MODE);
+      return;
+    endif
 
-    ## The file doesn't exist in path so create it, put in the function
-    ## template and edit it.
+    ## The file doesn't exist in path so
+    ## create it, put in the function template, and edit it.
 
     ## Guess the email name if it was not given.
     if (isempty (FUNCTION.EMAIL))
@@ -386,76 +382,75 @@
       if (isempty (host))
         FUNCTION.EMAIL = " ";
       else
-        FUNCTION.EMAIL = cstrcat ("<", default_user(0), "@", host, ">");
+        FUNCTION.EMAIL = ["<" default_user(0) "@" host ">"];
       endif
     endif
 
     ## Fill in the revision string.
     now = localtime (time);
-    revs = cstrcat ("Created: ", strftime ("%Y-%m-%d", now));
+    revs = ["Created: " strftime("%Y-%m-%d",now)];
 
     ## Fill in the copyright string.
-    copyright = cstrcat (strftime ("Copyright (C) %Y ", now), FUNCTION.AUTHOR);
+    copyright = [strftime("Copyright (C) %Y ",now) FUNCTION.AUTHOR];
 
     ## Fill in the author tag field.
-    author = cstrcat ("Author: ", FUNCTION.AUTHOR, " ", FUNCTION.EMAIL);
+    author = ["Author: " FUNCTION.AUTHOR " " FUNCTION.EMAIL];
 
     ## Fill in the header.
     uclicense = toupper (FUNCTION.LICENSE);
     switch (uclicense)
       case "GPL"
         head = cstrcat (copyright, "\n\n", "\
-  This program is free software; you can redistribute it and/or modify\n\
-  it under the terms of the GNU General Public License as published by\n\
-  the Free Software Foundation; either version 3 of the License, or\n\
-  (at your option) any later version.\n\
-  \n\
-  This program is distributed in the hope that it will be useful,\n\
-  but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\
-  GNU General Public License for more details.\n\
-  \n\
-  You should have received a copy of the GNU General Public License\n\
-  along with Octave; see the file COPYING.  If not, see\n\
-  <http://www.gnu.org/licenses/>.\
-  ");
-        tail = cstrcat (author, "\n", revs);
+This program is free software; you can redistribute it and/or modify\n\
+it under the terms of the GNU General Public License as published by\n\
+the Free Software Foundation; either version 3 of the License, or\n\
+(at your option) any later version.\n\
+\n\
+This program is distributed in the hope that it will be useful,\n\
+but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\
+GNU General Public License for more details.\n\
+\n\
+You should have received a copy of the GNU General Public License\n\
+along with Octave; see the file COPYING.  If not, see\n\
+<http://www.gnu.org/licenses/>.\
+");
+        tail = [author, "\n", revs];
 
       case "BSD"
         head = cstrcat (copyright, "\n\n", "\
-  This program is free software; redistribution and use in source and\n\
-  binary forms, with or without modification, are permitted provided that\n\
-  the following conditions are met:\n\
-  \n\
-     1.Redistributions of source code must retain the above copyright\n\
-       notice, this list of conditions and the following disclaimer.\n\
-     2.Redistributions in binary form must reproduce the above copyright\n\
-       notice, this list of conditions and the following disclaimer in the\n\
-       documentation and/or other materials provided with the distribution.\n\
-  \n\
-  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n\
-  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\
-  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n\
-  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n\
-  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n\
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n\
-  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n\
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n\
-  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n\
-  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n\
-  SUCH DAMAGE.\
-  ");
-        tail = cstrcat (author, "\n", revs);
+This program is free software; redistribution and use in source and\n\
+binary forms, with or without modification, are permitted provided that\n\
+the following conditions are met:\n\
+\n\
+   1.Redistributions of source code must retain the above copyright\n\
+     notice, this list of conditions and the following disclaimer.\n\
+   2.Redistributions in binary form must reproduce the above copyright\n\
+     notice, this list of conditions and the following disclaimer in the\n\
+     documentation and/or other materials provided with the distribution.\n\
+\n\
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n\
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n\
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n\
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n\
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n\
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n\
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n\
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n\
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n\
+SUCH DAMAGE.\
+");
+        tail = [author, "\n", revs];
 
       case "PD"
         head = "";
-        tail = cstrcat (author, "\n", revs, "\n\n",
-                       "This program is granted to the public domain.");
+        tail = [author, "\n", revs, "\n\n", ...
+                "This program is granted to the public domain."];
 
       otherwise
         head = "";
-        tail = cstrcat (copyright, "\n\n", FUNCTION.LICENSE, "\n",
-                       author, "\n", revs);
+        tail = [copyright, "\n\n", FUNCTION.LICENSE, "\n", author, "\n", revs];
     endswitch
 
     ## Generate the function template.
@@ -463,45 +458,44 @@
     switch (ext)
       case {"cc", "C", "cpp"}
         if (isempty (head))
-          comment = cstrcat ("/*\n", tail, "\n\n*/\n\n");
+          comment = ["/*\n\n", tail, "\n\n*/\n\n"];
         else
-          comment = cstrcat ("/*\n", head, "\n\n", tail, "\n\n*/\n\n");
+          comment = ["/*\n\n", head, "\n\n", tail, "\n\n*/\n\n"];
         endif
         ## If we are shadowing an m-file, paste the code for the m-file.
         if (any (exists == [2, 103]))
-          code = cstrcat ("\\ ", strrep (type (name){1}, "\n", "\n// "));
+          code = ['\ ', strrep(type(name){1}, "\n", "\n// ")];
         else
           code = " ";
         endif
-        body = cstrcat ("#include <octave/oct.h>\n\n",
-                       "DEFUN_DLD(", name, ",args,nargout,\"\\\n",
-                       name, "\\n\\\n\")\n{\n",
-                       "  octave_value_list retval;\n",
-                       "  int nargin = args.length ();\n\n",
-                       code, "\n  return retval;\n}\n");
+        body = ["#include <octave/oct.h>\n\n",               \
+                "DEFUN_DLD(" name ", args, nargout, \"\\\n", \
+                name, "\\n\\\n\")\n{\n",                     \
+                "  octave_value_list retval;\n",             \
+                "  int nargin = args.length ();\n\n",        \
+                code, "\n  return retval;\n}\n"];
 
-        text = cstrcat (comment, body);
+        text = [comment, body];
       case "m"
-        ## If we are editing a function defined on the fly, paste the
-        ## code.
+        ## If we are editing a function defined on the fly, paste the code.
         if (any (exists == [2, 103]))
           body = type (name){1};
         else
-          body = cstrcat ("function [ret] = ", name, " ()\n\nendfunction\n");
+          body = ["function [retval] = " name " ()\n\nendfunction\n"];
         endif
         if (isempty (head))
-          comment = cstrcat ("## -*- texinfo -*- \n## @deftypefn {Function File}", 
-                             "{@var{ret} =}", name, "(@var{x}, @var{y})\n##\n",
-                             "## @seealso{}\n## @end deftypefn\n\n",
-                             "## ", strrep (tail, "\n", "\n## "), "\n\n");
+          comment = ["## -*- texinfo -*- \n## @deftypefn {Function File} " \
+                     "{@var{retval} =} " name " (@var{x}, @var{y})\n##\n"  \
+                     "## @seealso{}\n## @end deftypefn\n\n"                \
+                     "## " strrep(tail, "\n", "\n## ") "\n\n"];
         else
-          comment = cstrcat ("## ", strrep (head,"\n","\n## "), "\n\n", ...
-                             "## -*- texinfo -*- \n## @deftypefn {Function File}", 
-                             "{@var{ret} =}", name, "(@var{x}, @var{y})\n##\n",
-                             "## @seealso{}\n## @end deftypefn\n\n",
-                             "## ", strrep (tail, "\n", "\n## "), "\n\n");
+          comment = ["## " strrep(head,"\n","\n## ") "\n\n"                \
+                     "## -*- texinfo -*- \n## @deftypefn {Function File} " \
+                     "{@var{retval} =} " name " (@var{x} @var{y})\n##\n"   \
+                     "## @seealso{}\n## @end deftypefn\n\n"                \
+                     "## " strrep(tail, "\n", "\n## ") "\n\n"];
         endif
-        text = cstrcat (comment, body);
+        text = [comment, body];
     endswitch
 
     ## Write the initial file (if there is anything to write)
@@ -518,15 +512,15 @@
 
 endfunction
 
-function ret = default_home ()
+function retval = default_home ()
 
-  ret = getenv ("HOME");
-  if (isempty (ret))
-    ret = glob ("~");
-    if (! isempty (ret))
-      ret = ret{1};
+  retval = getenv ("HOME");
+  if (isempty (retval))
+    retval = glob ("~");
+    if (! isempty (retval))
+      retval = retval{1};
     else
-      ret = "";
+      retval = "";
     endif
   endif
 
@@ -538,37 +532,35 @@
 ## default author.  Otherwise return the login name.
 ## login@host will be the default email address.
 
-function ret = default_user (long_form)
+function retval = default_user (long_form)
 
   ent = getpwuid (getuid);
   if (! isstruct (ent))
-    ret = getenv ("USER");
-    if (isempty (ret))
-      ret = getenv ("USERNAME");
+    retval = getenv ("USER");
+    if (isempty (retval))
+      retval = getenv ("USERNAME");
     endif
   elseif (long_form)
-    ret = ent.gecos;
-    pos = strfind (ret, ",");
+    retval = ent.gecos;
+    pos = strfind (retval, ",");
     if (! isempty (pos))
-      ret = ret(1:pos-1);
+      retval = retval(1:pos-1);
     endif
   else
-    ret = ent.name;
+    retval = ent.name;
   endif
 
 endfunction
 
 function do_edit (editor, file, mode)
 
-  ## Give the hook function a chance.  If that fails, fall back
-  ## on running an editor with the system function.
+  ## Give the hook function a chance.
+  ## If that fails, fall back on running an editor with the system function.
 
   status = __octave_link_edit_file__ (file);
 
   if (! status)
-    system (sprintf (undo_string_escapes (editor),
-                     cstrcat ("\"", file, "\"")),
-            [], mode);
+    system (sprintf (undo_string_escapes (editor), ['"' file '"']), [], mode);
   endif
 
 endfunction
--- a/scripts/miscellaneous/error_ids.m
+++ b/scripts/miscellaneous/error_ids.m
@@ -40,7 +40,7 @@
 ## Indicates that memory couldn't be allocated.
 ##
 ## @item Octave:undefined-function
-## Indicates a call to a function that is not defined. The function may
+## Indicates a call to a function that is not defined.  The function may
 ## exist but Octave is unable to find it in the search path.
 ##
 ## @end table
--- a/scripts/miscellaneous/fact.m
+++ b/scripts/miscellaneous/fact.m
@@ -90,7 +90,7 @@
        "Richard Stallman doesn’t code; he dares the computer to not do his bidding.";
        "Global warming is caused by Richard Stallman's rage towards non-free software.";
        "Rather than being birthed like a normal child, Richard Stallman instead instantiated himself polymorphically. Shortly thereafter he grew a beard.";
-       "Richard Stallman discovered extra-terrestrial life but killed them because they used non-free software.";
+       "Richard Stallman discovered extra-terrestrial life but killed them because they distributed non-free software.";
        "Richard Stallman doesn't evaluate expressions; expressions evaluate to Richard Stallman.";
        "Richard Stallman can see Russia from his house.";
        "Richard Stallman proved P=NP, twice!";
@@ -237,6 +237,24 @@
        "Richard Stallman exists because he compiled himself into being.";
        "Richard Stallman's first words were in binary. When they couldn't understand him, he wrote a parser.";
        "Richard Stallman doesn't need any codecs, he just opens a multimedia file with Emacs, and reads the bytes of the file as plain text. He then performs all the necessary decoding in his mind. But he refuses to decode files encrypted with DRM, although his mind is able to.";
+       "Richard Stallman was right. Sadly.";
+       "Richard Stallman can wiretap the NSA.";
+       "This is how Richard Stallman created Emacs: http://stallman.org/photos/rms-working/img_0631.jpg";
+       "Join Richard Stallman now and share the software, you'll be a free hacker, you'll be free!";
+       "Richard Stallman has not agreed to the terms and conditions and privacy policy because only he can actually read all of it.";
+       "Richard Stallman knows how of a backdoor to AES, but he respects your freedom and privacy too much to actually use it.";
+       "Richard Stallman will never get tired of being mocked for the foot cheese incident.";
+       "You like to release non-free software around Richard Stallman? I too like to live dangerously...";
+       "Yeah, if could just go ahead and make all software free for Richard Stallman, that'd be great, thanks.";
+       "Richard Stallman knows exactly what you mean when you talk about the cloud. But do you?";
+       "Richard Stallman satisfies Greenspun's Tenth Rule of programming, since his DNA also contains a complete implementation of all of Common Lisp.";
+       "Richard Stallman can violate the GPL. In a vulgar display of power, he once did so with the Emacs source code, but he undid the violation before most people noticed.";
+       "Good guy Richard Stallman does not try to shake you down for money. He will just kindly ask you to comply with the GPL.";
+       "Richard Stallman is in fact also a little sad that Steve Jobs is gone because it has diminished the size of the loyal opposition.";
+       "Richard Stallman can release LLVM and clang under the GPL.";
+       "No, really, Richard Stallman has a katana.";
+       "Every day Richard Stallman finds at least fifteen things in the world to rage about. You can read his findings here: http://stallman.org/archives/polnotes.html"
+       "Some of these Richard Stallman facts are completely true. Seriously.";
        };
 
   w = wisdom{randi([1, numel(wisdom)])};
@@ -257,12 +275,13 @@
   while (i <= numwords);
     line = wc{i};
     while (i < numwords
-           && length (newline = cstrcat (line, " ", wc{i+1})) < cols)
+           && length (newline = [line " " wc{i+1}]) < cols)
       line = newline;
       i++;
     endwhile
-    out = cstrcat (out, line, "\n");
+    out = [out, line, "\n"];
     i++;
   endwhile
-  out = cstrcat (out, "\n");
+  out = [out, "\n"];
 endfunction
+
--- a/scripts/miscellaneous/fullfile.m
+++ b/scripts/miscellaneous/fullfile.m
@@ -40,7 +40,7 @@
         elseif (i == nargs && strcmp (tmp, filesep))
           tmp = "";
         endif
-        filename = cstrcat (filename, filesep, tmp);
+        filename = [filename filesep tmp];
       endfor
     elseif (nargs == 1)
       filename = varargin{1};
@@ -56,10 +56,10 @@
 
 %!shared fs, fsx, xfs, fsxfs, xfsy
 %! fs = filesep ();
-%! fsx = cstrcat (fs, "x");
-%! xfs = cstrcat ("x", fs);
-%! fsxfs = cstrcat (fs, "x", fs);
-%! xfsy = cstrcat ("x", fs, "y");
+%! fsx = [fs "x"];
+%! xfs = ["x" fs];
+%! fsxfs = [fs "x" fs];
+%! xfsy = ["x" fs "y"];
 %!assert (fullfile (""), "")
 %!assert (fullfile (fs), fs)
 %!assert (fullfile ("", fs), fs)
--- a/scripts/miscellaneous/getfield.m
+++ b/scripts/miscellaneous/getfield.m
@@ -18,9 +18,9 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{val}] =} getfield (@var{s}, @var{field})
+## @deftypefn  {Function File} {[@var{val}] =} getfield (@var{s}, @var{field})
 ## @deftypefnx {Function File} {[@var{val}] =} getfield (@var{s}, @var{idx1}, @var{field1}, @var{idx2}, @var{field2}, @dots{})
-## Extract a field from a structure (or a nested structure). The syntax
+## Extract a field from a structure (or a nested structure).  The syntax
 ## is the same as @code{setfield}, except it omits the final @var{val}
 ## argument, returning this value instead of setting it.
 ##
--- a/scripts/miscellaneous/mkoctfile.m
+++ b/scripts/miscellaneous/mkoctfile.m
@@ -53,13 +53,13 @@
 ## @item -R DIR
 ## Add the run-time path to the link command.
 ##
-## @item -Wl,@dots{}
-## Pass flags though the linker like "-Wl,-rpath=@dots{}".
+## @item @nospell{-Wl,@dots{}}
+## Pass flags though the linker like @nospell{"-Wl,-rpath=@dots{}"}.
 ## The quotes are needed since commas are interpreted as command
 ## separators.
 ##
 ## @item -W@dots{}
-## Pass flags though the compiler like "-Wa,OPTION".
+## Pass flags though the compiler like @nospell{"-Wa,OPTION"}.
 ##
 ## @item -c
 ## Compile but do not link.
@@ -146,9 +146,9 @@
 
   shell_script = fullfile (bindir, sprintf ("mkoctfile-%s", OCTAVE_VERSION));
 
-  cmd = cstrcat ("\"", shell_script, "\"");
+  cmd = ['"' shell_script '"'];
   for i = 1:nargin
-    cmd = cstrcat (cmd, " \"", varargin{i}, "\"");
+    cmd = [cmd ' "' varargin{i} '"'];
   endfor
 
   [sys, out] = system (cmd);
--- a/scripts/miscellaneous/movefile.m
+++ b/scripts/miscellaneous/movefile.m
@@ -62,7 +62,7 @@
     endif
 
     if (nargin == 3 && strcmp (force, "f"))
-      cmd = cstrcat (cmd, " ", cmd_force_flag);
+      cmd = [cmd " " cmd_force_flag];
     endif
 
     ## If f1 isn't a cellstr convert it to one.
--- a/scripts/miscellaneous/perl.m
+++ b/scripts/miscellaneous/perl.m
@@ -41,8 +41,8 @@
       scriptfile = file_in_loadpath (scriptfile);
     endif
 
-    [status, output] = system (cstrcat ("perl ", scriptfile,
-                                        sprintf (" %s", varargin{:})));
+    [status, output] = system (["perl " scriptfile ...
+                                sprintf(" %s", varargin{:})]);
   else
     error ("perl: invalid arguments");
   endif
--- a/scripts/miscellaneous/python.m
+++ b/scripts/miscellaneous/python.m
@@ -40,8 +40,8 @@
       scriptfile = file_in_loadpath (scriptfile);
     endif
 
-    [status, output] = system (cstrcat ("python ", scriptfile,
-                                        sprintf (" %s", varargin{:})));
+    [status, output] = system (["python ", scriptfile, ...
+                                sprintf(" %s", varargin{:})]);
   else
     error ("python: invalid arguments");
   endif
--- a/scripts/miscellaneous/run.m
+++ b/scripts/miscellaneous/run.m
@@ -39,7 +39,7 @@
       wd = pwd ();
       unwind_protect
         cd (d);
-        if (! exist (cstrcat (f, ext), "file"))
+        if (! exist ([f ext], "file"))
           error ("run: file SCRIPT must exist and be a valid Octave scriptfile");
         endif
         evalin ("caller", sprintf ("source (\"%s%s\");", f, ext),
--- a/scripts/miscellaneous/setfield.m
+++ b/scripts/miscellaneous/setfield.m
@@ -18,10 +18,11 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {@var{s} =} setfield (@var{s}, @var{field}, @var{val})
+## @deftypefn  {Function File} {@var{s} =} setfield (@var{s}, @var{field}, @var{val})
 ## @deftypefnx {Function File} {@var{s} =} setfield (@var{s}, @var{idx1}, @var{field1}, @var{idx2}, @var{field2}, @dots{}, @var{val})
 ##
-## Set a field member @var{field} in a structure @var{s} equal to @var{val}.  For example:
+## Set a field member @var{field} in a structure @var{s} equal to @var{val}. 
+## For example:
 ##
 ## @example
 ## @group
@@ -39,10 +40,10 @@
 ##
 ## @noindent
 ## Note that ordinary structure syntax @code{@var{s}.foo bar = 42} cannot be
-## used here, as the field name is not a valid Octave identifier. Using
-## arbitrary strings for field name is incompatible with @sc{Matlab}, so
+## used here, as the field name is not a valid Octave identifier.  Using
+## arbitrary strings for field name is incompatible with @sc{matlab}, so
 ## this usage will warn if the @code{Octave:matlab-incompatible} warning
-## is set. @xref{doc-warning_ids}.
+## is set.  @xref{XREFwarning_ids}.
 ##
 ## With the second calling form, set a field on a structure array,
 ## possibly nested, with successive nested indices @var{idx1},
@@ -66,7 +67,7 @@
 ## @end example
 ##
 ## Here we first have an ordinary structure array with one field
-## @code{baz} set to 42. Then we set another field in a nested scalar structure
+## @code{baz} set to 42.  Then we set another field in a nested scalar structure
 ## indexing with two single cells containing the unique desired indices.
 ##
 ## Finally an example with nested structure arrays,
--- a/scripts/miscellaneous/tempdir.m
+++ b/scripts/miscellaneous/tempdir.m
@@ -29,7 +29,7 @@
   endif
 
   if (! strcmp (dirname(end), filesep))
-    dirname = cstrcat (dirname, filesep);
+    dirname = [dirname filesep];
   endif
 
   if (! isdir (dirname))
--- a/scripts/miscellaneous/unpack.m
+++ b/scripts/miscellaneous/unpack.m
@@ -75,10 +75,10 @@
 
     ## Check to see if it's .tar.gz, .tar.Z, etc.
     if (any (strcmpi ({".gz" ".Z" ".bz2" ".bz"}, ext)))
-      [tmppathstr, tmpname, tmpext] = fileparts (name);
+      [~, tmpname, tmpext] = fileparts (name);
       if (strcmpi (tmpext, ".tar"))
         name = tmpname;
-        ext = cstrcat (tmpext, ext);
+        ext = [tmpext ext];
       endif
     endif
 
@@ -88,10 +88,10 @@
       urlfile = file;
       ## FIXME -- should we name the file that we download with the
       ## same file name as the URL requests?
-      tmpfile = cstrcat (tmpnam (), ext);
+      tmpfile = [tmpnam() ext];
       [file, success, msg] = urlwrite (urlfile, tmpfile);
       if (! success)
-        error ("unpack: could not get \"%s\": %s", urlfile, msg);
+        error ('unpack: could not get "%s": %s', urlfile, msg);
       endif
     endif
 
@@ -102,7 +102,7 @@
   cfile = canonicalize_file_name (file);
 
   if (isempty (cfile))
-    error ("unpack: file \"%s\" not found", file);
+    error ('unpack: file "%s" not found', file);
   else
     file = cfile;
   endif
@@ -112,40 +112,44 @@
   ## The field names are the file extension without periods.
   ## The first cell is what is executed to unpack an archive verbosely.
   ## The second cell is what is executed to unpack an archive quietly.
-  ## The third cell is the function to execute on output to get the
-  ##   files list.
+  ## The third cell is the function to execute on output to get the files list.
   ## The fourth cell indicates if the files may need to be manually moved
-  ##   (i.e. tar and unzip decompress into the current directory while
-  ##   bzip2 and gzip decompress the file at its location).
+  ##   (i.e., tar and unzip decompress into the current directory while
+  ##    bzip2 and gzip decompress the file at its location).
   persistent commandlist;
   if (isempty (commandlist))
-    commandlist.gz = {"gzip -d -v -r \"%s\"", ...
-                      "gzip -d -r \"%s\"", ...
+    commandlist.gz = {'gzip -d -v -r "%s"', ...
+                      'gzip -d -r "%s"', ...
                       @__parse_gzip__, true};
     commandlist.z = commandlist.gz;
-    commandlist.bz2 = {"bzip2 -d -v \"%s\"", ...
-                       "bzip2 -d \"%s\"", ...
+    commandlist.bz2 = {'bzip2 -d -v "%s"', ...
+                       'bzip2 -d "%s"', ...
                        @__parse_bzip2__, true};
     commandlist.bz = commandlist.bz2;
-    commandlist.tar = {"tar xvf \"%s\"", ...
-                       "tar xf \"%s\"", ...
+    commandlist.tar = {'tar xvf "%s"', ...
+                       'tar xf "%s"', ...
                        @__parse_tar__, false};
-    commandlist.targz = {"gzip -d -c \"%s\" | tar xvf -", ...
-                         "gzip -d -c \"%s\" | tar xf -", ...
+    commandlist.targz = {'gzip -d -c "%s" | tar xvf -', ...
+                         'gzip -d -c "%s" | tar xf -', ...
                          @__parse_tar__, false};
     commandlist.tgz = commandlist.targz;
-    commandlist.tarbz2 = {"bzip2 -d -c \"%s\" | tar xvf -", ...
-                          "bzip2 -d -c \"%s\" | tar xf -", ...
+    commandlist.tarbz2 = {'bzip2 -d -c "%s" | tar xvf -', ...
+                          'bzip2 -d -c "%s" | tar xf -', ...
                           @__parse_tar__, false};
     commandlist.tarbz = commandlist.tarbz2;
     commandlist.tbz2 = commandlist.tarbz2;
     commandlist.tbz = commandlist.tarbz2;
-    commandlist.zip = {"unzip \"%s\"", ...
-                       "unzip -q \"%s\"", ...
+    commandlist.zip = {'unzip -n "%s"', ...
+                       'unzip -nq "%s"', ...
                        @__parse_zip__, false};
   endif
 
-  nodotext = ext(! ismember (ext, "."));
+  ## Unzip doesn't actually care about the extension
+  if (strcmp (filetype, "unzip"))
+    nodotext = "zip";
+  else
+    nodotext = ext(ext != '.');
+  endif
 
   origdir = pwd ();
 
@@ -178,7 +182,7 @@
 
   unwind_protect
     cd (dir);
-    [status, output] = system (sprintf (cstrcat (command, " 2>&1"), file));
+    [status, output] = system (sprintf ([command " 2>&1"], file));
   unwind_protect_cleanup
     cd (origdir);
   end_unwind_protect
@@ -189,19 +193,18 @@
   endif
 
   if (nargout > 0 || needmove)
-    ## Trim the last cr if needed.
+    ## Trim the last CR if needed.
     ## FIXME -- will this need to change to a check for "\r\n" for windows?
-    if (output(length (output)) == "\n")
-      output(length (output)) = [];
+    if (output(end) == "\n")
+      output(end) = [];
     endif
     files = parser (ostrsplit (output, "\n"))';
 
     ## Move files if necessary
     if (needmove)
-      [st, msg, msgid] = movefile (files, dir);
+      [st, msg, ~] = movefile (files, dir);
       if (! st)
-        error ("unpack: unable to move files to \"%s\": %s",
-               dir, msg);
+        error ('unpack: unable to move files to "%s": %s', dir, msg);
       endif
 
       ## Fix the names for the files since they were moved.
@@ -222,54 +225,27 @@
   ## Parse the output from zip and unzip.
 
   ## Skip first line which is Archive header
-  output(1) = [];
-  for i = 1:length (output)
-    files{i} = output{i}(14:length (output{i}));
-  endfor
+  files = char (output(2:end));
+  ## Trim constant width prefix and return cell array
+  files = cellstr (files(:,14:end))
 endfunction
 
 function output = __parse_tar__ (output)
-  ## This is a noop, but it makes things simpler for other cases.
+  ## This is a no-op, but it makes things simpler for other cases.
 endfunction
 
 function files = __parse_gzip__ (output)
   ## Parse the output from gzip and gunzip returning the files
   ## commpressed (or decompressed).
 
-  files = {};
-  ## The middle ": " should indicate a good place to start looking for
-  ## the filename.
-  for i = 1:length (output)
-    colons = strfind (output{i}, ":");
-    if (isempty (colons))
-      warning ("unpack:parsing",
-               "Unable to parse line (gzip missing colon):\n%s", output{i});
-    else
-      midcolon = colons(ceil (length (colons)/2));
-      thisstr = output{i}(midcolon+2:length (output{i}));
-      idx = index (thisstr, "with") + 5;
-      if (isempty (idx))
-        warning ("unpack:parsing",
-                 "Unable to parse line (gzip missing with):\n%s", output{i});
-      else
-        files{i} = thisstr(idx:length (thisstr));
-      endif
-    endif
-  endfor
+  files = regexprep (output, '^.+ with (.*)$', '$1');
 endfunction
 
 function files = __parse_bzip2__ (output)
   ## Parse the output from bzip2 and bunzip2 returning the files
   ## commpressed (or decompressed).
 
-  files = {};
-  for i = 1:length (output)
-    ## the -5 is to remove the ".bz2:"
-    endoffilename = rindex (output{i}, ": ") - 5;
-    if (isempty (endoffilename))
-      warning ("unpack:parsing", "Unable to parse line:\n%s", output{i});
-    else
-      files{i} = output{i}(3:endoffilename);
-    endif
-  endfor
+  ## Strip leading blanks and .bz2 extension from file name
+  files = regexprep (output, '^\s+(.*)\.bz2: .*', '$1');
 endfunction
+
--- a/scripts/miscellaneous/version.m
+++ b/scripts/miscellaneous/version.m
@@ -21,8 +21,8 @@
 ## Return the version number of Octave, as a string.
 ##
 ## This is an alias for the function @w{@env{OCTAVE_VERSION}} provided for
-## compatibility
-## @seealso{OCTAVE_VERSION}.
+## compatibility.
+## @seealso{OCTAVE_VERSION}
 ## @end deftypefn
 
 ## Author: jwe
--- a/scripts/miscellaneous/warning_ids.m
+++ b/scripts/miscellaneous/warning_ids.m
@@ -177,7 +177,7 @@
 ## compatibility problems with @sc{matlab}.
 ## By default, the @code{Octave:matlab-incompatible} warning is disabled.
 ## The --traditional or --braindead startup options for Octave may also
-## be of use, @xref{Command Line Options}.
+## be of use, @pxref{Command Line Options}.
 ##
 ## @item Octave:md5sum-file-in-path
 ## By default, the @code{Octave:md5sum-file-in-path} warning is enabled.
--- a/scripts/miscellaneous/xor.m
+++ b/scripts/miscellaneous/xor.m
@@ -18,7 +18,7 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Mapping Function} {@var{z} =} xor (@var{x}, @var{y})
-## Return the `exclusive or' of the entries of @var{x} and @var{y}.
+## Return the @dfn{exclusive or} of the entries of @var{x} and @var{y}.
 ## For boolean expressions @var{x} and @var{y},
 ## @code{xor (@var{x}, @var{y})} is true if and only if one of @var{x} or
 ## @var{y} is true.  Otherwise, for @var{x} and @var{y} both true or both
--- a/scripts/mk-pkg-add
+++ b/scripts/mk-pkg-add
@@ -24,6 +24,8 @@
 
 set -e
 
+SED=${SED:-'sed'}
+
 prefix="$1/"
 shift
 
@@ -32,6 +34,6 @@
   if [ "$arg" = "--" ]; then
     prefix=""
   else
-    sed -n 's/^[#%][#%]* *PKG_ADD: *//p' "$prefix$arg"
+    $SED -n 's/^[#%][#%]* *PKG_ADD: *//p' "$prefix$arg"
   fi
 done
--- a/scripts/optimization/fminbnd.m
+++ b/scripts/optimization/fminbnd.m
@@ -26,7 +26,7 @@
 ## starting interval.  @var{options} is a structure specifying additional
 ## options.  Currently, @code{fminbnd} recognizes these options:
 ## "FunValCheck", "OutputFcn", "TolX", "MaxIter", "MaxFunEvals".  For a
-## description of these options, see @ref{doc-optimset,,optimset}.
+## description of these options, see @ref{XREFoptimset,,optimset}.
 ##
 ## On exit, the function returns @var{x}, the approximate minimum point
 ## and @var{fval}, the function value thereof.
@@ -210,7 +210,7 @@
   iter(1).procedure = "initial";
 
   ## Handle the "Display" option
-  switch displ
+  switch (displ)
     case "iter"
       print_formatted_table (iter);
       print_exit_msg (info, struct("TolX", tolx, "fx", fval));
@@ -259,7 +259,7 @@
 ## Print either a success termination message or bad news
 function print_exit_msg (info, opt=struct())
   printf ("");
-  switch info
+  switch (info)
     case 1
       printf ("Optimization terminated:\n");
       printf (" the current x satisfies the termination criteria using OPTIONS.TolX of %e\n", opt.TolX);
--- a/scripts/optimization/fzero.m
+++ b/scripts/optimization/fzero.m
@@ -42,7 +42,7 @@
 ## Currently, @code{fzero}
 ## recognizes these options: @code{"FunValCheck"}, @code{"OutputFcn"},
 ## @code{"TolX"}, @code{"MaxIter"}, @code{"MaxFunEvals"}.
-## For a description of these options, see @ref{doc-optimset,,optimset}.
+## For a description of these options, see @ref{XREFoptimset,,optimset}.
 ##
 ## On exit, the function returns @var{x}, the approximate zero point
 ## and @var{fval}, the function value thereof.
--- a/scripts/optimization/lsqnonneg.m
+++ b/scripts/optimization/lsqnonneg.m
@@ -32,7 +32,7 @@
 ## optional initial guess for @var{x}.
 ## Currently, @code{lsqnonneg}
 ## recognizes these options: @code{"MaxIter"}, @code{"TolX"}.
-## For a description of these options, see @ref{doc-optimset,,optimset}.
+## For a description of these options, see @ref{XREFoptimset,,optimset}.
 ##
 ## Outputs:
 ##
--- a/scripts/optimization/sqp.m
+++ b/scripts/optimization/sqp.m
@@ -261,7 +261,7 @@
       ## constraint inequality function only without any bounds
       ci_grd = @ (x) fd_ci_jac (x, globals.cifcn);
       if (iscell (cif))
-        switch length (cif)
+        switch (length (cif))
          case {1}
            ci_fun = cif{1};
          case {2}
--- a/scripts/pkg/private/configure_make.m
+++ b/scripts/pkg/private/configure_make.m
@@ -36,41 +36,39 @@
             "OCTAVE"; octave_binary;
             "INSTALLDIR"; desc.dir};
     scenv = sprintf ("%s=\"%s\" ", cenv{:});
+
     ## Configure.
     if (exist (fullfile (src, "configure"), "file"))
       flags = "";
       if (isempty (getenv ("CC")))
-        flags = cstrcat (flags, " CC=\"", mkoctfile ("-p", "CC"), "\"");
+        flags = [flags ' CC="' mkoctfile("-p", "CC") '"'];
       endif
       if (isempty (getenv ("CXX")))
-        flags = cstrcat (flags, " CXX=\"", mkoctfile ("-p", "CXX"), "\"");
+        flags = [flags ' CXX="' mkoctfile("-p", "CXX") '"'];
       endif
       if (isempty (getenv ("AR")))
-        flags = cstrcat (flags, " AR=\"", mkoctfile ("-p", "AR"), "\"");
+        flags = [flags ' AR="' mkoctfile("-p", "AR") '"'];
       endif
       if (isempty (getenv ("RANLIB")))
-        flags = cstrcat (flags, " RANLIB=\"", mkoctfile ("-p", "RANLIB"), "\"");
+        flags = [flags ' RANLIB="' mkoctfile("-p", "RANLIB") '"'];
       endif
-      [status, output] = shell (cstrcat ("cd '", src, "'; ", scenv,
-                                         "./configure --prefix=\"",
-                                         desc.dir, "\"", flags));
+      cmd = ["cd '" src "'; " ...
+             scenv "./configure --prefix=\"" desc.dir "\"" flags];
+      [status, output] = shell (cmd, verbose);
       if (status != 0)
         rmdir (desc.dir, "s");
-        error ("the configure script returned the following error: %s", output);
-      elseif (verbose)
-        printf ("%s", output);
+        disp (output);
+        error ("pkg: error running the configure script for %s.", desc.name);
       endif
-
     endif
 
     ## Make.
     if (exist (fullfile (src, "Makefile"), "file"))
-      [status, output] = shell (cstrcat (scenv, "make -C '", src, "'"));
+      [status, output] = shell ([scenv "make -C '" src "'"], verbose);
       if (status != 0)
         rmdir (desc.dir, "s");
-        error ("'make' returned the following error: %s", output);
-      elseif (verbose)
-        printf ("%s", output);
+        disp (output);
+        error ("pkg: error running `make' for the %s package.", desc.name);
       endif
     endif
 
--- a/scripts/pkg/private/create_pkgadddel.m
+++ b/scripts/pkg/private/create_pkgadddel.m
@@ -29,8 +29,8 @@
   ## architecture dependent directory so that the autoload/mfilename
   ## commands work as expected. The only part that doesn't is the
   ## part in the main directory.
-  archdir = fullfile (getarchprefix (desc, global_install), cstrcat (desc.name,
-                      "-", desc.version), getarch ());
+  archdir = fullfile (getarchprefix (desc, global_install), 
+                      [desc.name "-" desc.version], getarch ());
   if (exist (getarchdir (desc, global_install), "dir"))
     archpkg = fullfile (getarchdir (desc, global_install), nm);
     archfid = fopen (archpkg, "at");
--- a/scripts/pkg/private/extract_pkg.m
+++ b/scripts/pkg/private/extract_pkg.m
@@ -31,12 +31,12 @@
       if (ln > 0)
         t = regexp (ln, pat, "tokens");
         if (! isempty (t))
-          pkg = cstrcat (pkg, "\n", t{1}{1});
+          pkg = [pkg "\n" t{1}{1}];
         endif
       endif
     endwhile
     if (! isempty (pkg))
-      pkg = cstrcat (pkg, "\n");
+      pkg = [pkg "\n"];
     endif
     fclose (fid);
   endif
--- a/scripts/pkg/private/fix_depends.m
+++ b/scripts/pkg/private/fix_depends.m
@@ -28,38 +28,40 @@
 function deps_cell = fix_depends (depends)
   deps = strtrim (ostrsplit (tolower (depends), ","));
   deps_cell = cell (1, length (deps));
+  dep_pat = ...
+  '\s*(?<name>\w+)+\s*(\(\s*(?<op>[<>=]+)\s*(?<ver>\d+\.\d+(\.\d+)*)\s*\))*\s*';
 
   ## For each dependency.
   for i = 1:length (deps)
     dep = deps{i};
-    lpar = find (dep == "(");
-    rpar = find (dep == ")");
-    ## Does the dependency specify a version
-    ## Example: package(>= version).
-    if (length (lpar) == 1 && length (rpar) == 1)
-      package = tolower (strtrim (dep(1:lpar-1)));
-      sub = dep(lpar(1)+1:rpar(1)-1);
-      parts = strsplit (sub, " ", true);
-      if (length (parts) != 2)
-        error ("incorrect syntax for dependency '%s' in the DESCRIPTION file\n",
-               dep);
+    [start, nm] = regexp (dep, dep_pat, 'start', 'names');
+    ## Is the dependency specified 
+    ## in the correct format?
+    if (! isempty (start))
+      package = tolower (strtrim (nm.name));
+      ## Does the dependency specify a version
+      ## Example: package(>= version).
+      if (! isempty (nm.ver))
+        operator = nm.op;
+        if (! any (strcmp (operator, {">", ">=", "<=", "<", "=="})))
+          error ("unsupported operator: %s", operator);
+        endif
+        version = fix_version (nm.ver);
+        ## If no version is specified for the dependency
+        ## we say that the version should be greater than
+        ## or equal to "0.0.0".
+      else
+        package = tolower (strtrim (dep));
+        operator = ">=";
+        version  = "0.0.0";
       endif
-      operator = parts{1};
-      if (! any (strcmp (operator, {">", ">=", "<=", "<", "=="})))
-        error ("unsupported operator: %s", operator);
-      endif
-      version  = fix_version (parts{2});
-
-  ## If no version is specified for the dependency
-  ## we say that the version should be greater than
-  ## or equal to "0.0.0".
-  else
-    package = tolower (strtrim (dep));
-    operator = ">=";
-    version  = "0.0.0";
-  endif
-  deps_cell{i} = struct ("package", package, "operator", operator,
-                         "version", version);
+      deps_cell{i} = struct ("package", package, 
+                             "operator", operator,
+                             "version", version);
+    else
+      error ("incorrect syntax for dependency '%s' in the DESCRIPTION file\n",
+             dep);
+    endif
   endfor
 endfunction
 
--- a/scripts/pkg/private/fix_version.m
+++ b/scripts/pkg/private/fix_version.m
@@ -25,23 +25,17 @@
 ## Make sure the version string v is a valid x.y.z version string
 ## Examples: "0.1" => "0.1.0", "monkey" => error(...).
 function out = fix_version (v)
-  dots = find (v == ".");
-  if (length (dots) == 1)
-    major = str2num (v(1:dots-1));
-    minor = str2num (v(dots+1:end));
-    if (length (major) != 0 && length (minor) != 0)
-      out = sprintf ("%d.%d.0", major, minor);
-      return;
+
+  if (regexp (v, '^\d+(\.\d+){1,2}$') == 1)
+    parts = ostrsplit (v, '.', true);
+    if (numel (parts) == 2)
+      out = strcat (v, ".0");
+    else
+      out = v;
     endif
-  elseif (length (dots) == 2)
-    major = str2num (v(1:dots(1)-1));
-    minor = str2num (v(dots(1)+1:dots(2)-1));
-    rev = str2num (v(dots(2)+1:end));
-    if (length (major) != 0 && length (minor) != 0 && length (rev) != 0)
-      out = sprintf ("%d.%d.%d", major, minor, rev);
-      return;
-    endif
+  else
+    error ("bad version string: %s", v);
   endif
-  error ("bad version string: %s", v);
+
 endfunction
 
--- a/scripts/pkg/private/generate_lookfor_cache.m
+++ b/scripts/pkg/private/generate_lookfor_cache.m
@@ -25,7 +25,7 @@
 function generate_lookfor_cache (desc)
   dirs = strtrim (ostrsplit (genpath (desc.dir), pathsep ()));
   for i = 1 : length (dirs)
-    gen_doc_cache (fullfile (dirs{i}, "doc-cache"), dirs{i});
+    doc_cache_create (fullfile (dirs{i}, "doc-cache"), dirs{i});
   endfor
 endfunction
 
--- a/scripts/pkg/private/get_description.m
+++ b/scripts/pkg/private/get_description.m
@@ -38,7 +38,7 @@
     elseif (isspace (line(1)))
       ## Continuation lines
       if (exist ("keyword", "var") && isfield (desc, keyword))
-        desc.(keyword) = cstrcat (desc.(keyword), " ", deblank (line));
+        desc.(keyword) = [desc.(keyword) " " deblank(line)];
       endif
     else
       ## Keyword/value pair
--- a/scripts/pkg/private/get_forge_pkg.m
+++ b/scripts/pkg/private/get_forge_pkg.m
@@ -53,7 +53,7 @@
       if (nargout > 1)
         # Build download string.
         pkg_file = sprintf ("%s-%s.tar.gz", name, ver);
-        url = cstrcat ("http://packages.octave.org/download/", pkg_file);
+        url = ["http://packages.octave.org/download/" pkg_file];
         ## Verify that the package string exists on the page.
         if (isempty (strfind (html, pkg_file)))
           warning ("get_forge_pkg: download URL not verified");
--- a/scripts/pkg/private/getarch.m
+++ b/scripts/pkg/private/getarch.m
@@ -23,8 +23,8 @@
 ## @end deftypefn
 
 function arch = getarch ()
-  persistent _arch = cstrcat (octave_config_info ("canonical_host_type"),
-                              "-", octave_config_info ("api_version"));
+  persistent _arch = [octave_config_info("canonical_host_type"), "-", ...
+                      octave_config_info("api_version")];
   arch = _arch;
 endfunction
 
--- a/scripts/pkg/private/getarchprefix.m
+++ b/scripts/pkg/private/getarchprefix.m
@@ -25,7 +25,7 @@
 function archprefix = getarchprefix (desc, global_install)
   if (global_install)
     archprefix = fullfile (octave_config_info ("libdir"), "octave",
-                           "packages", cstrcat (desc.name, "-", desc.version));
+                           "packages", [desc.name "-" desc.version]);
   else
     archprefix = desc.dir;
   endif
--- a/scripts/pkg/private/install.m
+++ b/scripts/pkg/private/install.m
@@ -121,11 +121,10 @@
         endif
 
         ## Set default installation directory.
-        desc.dir = fullfile (prefix, cstrcat (desc.name, "-", desc.version));
+        desc.dir = fullfile (prefix, [desc.name "-" desc.version]);
 
         ## Set default architectire dependent installation directory.
-        desc.archprefix = fullfile (archprefix, cstrcat (desc.name, "-",
-                                                         desc.version));
+        desc.archprefix = fullfile (archprefix, [desc.name "-" desc.version]);
 
         ## Save desc.
         descriptions{end+1} = desc;
@@ -172,9 +171,8 @@
         ok = false;
         for i = 1:length (bad_deps)
           dep = bad_deps{i};
-          error_text = cstrcat (error_text, " ", desc.name, " needs ",
-                               dep.package, " ", dep.operator, " ",
-                               dep.version, "\n");
+          error_text = [error_text " " desc.name " needs " ...
+                        dep.package " " dep.operator " " dep.version "\n"];
         endfor
       endif
     endfor
--- a/scripts/pkg/private/installed_packages.m
+++ b/scripts/pkg/private/installed_packages.m
@@ -140,10 +140,9 @@
       first_char = length (cur_dir) - max_dir_length + 4;
       first_filesep = strfind (cur_dir(first_char:end), filesep ());
       if (! isempty (first_filesep))
-        cur_dir = cstrcat ("...",
-                          cur_dir((first_char + first_filesep(1) - 1):end));
+        cur_dir = ["..." cur_dir((first_char + first_filesep(1) - 1):end)];
       else
-        cur_dir = cstrcat ("...", cur_dir(first_char:end));
+        cur_dir = ["..." cur_dir(first_char:end)];
       endif
     endif
     if (installed_pkgs_lst{idx(i)}.loaded)
--- a/scripts/pkg/private/load_packages_and_dependencies.m
+++ b/scripts/pkg/private/load_packages_and_dependencies.m
@@ -31,13 +31,13 @@
     ndir = installed_pkgs_lst{i}.dir;
     dirs{end+1} = ndir;
     if (exist (fullfile (dirs{end}, "bin"), "dir"))
-      execpath = cstrcat (execpath, pathsep (), fullfile (dirs{end}, "bin"));
+      execpath = [execpath pathsep() fullfile(dirs{end}, "bin")];
     endif
     tmpdir = getarchdir (installed_pkgs_lst{i});
     if (exist (tmpdir, "dir"))
       dirs{end + 1} = tmpdir;
       if (exist (fullfile (dirs{end}, "bin"), "dir"))
-        execpath = cstrcat (execpath, pathsep (), fullfile (dirs{end}, "bin"));
+        execpath = [execpath pathsep() fullfile(dirs{end}, "bin")];
       endif
     endif
   endfor
--- a/scripts/pkg/private/rebuild.m
+++ b/scripts/pkg/private/rebuild.m
@@ -35,7 +35,7 @@
     wd = pwd ();
     unwind_protect
       cd (prefix);
-      dirlist = glob (cellfun(@(x) cstrcat (x, '-*'), files, 'uniformoutput', 0));
+      dirlist = glob (cellfun(@(x) [x '-*'], files, 'uniformoutput', 0));
     unwind_protect_cleanup
       cd (wd);
     end_unwind_protect
@@ -49,8 +49,7 @@
     if (exist (descfile, "file"))
       desc = get_description (descfile);
       desc.dir = fullfile (prefix, dirlist{k});
-      desc.archprefix = fullfile (archprefix, cstrcat (desc.name, "-",
-                                  desc.version));
+      desc.archprefix = fullfile (archprefix, [desc.name "-" desc.version]);
       if (auto != 0)
         if (exist (fullfile (desc.dir, "packinfo", ".autoload"), "file"))
           unlink (fullfile (desc.dir, "packinfo", ".autoload"));
--- a/scripts/pkg/private/repackage.m
+++ b/scripts/pkg/private/repackage.m
@@ -44,8 +44,8 @@
       if (exist (fullfile (pack.name, "inst", "bin"), "dir"))
         movefile (fullfile (pack.name, "inst", "bin"), pack.name);
       endif
-      archdir = fullfile (pack.archprefix, cstrcat (pack.name, "-",
-                          pack.version), getarch ());
+      archdir = fullfile (pack.archprefix, [pack.name "-" pack.version],
+                          getarch ());
       if (exist (archdir, "dir"))
         if (exist (fullfile (pack.name, "inst", "PKG_ADD"), "file"))
           unlink (fullfile (pack.name, "inst", "PKG_ADD"));
@@ -71,7 +71,7 @@
                     fullfile (pack.name, "PKG_DEL"));
         endif
       endif
-      tfile = cstrcat (pack.name, "-", pack.version, ".tar");
+      tfile = [pack.name "-" pack.version ".tar"];
       tar (tfile, pack.name);
       try
         gzip (tfile);
--- a/scripts/pkg/private/shell.m
+++ b/scripts/pkg/private/shell.m
@@ -17,30 +17,40 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{status}, @var{output}] =} shell (@var{cmd})
-## Undocumented internal function.
-## @end deftypefn
+## Executes a shell command. In the end it calls system() but in case of
+## windows will first check if sh.exe works.
+##
+## If VERBOSE is true, it will prints the output to STDOUT in real time and
+## the second output argument will be an empty string. Otherwise, it will
+## contain the output of the execeuted command.
 
-function [status, output] = shell (cmd)
+function [status, output] = shell (cmd, verbose)
   persistent have_sh;
 
   cmd = strrep (cmd, "\\", "/");
   if (ispc () && ! isunix ())
     if (isempty (have_sh))
-      if (system ("sh.exe -c \"exit\""))
+      if (system ('sh.exe -c "exit"'))
         have_sh = false;
       else
         have_sh = true;
       endif
     endif
     if (have_sh)
-      [status, output] = system (cstrcat ("sh.exe -c \"", cmd, "\""));
+      cmd = ['sh.exe -c "' cmd '"'];
     else
-      error ("Can not find the command shell");
+      error ("pkg: unable to find the command shell.");
     endif
+  endif
+  ## if verbose, we want to display the output in real time. To do this, we
+  ## must call system with 1 output argument. But then the variable `output'
+  ## won't exist. So we initialize it empty. If an error does occur, and we
+  ## are verbose we will return an empty string but it's all fine since
+  ## the error message has already been displayed.
+  output = "";
+  if (verbose)
+    [status] = system (cmd);
   else
     [status, output] = system (cmd);
   endif
 endfunction
-
--- a/scripts/pkg/private/uninstall.m
+++ b/scripts/pkg/private/uninstall.m
@@ -81,9 +81,8 @@
       if (! isempty (bad_deps))
         for i = 1:length (bad_deps)
           dep = bad_deps{i};
-          error_text = cstrcat (error_text, " ", desc.name, " needs ",
-                               dep.package, " ", dep.operator, " ",
-                               dep.version, "\n");
+          error_text = [error_text " " desc.name " needs " ...
+                        dep.package " " dep.operator " " dep.version "\n"];
         endfor
       endif
     endfor
--- a/scripts/pkg/private/write_index.m
+++ b/scripts/pkg/private/write_index.m
@@ -74,7 +74,7 @@
   if (! isfield (desc, "categories"))
     error ("the DESCRIPTION file must have a Categories field, when no INDEX file is given");
   endif
-  categories = cstrtrim (strsplit (desc.categories, ","));
+  categories = strtrim (strsplit (desc.categories, ","));
   if (length (categories) < 1)
     error ("the Category field is empty");
   endif
--- a/scripts/plot/__plt_get_axis_arg__.m
+++ b/scripts/plot/__plt_get_axis_arg__.m
@@ -25,52 +25,36 @@
 
 function [h, varargin, narg] = __plt_get_axis_arg__ (caller, varargin)
 
-  if (islogical (caller))
-    nogca = caller;
-    caller = varargin{1};
-    varargin(1) = [];
-  else
-    nogca = false;
-  endif
-
-  ## Figure handles are integers, but object handles are non-integer,
-  ## therefore ignore integer scalars.
-  if (nargin > 1 && length (varargin) > 0 && isnumeric (varargin{1})
-      && numel (varargin{1}) == 1 && ishandle (varargin{1}(1))
-      && varargin{1}(1) != 0 && ! isfigure (varargin{1}(1)))
-    tmp = varargin{1};
-    obj = get (tmp);
-    if ((strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
-        || strcmp (obj.type, "hggroup"))
-      h = ancestor (tmp, "axes");
+  h = [];
+  parent = find (strcmpi (varargin, "parent"), 1);
+  
+  ## Look for numeric scalar which is a graphics handle but not the
+  ## Root Figure (0) or an ordinary figure (integer).
+  if (numel (varargin) > 0 && isnumeric (varargin{1})
+      && isscalar (varargin{1}) && ishandle (varargin{1})
+      && varargin{1} != 0 && ! isfigure (varargin{1}))
+    htmp = varargin{1};
+    obj = get (htmp);
+    if (strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
+      h = htmp;
       varargin(1) = [];
-      if (isempty (varargin))
-        varargin = {};
-      endif
     else
       error ("%s: expecting first argument to be axes handle", caller);
     endif
-  else
-    f = get (0, "currentfigure");
-    if (isempty (f))
-      h = [];
-    else
-      h = get (f, "currentaxes");
-    endif
-    if (isempty (h))
-      if (nogca)
-        h = NaN;
+  elseif (numel (varargin) > 1 && ! isempty (parent))
+    if (parent < numel (varargin) && ishandle (varargin{parent+1}))
+      htmp = varargin{parent+1};
+      obj = get (htmp);
+      if (strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
+        h = htmp;
+        varargin(parent:parent+1) = [];
       else
-        h = gca ();
+        ## 'parent' property for some other type like hggroup
+        h = ancestor (htmp, "axes");
       endif
+    else
+      error ("%s: expecting parent value to be axes handle", caller);
     endif
-    if (nargin < 2)
-      varargin = {};
-    endif
-  endif
-
-  if (ishandle (h) && strcmp (get (h, "nextplot"), "new"))
-    h = axes ();
   endif
 
   narg = length (varargin);
--- a/scripts/plot/allchild.m
+++ b/scripts/plot/allchild.m
@@ -44,9 +44,8 @@
 
 
 %!testif HAVE_FLTK
-%! toolkit = graphics_toolkit ();
-%! graphics_toolkit ("fltk");
-%! hf = figure ("visible", "off");
+%! toolkit = graphics_toolkit ("fltk");
+%! hf = figure ("visible", "off")
 %! unwind_protect
 %!   l = line;
 %!   assert (get (allchild (hf),"type"),{"axes"; "uimenu"; "uimenu"; "uimenu"});
--- a/scripts/plot/ancestor.m
+++ b/scripts/plot/ancestor.m
@@ -26,51 +26,55 @@
 ##
 ## If the handle object @var{h} is of type @var{type}, return @var{h}.
 ##
-## If @code{"toplevel"} is given as a 3rd argument, return the highest
+## If @code{"toplevel"} is given as a third argument, return the highest
 ## parent in the object hierarchy that matches the condition, instead
 ## of the first (nearest) one.
-## @seealso{get, set}
+## @seealso{findobj, findall, allchild}
 ## @end deftypefn
 
 function p = ancestor (h, type, toplevel)
 
-  if (nargin == 2 || nargin == 3)
-    p = cell (numel (h), 1);
-    if (ischar (type))
-      type = { type };
+  if (nargin < 2 || nargin > 3)
+    print_usage ();
+  endif
+
+  if (ischar (type))
+    type = { type };
+  elseif (! iscellstr (type))
+    error ("ancestor: TYPE must be a string or cell array of strings");
+  endif
+
+  find_first = true;
+  if (nargin == 3)
+    if (ischar (toplevel) && strcmpi (toplevel, "toplevel"))
+      find_first = false;
+    else
+      error ('ancestor: third argument must be "toplevel"');
     endif
-    if (iscellstr (type))
-      look_first = true;
-      if (nargin == 3)
-        if (ischar (toplevel) && strcmpi (toplevel, "toplevel"))
-          look_first = false;
-        else
-          error ("ancestor: third argument must be \"toplevel\"");
+  endif
+
+  if (isempty (h))
+    p = [];
+  else
+    p = cell (numel (h), 1);
+    h = num2cell (h);
+    for nh = 1:numel (h)
+      while (true)
+        if (isempty (h{nh}) || ! ishandle (h{nh}))
+          break;
         endif
-      endif
-      h = num2cell (h);
-      for nh = 1:numel (h)
-        while (true)
-          if (isempty (h{nh}) || ! ishandle (h{nh}))
+        if (any (strcmpi (get (h{nh}, "type"), type)))
+          p{nh} = h{nh};
+          if (find_first)
             break;
           endif
-          if (any (strcmpi (get (h{nh}, "type"), type)))
-            p{nh} = h{nh};
-            if (look_first)
-              break;
-            endif
-          endif
-          h{nh} = get (h{nh}, "Parent");
-        endwhile
-      endfor
-      if (nh == 1)
-        p = p{1};
-      endif
-    else
-      error ("ancestor: second argument must be a string or cell array of strings");
+        endif
+        h{nh} = get (h{nh}, "parent");
+      endwhile
+    endfor
+    if (nh == 1)
+      p = p{1};
     endif
-  else
-    print_usage ();
   endif
 
 endfunction
@@ -79,10 +83,34 @@
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
-%!   l = line;
-%!   assert (ancestor (l, "axes"), gca);
-%!   assert (ancestor (l, "figure"), hf);
+%!   hl = line;
+%!   assert (ancestor (hl, "axes"), gca);
+%!   assert (ancestor (hl, "figure"), hf);
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
 
+%!test
+%! hf = figure ("visible", "off");
+%! unwind_protect
+%!    hg1 = hggroup ("parent", gca);
+%!    hg2 = hggroup ("parent", hg1);
+%!    hl = line ("parent", hg2);
+%!    assert (ancestor (hl, "line"), hl);
+%!    assert (ancestor (hl, "axes"), gca);
+%!    assert (ancestor (hl, "figure"), hf);
+%!    assert (ancestor (hl, "hggroup"), hg2);
+%!    assert (ancestor (hl, "hggroup", "toplevel"), hg1);
+%!    assert (ancestor (hl, {"hggroup", "axes"}), hg2);
+%!    assert (ancestor (hl, {"hggroup", "axes"}, "toplevel"), gca);
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+
+%!assert (ancestor ([], "axes"), [])
+
+%!error ancestor ()
+%!error ancestor (1,2,3)
+%!error <TYPE must be a string> ancestor (1,2)
+%!error <third argument must be "toplevel"> ancestor (1, "axes", "foo")
+
--- a/scripts/plot/area.m
+++ b/scripts/plot/area.m
@@ -22,12 +22,12 @@
 ## @deftypefnx {Function File} {} area (@var{x}, @var{y})
 ## @deftypefnx {Function File} {} area (@dots{}, @var{lvl})
 ## @deftypefnx {Function File} {} area (@dots{}, @var{prop}, @var{val}, @dots{})
-## @deftypefnx {Function File} {} area (@var{h}, @dots{})
+## @deftypefnx {Function File} {} area (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} area (@dots{})
 ## Area plot of the columns of @var{y}.  This shows the
-## contributions of each column value to the row sum.  It is functionally similar to
-## @code{plot (@var{x}, cumsum (@var{y}, 2))}, except that the area under
-## the curve is shaded.
+## contributions of each column value to the row sum.  It is functionally
+## similar to @code{plot (@var{x}, cumsum (@var{y}, 2))}, except that the
+## area under the curve is shaded.
 ##
 ## If the @var{x} argument is omitted it defaults to 
 ## @code{1 : rows (@var{y})}.  A value @var{lvl} can be defined that determines
@@ -37,6 +37,9 @@
 ## Additional arguments to the @code{area} function are passed directly to
 ## @code{patch}.  
 ##
+## If the first argument is an axis handle @var{hax}, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a graphics handle to the hggroup
 ## object representing the area patch objects.  The "BaseValue" property
 ## of the hggroup can be used to adjust the level where shading begins.
@@ -44,17 +47,19 @@
 ## Example: Verify identity sin^2 + cos^2 = 1
 ##
 ## @example
+## @group
 ## t = linspace (0, 2*pi, 100)';
 ## y = [sin(t).^2, cos(t).^2)];
 ## area (t, y);
 ## legend ('sin^2', 'cos^2', 'location', 'NorthEastOutside');  
+## @end group
 ## @end example
 ## @seealso{plot, patch}
 ## @end deftypefn
 
 function h = area (varargin)
 
-  [ax, varargin, nargin] = __plt_get_axis_arg__ ("area", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("area", varargin{:});
 
   if (nargin == 0)
     print_usage ();
@@ -89,26 +94,27 @@
   if (nargin >= idx)
     args = {varargin{idx:end}};
   endif
-  newplot ();
   if (isvector (y))
     y = y(:);
   endif
   if (isempty (x))
     x = repmat ([1:rows(y)]', 1, columns (y));
   elseif (isvector (x))
-    x = repmat (x(:),  1, columns (y));
+    x = repmat (x(:), 1, columns (y));
   endif
 
-  oldax = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (ax);
-    tmp = __area__ (ax, x, y, bv, args{:});
+    hax = newplot (hax);
+    htmp = __area__ (hax, x, y, bv, args{:});
   unwind_protect_cleanup
-    axes (oldax);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
@@ -225,6 +231,7 @@
 %! t = linspace (0, 2*pi, 100)';
 %! y = [sin(t).^2, cos(t).^2];
 %! area (t, y);
+%! axis tight
 %! legend ('sin^2', 'cos^2', 'location', 'NorthEastOutside');  
 
 %!demo
@@ -240,3 +247,8 @@
 %! set (h, 'basevalue', -1);
 %! title ({'Parabola y = x^2 -1';'BaseValue = -1'});
 
+%!demo
+%! x = 0:10;
+%! y = rand (size (x));
+%! h = area (x, y);
+%! set (h, 'ydata', sort (get (h, 'ydata')))
--- a/scripts/plot/axes.m
+++ b/scripts/plot/axes.m
@@ -20,7 +20,21 @@
 ## @deftypefn  {Function File} {} axes ()
 ## @deftypefnx {Function File} {} axes (@var{property}, @var{value}, @dots{})
 ## @deftypefnx {Function File} {} axes (@var{h})
-## Create an axes object and return a handle to it.
+## @deftypefnx {Function File} {@var{h} =} axes (@dots{})
+## Create an axes object and return a handle to it, or set the current
+## axes to @var{h}.
+##
+## Called without any arguments, or with @var{property}/@var{value} pairs,
+## contruct a new axes.  For accepted properties and corresponding
+## values, see @code{set} function.
+##
+## Called with a single axes handle argument @var{h}, the function makes
+## @var{h} the current axis.  It also restacks the axes in the
+## corresponding figure so that @var{h} is the first entry in the list
+## of children.  This causes @var{h} to be displayed on top of any other
+## axes objects (Z-order stacking).
+## 
+## @seealso {gca, set, get}
 ## @end deftypefn
 
 ## Author: jwe
@@ -36,27 +50,33 @@
     else
       cf = gcf ();
     endif
-    tmp = __go_axes__ (cf, varargin{:});
-    if (__is_handle_visible__ (tmp))
-      set (ancestor (cf, "figure"), "currentaxes", tmp);
+    htmp = __go_axes__ (cf, varargin{:});
+    if (__is_handle_visible__ (htmp))
+      set (ancestor (cf, "figure"), "currentaxes", htmp);
     endif
   else
-    ## arg is axes handle.
-    tmp = varargin{1};
-    if (length (tmp) == 1 && ishandle (tmp)
-        && strcmp (get (tmp, "type"), "axes"))
-      if (__is_handle_visible__ (tmp))
-        parent = ancestor (tmp, "figure");
+    ## ARG is axes handle.
+    htmp = varargin{1};
+    if (isscalar (htmp) && ishandle (htmp)
+        && strcmp (get (htmp, "type"), "axes"))
+      if (__is_handle_visible__ (htmp))
+        parent = ancestor (htmp, "figure");
         set (0, "currentfigure", parent);
-        set (parent, "currentaxes", tmp);
+        set (parent, "currentaxes", htmp);
+
+        ## restack
+        ch = get (parent, "children")(:);
+        idx = (ch == htmp);
+        ch = [ch(idx); ch(!idx)];
+        set (parent, "children", ch);
       endif
     else
-      error ("axes: expecting argument to be a scalar axes handle");
+      error ("axes: H must be a scalar axes handle");
     endif
   endif
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/axis.m
+++ b/scripts/plot/axis.m
@@ -130,26 +130,29 @@
 
 ## Author: jwe
 
-function varargout = axis (varargin)
+function limits = axis (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("axis", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("axis", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    varargout = cell (max (nargin == 0, nargout), 1);
-    if (isempty (varargout))
-      __axis__ (h, varargin{:});
+    if (isempty (hax))
+      hax = gca ();
+    endif
+    if (nargin == 0)
+      limits = __axis__ (hax, varargin{:});
     else
-      [varargout{:}] = __axis__ (h, varargin{:});
+      __axis__ (hax, varargin{:});
     endif
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
 endfunction
 
-function curr_axis = __axis__ (ca, ax, varargin)
+function limits = __axis__ (ca, ax, varargin)
 
   if (nargin == 1)
     if (nargout == 0)
@@ -159,10 +162,10 @@
       ylim = get (ca, "ylim");
       view = get (ca, "view");
       if (view(2) == 90)
-        curr_axis = [xlim, ylim];
+        limits = [xlim, ylim];
       else
         zlim = get (ca, "zlim");
-        curr_axis = [xlim, ylim, zlim];
+        limits = [xlim, ylim, zlim];
       endif
     endif
 
@@ -344,11 +347,27 @@
 
 function __do_tight_option__ (ca)
 
-  set (ca,
-       "xlim", __get_tight_lims__ (ca, "x"),
-       "ylim", __get_tight_lims__ (ca, "y"));
+  xlim = __get_tight_lims__ (ca, "x");
+  if (all (xlim == 0))
+    xlim = eps () * [-1 1];
+  elseif (diff (xlim == 0))
+    xlim = xlim .* (1 + eps () * [-1, 1]);
+  endif
+  ylim = __get_tight_lims__ (ca, "y");
+  if (all (ylim == 0))
+    ylim = eps () * [-1 1];
+  elseif (diff (ylim == 0))
+    ylim = ylim .* (1 + eps () * [-1, 1]);
+  endif
+  set (ca, "xlim", xlim, "ylim", ylim)
   if (__calc_dimensions__ (ca) > 2)
-    set (ca, "zlim", __get_tight_lims__ (ca, "z"));
+    zlim = __get_tight_lims__ (ca, "z");
+    if (all (zlim == 0))
+      zlim = eps () * [-1 1];
+    elseif (diff (zlim == 0))
+      zlim = zlim .* (1 + eps () * [-1, 1]);
+    endif
+    set (ca, "zlim", zlim);
   endif
 
 endfunction
@@ -471,7 +490,7 @@
 %!  axis ('autox');
 %!
 %! subplot (325);
-%!  plot (t, x, ';sine [0:2p];');
+%!  plot (t, x, ';sine [0:2pi];');
 %!  title ('axes at [3 6 0 1], then autoy');
 %!  axis ([3,6,0,1]);
 %!  axis ('autoy');
@@ -486,7 +505,7 @@
 %! x = 0:0.1:10;
 %! plot (x, sin(x));
 %! axis image;
-%! title ('image');
+%! title ({'image', 'equivalent to "tight" & "equal"'});
 
 %!demo
 %! clf;
--- a/scripts/plot/bar.m
+++ b/scripts/plot/bar.m
@@ -21,8 +21,8 @@
 ## @deftypefnx {Function File} {} bar (@var{y})
 ## @deftypefnx {Function File} {} bar (@var{x}, @var{y}, @var{w})
 ## @deftypefnx {Function File} {} bar (@var{x}, @var{y}, @var{w}, @var{style})
+## @deftypefnx {Function File} {} bar (@var{h}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} bar (@dots{}, @var{prop}, @var{val})
-## @deftypefnx {Function File} {} bar (@var{h}, @dots{})
 ## Produce a bar graph from two vectors of x-y data.
 ##
 ## If only one argument is given, @var{y}, it is taken as a vector of y-values
@@ -36,6 +36,9 @@
 ## argument, which can take the values @code{"grouped"} (the default),
 ## or @code{"stacked"}.
 ##
+## Passing the optional input handle @var{h} will draw the resulting plot
+## in the specified handle.
+##
 ## The optional return value @var{h} is a handle to the created "bar series"
 ## object with one handle per column of the variable @var{y}.  This
 ## series allows common elements of the group of bar series objects to
@@ -52,8 +55,6 @@
 ## @noindent
 ## changes the position on the base of all of the bar series.
 ##
-## The optional input handle @var{h} allows an axis handle to be passed.
-##
 ## The bar graph's appearance may be modified by specifying property/value
 ## pairs.  The following example modifies the face and edge colors.
 ##
@@ -97,8 +98,9 @@
 
 %!demo
 %! clf;
-%! y = rand (10, 1);
-%! bar (y);
+%! y = rand (11, 1);
+%! h = bar (y);
+%! set (h, 'ydata', sort (rand (11, 1)));
 
 %!demo
 %! clf;
--- a/scripts/plot/barh.m
+++ b/scripts/plot/barh.m
@@ -21,8 +21,9 @@
 ## @deftypefnx {Function File} {} barh (@var{y})
 ## @deftypefnx {Function File} {} barh (@var{x}, @var{y}, @var{w})
 ## @deftypefnx {Function File} {} barh (@var{x}, @var{y}, @var{w}, @var{style})
-## @deftypefnx {Function File} {@var{h} =} barh (@dots{}, @var{prop}, @var{val})
+## @deftypefnx {Function File} {} barh (@dots{}, @var{prop}, @var{val})
 ## @deftypefnx {Function File} {} barh (@var{h}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} barh (@dots{})
 ## Produce a horizontal bar graph from two vectors of x-y data.
 ##
 ## If only one argument is given, it is taken as a vector of y-values
@@ -36,7 +37,9 @@
 ## argument, which can take the values @code{"grouped"} (the default),
 ## or @code{"stacked"}.
 ##
-## The optional input handle @var{h} allows an axis handle to be passed.
+## Passing the optional input handle @var{h} will draw the resulting plot
+## in the specified handle.
+## 
 ## Properties of the patch graphics object can be changed using
 ## @var{prop}, @var{val} pairs.
 ##
--- a/scripts/plot/box.m
+++ b/scripts/plot/box.m
@@ -17,11 +17,12 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} box
-## @deftypefnx {Function File} {} box ("on")
-## @deftypefnx {Function File} {} box ("off")
+## @deftypefn  {Function File} {} box on
+## @deftypefnx {Function File} {} box off
+## @deftypefnx {Function File} {} box
 ## @deftypefnx {Function File} {} box (@var{hax}, @dots{})
-## Control the display of a border around the plot.
+## Control the display of a border around the current axis.
+##
 ## The argument may be either @code{"on"} or @code{"off"}.  If it is
 ## omitted, the current box state is toggled.
 ##
@@ -34,10 +35,14 @@
 
 function box (varargin)
 
-  [ax, varargin, nargs] = __plt_get_axis_arg__ ("box", varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("box", varargin{:});
 
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
   if (nargs == 0)
-    box_state = get (ax, "box");
+    box_state = get (hax, "box");
     if (strcmp (box_state, "on"))
       box_state = "off";
     else
@@ -60,6 +65,6 @@
     print_usage ();
   endif
 
-  set (ax, "box", box_state);
+  set (hax, "box", box_state);
 
 endfunction
--- a/scripts/plot/caxis.m
+++ b/scripts/plot/caxis.m
@@ -18,8 +18,11 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} caxis (@var{limits})
-## @deftypefnx {Function File} {} caxis (@var{h}, @dots{})
-## Set color axis limits for plots.
+## @deftypefnx {Function File} {} caxis ("auto")
+## @deftypefnx {Function File} {} caxis ("manual")
+## @deftypefnx {Function File} {} caxis (@var{hax}, @dots{})
+## @deftypefnx {Function File} {@var{limits} =} caxis ()
+## Query or set color axis limits for plots.
 ##
 ## The argument @var{limits} should be a 2-element vector specifying the
 ## lower and upper limits to assign to the first and last value in the
@@ -29,39 +32,39 @@
 ## If @var{limits} is "auto", then automatic colormap scaling is applied,
 ## whereas if @var{limits} is "manual" the colormap scaling is set to manual.
 ##
-## Called without any arguments to current color axis limits are returned.
+## Called without arguments the current color axis limits are returned.
 ##
-## If an axes handle is passed as the first argument, then operate on
+## If an axes handle @var{hax} is passed as the first argument then operate on
 ## this axes rather than the current axes.
+## @seealso{colormap}
 ## @end deftypefn
 
-function varargout = caxis (varargin)
+function limits = caxis (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("caxis", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("caxis", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    varargout = cell (max (nargin == 0, nargout), 1);
-    if (isempty (varargout))
-      __caxis__ (h, varargin{:});
+    if (isempty (hax))
+      hax = gca ();
+    endif
+    if (nargin == 0)
+      limits = __caxis__ (hax);
     else
-      [varargout{:}] = __caxis__ (h, varargin{:});
+      __caxis__ (hax, varargin{:});
     endif
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
 endfunction
 
-function [cmin, cmax] = __caxis__ (ca, ax, varargin)
+function limits = __caxis__ (ca, ax, varargin)
 
   if (nargin == 1)
-    cmin = get (ca, "clim");
-    if (nargout > 1)
-      cmax = cmin(2);
-      cmin = cmin(1);
-    endif
+    limits = get (ca, "clim");
   elseif (ischar (ax))
     if (strcmpi (ax, "auto"))
       set (ca, "climmode", "auto");
@@ -70,16 +73,16 @@
     endif
   elseif (isvector (ax))
     len = length (ax);
-
     if (len != 2)
       error ("caxis: expecting vector with 2 elements");
     endif
 
     set (ca, "clim", [ax(1), ax(2)]);
   else
-    error ("caxis: expecting no args, a string or a 2 element vector");
+    error ("caxis: expecting no args, a string, or a 2 element vector");
   endif
 
+  ## FIXME: Why should it be possible to call __caxis__ recursively?
   if (nargin > 2)
     __caxis__ (ca, varargin{:})';
   endif
--- a/scripts/plot/cla.m
+++ b/scripts/plot/cla.m
@@ -17,14 +17,20 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} cla ()
-## @deftypefnx {Function File} {} cla ("reset")
+## @deftypefn  {Function File} {} cla
+## @deftypefnx {Function File} {} cla reset
 ## @deftypefnx {Function File} {} cla (@var{hax})
 ## @deftypefnx {Function File} {} cla (@var{hax}, "reset")
-## Delete the children of the current axes with visible handles.
-## If @var{hax} is specified and is an axes object handle, operate on it
-## instead of the current axes.  If the optional argument @code{"reset"}
-## is specified, also delete the children with hidden handles.
+## Clear the current axes by deleting child graphic objects with visible
+## handles (HandleVisibility = "on").
+##
+## If the optional argument "reset" is specified, delete all child objects
+## including those with hidden handles and reset all axis properties to
+## their defaults.  However, the following properties are not reset:
+## Position, Units.
+##
+## If an axes object handle @var{hax} is specified, operate on it instead of
+## the current axes.
 ## @seealso{clf}
 ## @end deftypefn
 
@@ -35,58 +41,38 @@
 
   if (nargin > 2)
     print_usage ();
-  elseif (nargin > 1)
-    if (ishandle (varargin{1})
-        && strcmp (get (varargin{1}, "type"), "axes")
-        && ischar (varargin{2}) && strcmpi (varargin{2}, "reset"))
-      oldhax = gca;
-      hax = varargin{1};
-      do_reset = true;
-    else
-      print_usage ();
-    endif
+  elseif (nargin == 0)
+    hax = gca;
+    do_reset = false;
   elseif (nargin == 1)
-    if (ishandle (varargin{1})
+    if (isscalar (varargin{1}) && ishandle (varargin{1})
         && strcmp (get (varargin{1}, "type"), "axes"))
-      oldhax = gca;
       hax = varargin{1};
       do_reset = false;
     elseif (ischar (varargin{1}) && strcmpi (varargin{1}, "reset"))
       hax = gca;
-      oldhax = hax;
       do_reset = true;
     else
       print_usage ();
     endif
   else
-    hax = gca;
-    oldhax = hax;
-    do_reset = false;
-  endif
-
-  hc = get (hax, "children");
-
-  if (! do_reset && ! isempty (hc))
-    hc = findobj (hc, "flat", "visible", "on");
-    hc = setdiff (hc, hax);
+    if (isscalar (varargin{1}) && ishandle (varargin{1})
+        && strcmp (get (varargin{1}, "type"), "axes")
+        && ischar (varargin{2}) && strcmpi (varargin{2}, "reset"))
+      hax = varargin{1};
+      do_reset = true;
+    else
+      print_usage ();
+    endif
   endif
 
-  if (! isempty (hc))
-    ## Delete the children of the axis.
-    delete (hc);
+  if (! do_reset)
+    delete (get (hax, "children"));
+  else
+    __go_axes_init__ (hax, "replace");
+    __request_drawnow__ ();
   endif
 
-  ## FIXME: The defaults should be "reset()" below, but so far there is
-  ## no method to determine the defaults, much less return an object's
-  ## properties to their default values.  Instead make a close
-  ## approximation.
-
-  axes (hax);
-  axis ("auto");
-
-  ## Set the current axis back to where it was upon entry.
-  axes (oldhax);
-
 endfunction
 
 
@@ -102,3 +88,22 @@
 %! end_unwind_protect
 %! assert (numel (kids), 0);
 
+%!test
+%! hf = figure ("visible", "off");
+%! unwind_protect
+%!   hax = gca;
+%!   plot (hax, 1:10);
+%!   set (hax, "interpreter", "tex");
+%!   cla (hax);
+%!   kids = get (hax, "children");
+%!   assert (numel (kids), 0);
+%!   assert (get (hax, "interpreter"), "tex");
+%!   plot (hax, 1:10);
+%!   cla (hax, "reset");
+%!   kids = get (hax, "children");
+%!   assert (numel (kids), 0);
+%!   assert (get (hax, "interpreter"), "none");
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+
--- a/scripts/plot/clf.m
+++ b/scripts/plot/clf.m
@@ -17,16 +17,23 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} clf ()
-## @deftypefnx {Function File} {} clf ("reset")
+## @deftypefn  {Function File} {} clf
+## @deftypefnx {Function File} {} clf reset
 ## @deftypefnx {Function File} {} clf (@var{hfig})
 ## @deftypefnx {Function File} {} clf (@var{hfig}, "reset")
 ## @deftypefnx {Function File} {@var{h} =} clf (@dots{})
-## Clear the current figure window.  @code{clf} operates by deleting child
-## graphics objects with visible handles (@code{handlevisibility} = on).
-## If @var{hfig} is specified operate on it instead of the current figure.
-## If the optional argument @code{"reset"} is specified, all objects including
-## those with hidden handles are deleted.
+## Clear the current figure window.
+## 
+## @code{clf} operates by deleting child graphics objects with visible
+## handles (HandleVisibility = "on").
+##
+## If the optional argument "reset" is specified, delete all child objects
+## including those with hidden handles and reset all figure properties to
+## their defaults.  However, the following properties are not reset:
+## Position, Units, PaperPosition, PaperUnits.
+##
+## If the first argument @var{hfig} is a figure handle, then operate on
+## this figure rather than the current figure returned by @code{gcf}.
 ## 
 ## The optional return value @var{h} is the graphics handle of the figure
 ## window that was cleared.
@@ -35,51 +42,44 @@
 
 ## Author: jwe
 
-function retval = clf (varargin)
+function h = clf (varargin)
 
   if (nargin > 2)
     print_usage ();
-  elseif (nargin > 1)
-    if (isfigure (varargin{1}) && ischar (varargin{2})
-        && strcmpi (varargin{2}, "reset"))
-      oldfig = gcf;
+  elseif (nargin == 0)
+    hfig = gcf;
+    do_reset = false;
+  elseif (nargin == 1)
+    if (isscalar (varargin{1}) && isfigure (varargin{1}))
+      hfig = varargin{1};
+      do_reset = false;
+    elseif (ischar (varargin{1}) && strcmpi (varargin{1}, "reset"))
+      hfig = gcf;
+      do_reset = true;
+    else
+      print_usage ();
+    endif
+  else
+    if (isscalar (varargin{1}) && isfigure (varargin{1})
+        && ischar (varargin{2}) && strcmpi (varargin{2}, "reset"))
       hfig = varargin{1};
       do_reset = true;
     else
       print_usage ();
     endif
-  elseif (nargin == 1)
-    if (isfigure (varargin{1}))
-      oldfig = gcf;
-      hfig = varargin{1};
-      do_reset = false;
-    elseif (ischar (varargin{1}) && strcmpi (varargin{1}, "reset"))
-      hfig = gcf;
-      oldfig = hfig;
-      do_reset = true;
-    else
-      print_usage ();
-    endif
-  else
-    hfig = gcf;
-    oldfig = hfig;
-    do_reset = false;
   endif
 
   if (do_reset)
     ## Select all the children, including the one with hidden handles.
-    hc = allchild (hfig);
+    delete (allchild (hfig));
     reset (hfig);
   else
     ## Select only the chilren with visible handles.
-    hc = get (hfig, "children");
+    delete (get (hfig, "children"));
   endif
 
-  ## Delete the children.
-  delete (hc);
-
   if (nargout > 0)
-    retval = hfig;
+    h = hfig;
   endif
 
 endfunction
@@ -90,6 +90,8 @@
 %! unwind_protect
 %!   l = line;
 %!   assert (! isempty (get (gcf, "children")));
+%!   clf;
+%!   assert (isempty (get (gcf, "children")));
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
@@ -103,3 +105,20 @@
 %!   close (hf);
 %! end_unwind_protect
 
+%!xtest
+%! hf = figure ("visible", "off");
+%! unwind_protect
+%!   plot (1:10);
+%!   set (hf, "papertype", "tabloid");
+%!   clf (hf);
+%!   assert (isempty (get (gcf, "children")));
+%!   assert (get (hf, "papertype"), "tabloid");
+%!   plot (1:10);
+%!   clf (hf, "reset");
+%!   kids = get (hf, "children");
+%!   assert (isempty (get (gcf, "children")));
+%!   assert (get (hf, "papertype"), "usletter");
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+
--- a/scripts/plot/close.m
+++ b/scripts/plot/close.m
@@ -18,13 +18,30 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Command} {} close
-## @deftypefnx {Command} {} close (@var{n})
+## @deftypefnx {Command} {} close (@var{h})
 ## @deftypefnx {Command} {} close all
 ## @deftypefnx {Command} {} close all hidden
-## Close figure window(s) by calling the function specified by the
-## @code{"closerequestfcn"} property for each figure.  By default, the
-## function @code{closereq} is used.
-## @seealso{closereq}
+## Close figure window(s).
+##
+## @code{close} operates by calling the function specified by the
+## @code{"closerequestfcn"} property for each figure.  By default, the function
+## @code{closereq} is used.
+##
+## When called with no arguments, close the current figure.  This is equivalent
+## to @code{close (gcf)}.  If the input is a graphic handle @var{h} or vector
+## of graphics handles then close each figure in @var{h}.
+##
+## If the argument "all" is given then all figures with visible handles
+## (HandleVisibility = "on") are closed.
+##
+## If the argument "all hidden" is given then all figures, including hidden
+## ones, are closed.
+##
+## Implementation Note: @code{close} calls a function to dispose of the figure.
+## It is possible that the function will delay or abort removing the figure.
+## To remove a figure without calling any callback functions use @code{delete}.
+##
+## @seealso{closereq, delete}
 ## @end deftypefn
 
 ## Author: jwe
@@ -34,29 +51,30 @@
 
   figs = [];
 
-  if (nargin == 0)
-    ## Close current figure.  Don't use gcf because that will open a new
-    ## plot window if one doesn't exist.
+  if (nargin > 2)
+    print_usage ();
+  elseif (nargin == 0)
+    ## Close current figure.
+    ## Can't use gcf because it opens a new plot window if one does not exist.
     figs = get (0, "currentfigure");
-    if (! isempty (figs) && figs == 0)
+    if (figs == 0)  # don't close root figure
       figs = [];
     endif
   elseif (nargin == 1)
     if (ischar (arg1) && strcmpi (arg1, "all"))
-      close_all_figures (false);
+      figs = (get (0, "children"))';
+      figs = figs(isfigure (figs));
     elseif (isfigure (arg1))
       figs = arg1;
     elseif (isempty (arg1))
       figs = [];
     else
-      error ("close: expecting argument to be \"all\" or a figure handle");
+      error ('close: expecting argument to be "all" or a figure handle');
     endif
-  elseif (nargin == 2
-          && ischar (arg1) && strcmpi (arg1, "all")
+  elseif (   ischar (arg1) && strcmpi (arg1, "all")
           && ischar (arg2) && strcmpi (arg2, "hidden"))
-    close_all_figures (true);
-  else
-    print_usage ();
+    figs = (allchild (0))';
+    figs = figs(isfigure (figs));
   endif
 
   for h = figs
@@ -69,17 +87,6 @@
 
 endfunction
 
-function close_all_figures (close_hidden_figs)
-
-  while (! isempty (fig = get (0, "currentfigure")))
-    ## handlevisibility = get (fig, "handlevisibility")
-    ## if (close_hidden_figs || ! strcmpi (handlevisibility, "off"))
-    close (fig);
-    ## endif
-  endwhile
-
-endfunction
-
 
 %!test
 %! hf = figure ("visible", "off");
--- a/scripts/plot/colorbar.m
+++ b/scripts/plot/colorbar.m
@@ -17,9 +17,22 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} colorbar (@var{s})
-## @deftypefnx {Function File} {} colorbar ("peer", @var{h}, @dots{})
-## Add a colorbar to the current axes.  Valid values for @var{s} are
+## @deftypefn  {Function File} {} colorbar
+## @deftypefnx {Function File} {} colorbar (@var{loc})
+## @deftypefnx {Function File} {} colorbar (@var{delete_option})
+## @deftypefnx {Function File} {} colorbar (@var{hcb}, @dots{})
+## @deftypefnx {Function File} {} colorbar (@var{hax}, @dots{})
+## @deftypefnx {Function File} {} colorbar (@dots{}, "peer", @var{hax}, @dots{})
+## @deftypefnx {Function File} {} colorbar (@dots{}, "location", @var{loc}, @dots{})
+## @deftypefnx {Function File} {} colorbar (@dots{}, @var{prop}, @var{val}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} colorbar (@dots{})
+## Add a colorbar to the current axes.
+##
+## A colorbar displays the current colormap along with numerical rulings
+## so that the color scale can be interpreted.
+##
+## The optional input @var{loc} determines the location of the colorbar.
+## Valid values for @var{loc} are
 ##
 ## @table @asis
 ## @item "EastOutside"
@@ -45,52 +58,105 @@
 ##
 ## @item "South"
 ## Place the colorbar at the bottom of the plot.
-##
-## @item "Off", "None"
-## Remove any existing colorbar from the plot.
 ## @end table
 ##
+## To remove a colorbar from a plot use any one of the following keywords for
+## the @var{delete_option}: "delete", "hide", "off".
+## 
 ## If the argument "peer" is given, then the following argument is treated
-## as the axes handle on which to add the colorbar.
+## as the axes handle in which to add the colorbar.  Alternatively, 
+## If the first argument @var{hax} is an axes handle, then the colorbar is
+## added to this axis, rather than the current axes returned by @code{gca}.
+##
+## If the first argument @var{hcb} is a handle to a colorbar object, then
+## operate on this colorbar directly.
+##
+## Additional property/value pairs are passed directly to the underlying axes
+## object.
+##
+## The optional return value @var{h} is a graphics handle to the created
+## colorbar object.
+##
+## Implementation Note: A colorbar is created as an additional axes to the
+## current figure with the "tag" property set to "colorbar".  The created
+## axes object has the extra property "location" which controls the positioning
+## of the colorbar.
+## @seealso{colormap}
 ## @end deftypefn
 
 function h = colorbar (varargin)
-  ax = [];
-  loc = "eastoutside";
+
+  [hcb, varargin, nargin] = __plt_get_axis_arg__ ("colorbar", varargin{:});
+
+  if (hcb && ! strcmp (get (hcb, "tag"), "colorbar"))
+    ax = hcb;
+    hcb = [];
+  else
+    ax = [];
+  endif
+  loc = "";
   args = {};
   deleting = false;
 
   i = 1;
   while (i <= nargin)
-    arg = varargin {i++};
+    arg = varargin{i++};
     if (ischar (arg))
-      if (strcmpi (arg, "peer"))
-        if (i > nargin)
-          error ("colorbar: missing axes handle after \"peer\"");
-        else
-          ax = varargin{i++};
-          if (!isscalar (ax) || ! ishandle (ax)
-              || ! strcmp (get (ax, "type"), "axes"))
-            error ("colorbar: expecting an axes handle following \"peer\"");
+      switch (tolower (arg))
+        case "peer"
+          if (i > nargin)
+            error ('colorbar: missing axes handle after "peer"');
+          else
+            ax = varargin{i++};
+            if (! isscalar (ax) || ! ishandle (ax)
+                || ! strcmp (get (ax, "type"), "axes"))
+              error ('colorbar: expecting an axes handle following "peer"');
+            endif
           endif
-        endif
-      elseif (strcmpi (arg, "north") || strcmpi (arg, "south")
-              || strcmpi (arg, "east") || strcmpi (arg, "west")
-              || strcmpi (arg, "northoutside") || strcmpi (arg, "southoutside")
-              || strcmpi (arg, "eastoutside") || strcmpi (arg, "westoutside"))
-        loc = tolower (arg);
-      elseif (strcmpi (arg, "location") && i <= nargin)
-        loc = tolower (varargin{i++});
-      elseif (strcmpi (arg, "off") || strcmpi (arg, "none"))
-        deleting = true;
-      else
-        args{end+1} = arg;
-      endif
+        case {"north", "south", "east", "west",
+              "northoutside", "southoutside", "eastoutside", "westoutside"}
+          loc = tolower (arg);
+        case "location"
+          if (i > nargin)
+            error ('colorbar: missing value after "location"');
+          else
+            loc = tolower (varargin{i++});
+          endif
+        case {"delete", "hide", "off", "none"}
+          deleting = true;
+        otherwise
+          args{end+1} = arg;
+      endswitch
     else
       args{end+1} = arg;
     endif
   endwhile
 
+  ## Handle changes to existing colorbar
+  if (! isempty (hcb))
+    if (deleting)
+      delete (hcb);
+      if (nargout > 0)
+        h = hcb;
+      endif
+      return;
+    else
+      ## FIXME: No listener on location property so have to re-create
+      ##        colorbar whenever an option changes.
+      ##        re-instate this code if listener is developed.
+      # if (! isempty (loc))
+      #   set (hcb, "location", loc);
+      # endif
+      # if (! isempty (args))
+      #   set (hcb, args{:});
+      # endif
+      ax = get (get (hcb, "parent"), "currrentaxes");      
+    endif
+  endif
+    
+  if (isempty (loc))
+    loc = "eastoutside";
+  endif
   if (isempty (ax))
     ax = gca ();
   endif
@@ -107,14 +173,16 @@
   end_unwind_protect
 
   if (! deleting)
-    ## FIXME - Matlab does not require the "position" property to be active.
-    ##         Is there a way to determine the plotbox position for the
-    ##         gnuplot graphics toolkit with the outerposition is active?
+    ## FIXME: Matlab does not require the "position" property to be active.
+    ##        Is there a way to determine the plotbox position for the
+    ##        gnuplot graphics toolkit with the outerposition is active?
     set (ax, "activepositionproperty", "position");
     obj = get (ax);
-    obj.__my_handle__ = ax;
+    obj.__cbar_hax__ = ax;
     position = obj.position;
-    clen = rows (get (get (ax, "parent"), "colormap"));
+    ## FIXME: Should this be ancestor to accommodate hggroups?
+    hpar = get (ax, "parent");  
+    clen = rows (get (hpar, "colormap"));
     cext = get (ax, "clim");
     cdiff = (cext(2) - cext(1)) / clen / 2;
     cmin = cext(1) + cdiff;
@@ -124,10 +192,10 @@
         __position_colorbox__ (loc, obj, ancestor (ax, "figure"));
     set (ax, "position", pos);
 
-    cax = __go_axes__ (get (ax, "parent"), "tag", "colorbar",
-                       "handlevisibility", "on",
-                       "activepositionproperty", "position",
-                       "position", cpos);
+    cax = __go_axes__ (hpar, "tag", "colorbar",
+                             "handlevisibility", "on",
+                             "activepositionproperty", "position",
+                             "position", cpos);
     addproperty ("location", cax, "radio",
                  "eastoutside|east|westoutside|west|northoutside|north|southoutside|south",
                  loc);
@@ -137,38 +205,41 @@
       hi = image (cax, [0,1], [cmin, cmax], [1 : clen]');
       if (mirror)
         set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
-             "ylim", cext, "ylimmode", "manual",
-             "yaxislocation", "right", args{:});
+                  "ylim", cext, "ylimmode", "manual",
+                  "yaxislocation", "right", args{:});
       else
         set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
-             "ylim", cext, "ylimmode", "manual",
-             "yaxislocation", "left", args{:});
+                  "ylim", cext, "ylimmode", "manual",
+                  "yaxislocation", "left", args{:});
       endif
     else
       hi = image (cax, [cmin, cmax], [0,1], [1 : clen]);
       if (mirror)
         set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
-             "xlim", cext, "xlimmode", "manual",
-             "xaxislocation", "top", args{:});
+                  "xlim", cext, "xlimmode", "manual",
+                  "xaxislocation", "top", args{:});
       else
         set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
-             "xlim", cext, "xlimmode", "manual",
-             "xaxislocation", "bottom", args{:});
+                  "xlim", cext, "xlimmode", "manual",
+                  "xaxislocation", "bottom", args{:});
       endif
     endif
 
-    ctext = text (0, 0, "", "tag", "colorbar","visible", "off",
-                  "handlevisibility", "off", "xliminclude", "off",
-                  "yliminclude", "off", "zliminclude", "off",
+    ## Dummy object placed in axis to delete colorbar when axis is deleted.
+    ctext = text (0, 0, "", "tag", "colorbar",
+                  "visible", "off", "handlevisibility", "off",
+                  "xliminclude", "off", "yliminclude", "off",
+                  "zliminclude", "off",
                   "deletefcn", {@deletecolorbar, cax, obj});
 
     set (cax, "deletefcn", {@resetaxis, ax, obj});
 
+    addlistener (hpar, "colormap", {@update_colorbar_cmap, hi, vertical, clen});
     addlistener (ax, "clim", {@update_colorbar_clim, hi, vertical});
+    addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax, obj});
+    addlistener (ax, "dataaspectratiomode", {@update_colorbar_axis, cax, obj});
     addlistener (ax, "plotboxaspectratio", {@update_colorbar_axis, cax, obj});
     addlistener (ax, "plotboxaspectratiomode", {@update_colorbar_axis, cax, obj});
-    addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax, obj});
-    addlistener (ax, "dataaspectratiomode", {@update_colorbar_axis, cax, obj});
     addlistener (ax, "position", {@update_colorbar_axis, cax, obj});
 
   endif
@@ -176,42 +247,55 @@
   if (nargout > 0)
     h = cax;
   endif
+
 endfunction
 
 function deletecolorbar (h, d, hc, orig_props)
   ## Don't delete the colorbar and reset the axis size if the
   ## parent figure is being deleted.
   if (ishandle (hc) && strcmp (get (hc, "type"), "axes")
-      && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off")))
+      && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
     if (strcmp (get (hc, "beingdeleted"), "off"))
       delete (hc);
     endif
     if (!isempty (ancestor (h, "axes"))
         && strcmp (get (ancestor (h, "axes"), "beingdeleted"), "off"))
-      set (ancestor (h, "axes"), "position", orig_props.position, ...
-                            "outerposition", orig_props.outerposition, ...
-                    "activepositionproperty", orig_props.activepositionproperty);
+      ax = ancestor (h, "axes");
+      units = get (ax, "units");
+      set (ax, "units", orig_props.units);
+      set (ancestor (h, "axes"), "position", orig_props.position,
+                            "outerposition", orig_props.outerposition,
+                   "activepositionproperty", orig_props.activepositionproperty);
+      set (ax, "units", units);
     endif
   endif
 endfunction
 
 function resetaxis (cax, d, ax, orig_props)
   if (ishandle (ax) && strcmp (get (ax, "type"), "axes"))
+    ## FIXME: Probably don't want to delete everyone's listeners on colormap.
+    dellistener (get (ax, "parent"), "colormap");
+    dellistener (ax, "clim");
+    dellistener (ax, "dataaspectratio");
+    dellistener (ax, "dataaspectratiomode");
+    dellistener (ax, "plotboxaspectratio");
+    dellistener (ax, "plotboxaspectratiomode");
     dellistener (ax, "position");
+
     units = get (ax, "units");
     set (ax, "units", orig_props.units);
-    set (ax, "position", orig_props.position, ...
-             "outerposition", orig_props.outerposition, ...
+    set (ax, "position", orig_props.position,
+             "outerposition", orig_props.outerposition,
              "activepositionproperty", orig_props.activepositionproperty);
     set (ax, "units", units);
   endif
 endfunction
 
-function update_colorbar_clim (h, d, hi, vert)
-  if (ishandle (h) && strcmp (get (h, "type"), "image")
-      && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off")))
-    clen = rows (get (get (h, "parent"), "colormap"));
-    cext = get (h, "clim");
+function update_colorbar_clim (hax, d, hi, vert)
+  if (ishandle (hax) && strcmp (get (hax, "type"), "axes")
+      && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
+    clen = rows (get (get (hax, "parent"), "colormap"));
+    cext = get (hax, "clim");
     cdiff = (cext(2) - cext(1)) / clen / 2;
     cmin = cext(1) + cdiff;
     cmax = cext(2) - cdiff;
@@ -226,13 +310,32 @@
   endif
 endfunction
 
+function update_colorbar_cmap (hf, d, hi, vert, init_sz)
+  persistent sz = init_sz;
+
+  if (ishandle (hf) && strcmp (get (hf, "type"), "figure")
+      && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
+    clen = rows (get (hf, "colormap"));
+    if (clen != sz)
+      if (vert)
+        set (hi, "cdata", [1:clen]');
+      else
+        set (hi, "cdata", [1:clen]);
+      endif
+      sz = clen;
+      ## Also update limits on axis or there will be white gaps
+      update_colorbar_clim (get (hi, "parent"), d, hi, vert);
+    endif
+  endif
+endfunction
+
 function update_colorbar_axis (h, d, cax, orig_props)
 
   if (ishandle (cax) && strcmp (get (cax, "type"), "axes")
       && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off")))
     loc = get (cax, "location");
     obj = get (h);
-    obj.__my_handle__ = h;
+    obj.__cbar_hax__ = h;
     obj.position = orig_props.position;
     obj.outerposition = orig_props.outerposition;
     [pos, cpos, vertical, mirror] =  ...
@@ -241,18 +344,18 @@
     if (vertical)
       if (mirror)
         set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
-             "yaxislocation", "right", "position", cpos);
+                  "yaxislocation", "right", "position", cpos);
       else
         set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
-             "yaxislocation", "left", "position", cpos);
+                  "yaxislocation", "left", "position", cpos);
       endif
     else
       if (mirror)
         set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
-             "xaxislocation", "top", "position", cpos);
+                  "xaxislocation", "top", "position", cpos);
       else
         set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
-             "xaxislocation", "bottom", "position", cpos);
+                  "xaxislocation", "bottom", "position", cpos);
       endif
     endif
 
@@ -265,8 +368,8 @@
   pos = obj.position;
   sz = pos(3:4);
 
-  if (strcmpi (obj.plotboxaspectratiomode, "manual")
-      || strcmpi (obj.dataaspectratiomode, "manual"))
+  if (strcmp (obj.plotboxaspectratiomode, "manual")
+      || strcmp (obj.dataaspectratiomode, "manual"))
     if (isempty (strfind (cbox, "outside")))
       scale = 1.0;
     else
@@ -340,8 +443,8 @@
 
   cpos = [origin, sz];
 
-  if (strcmpi (obj.plotboxaspectratiomode, "manual")
-      || strcmpi (obj.dataaspectratiomode, "manual"))
+  if (strcmp (obj.plotboxaspectratiomode, "manual")
+      || strcmp (obj.dataaspectratiomode, "manual"))
     obj.position = pos;
     actual_pos = __actual_axis_position__ (obj);
     if (strfind (cbox, "outside"))
--- a/scripts/plot/comet.m
+++ b/scripts/plot/comet.m
@@ -20,17 +20,18 @@
 ## @deftypefn  {Function File} {} comet (@var{y})
 ## @deftypefnx {Function File} {} comet (@var{x}, @var{y})
 ## @deftypefnx {Function File} {} comet (@var{x}, @var{y}, @var{p})
-## @deftypefnx {Function File} {} comet (@var{ax}, @dots{})
+## @deftypefnx {Function File} {} comet (@var{hax}, @dots{})
 ## Produce a simple comet style animation along the trajectory provided by
-## the input coordinate vectors (@var{x}, @var{y}), where @var{x} will default
-## to the indices of @var{y}.
+## the input coordinate vectors (@var{x}, @var{y}).  If @var{x} is not
+## specified it defaults to the indices of @var{y}.
 ##
 ## The speed of the comet may be controlled by @var{p}, which represents the
-## time which passes as the animation passes from one point to the next.  The
-## default for @var{p} is 0.1 seconds.
+## time each point is displayed before moving to the next one.  The default for
+## @var{p} is 0.1 seconds.
 ##
-## If @var{ax} is specified the animation is produced in that axis rather than
-## the @code{gca}.
+## If @var{hax} is specified the animation is produced in that axis rather than
+## the current axis.
+## @seealso{comet3}
 ## @end deftypefn
 
 ## Author: Ben Abbott bpabbott@mac.com
@@ -38,7 +39,7 @@
 
 function comet (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("comet", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("comet", varargin{:});
 
   if (nargin == 0)
     print_usage ();
@@ -56,24 +57,25 @@
     p = varargin{3};
   endif
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
-    theaxis = [min(x), max(x), min(y), max(y)];
+    hax = newplot (hax);
+    limits = [min(x), max(x), min(y), max(y)];
     num = numel (y);
     dn = round (num/10);
     for n = 1:(num+dn);
       m = n - dn;
       m = max ([m, 1]);
       k = min ([n, num]);
-      h = plot (x(1:m), y(1:m), "r", x(m:k), y(m:k), "g", x(k), y(k), "ob");
-      axis (theaxis);
+      plot (hax, x(1:m), y(1:m), "r", x(m:k), y(m:k), "g", x(k), y(k), "ob");
+      axis (hax, limits);
       drawnow ();
       pause (p);
     endfor
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
 endfunction
--- a/scripts/plot/comet3.m
+++ b/scripts/plot/comet3.m
@@ -18,18 +18,20 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} comet3 (@var{z})
+## @deftypefnx {Function File} {} comet3 (@var{x}, @var{y}, @var{z})
 ## @deftypefnx {Function File} {} comet3 (@var{x}, @var{y}, @var{z}, @var{p})
-## @deftypefnx {Function File} {} comet3 (@var{ax}, @dots{})
+## @deftypefnx {Function File} {} comet3 (@var{hax}, @dots{})
 ## Produce a simple comet style animation along the trajectory provided by
-## the input coordinate vectors (@var{x}, @var{y}), where @var{x} will default
-## to the indices of @var{y}.
+## the input coordinate vectors (@var{x}, @var{y}, @var{z}).  If only @var{z}
+## is specified then @var{x}, @var{y} default to the indices of @var{z}.
 ##
 ## The speed of the comet may be controlled by @var{p}, which represents the
-## time which passes as the animation passes from one point to the next.  The
-## default for @var{p} is 0.1 seconds.
+## time each point is displayed before moving to the next one.  The default for
+## @var{p} is 0.1 seconds.
 ##
-## If @var{ax} is specified the animation is produced in that axis rather than
-## the @code{gca}.
+## If @var{hax} is specified the animation is produced in that axis rather than
+## the current axis.
+## @seealso{comet}
 ## @end deftypefn
 
 ## Author: jwe
@@ -37,7 +39,7 @@
 
 function comet3 (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("comet3", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("comet3", varargin{:});
 
   if (nargin == 0 || nargin == 2 || nargin > 4)
     print_usage ();
@@ -57,25 +59,27 @@
     p = varargin{4};
   endif
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
-    theaxis = [min(x), max(x), min(y), max(y), min(z), max(z)];
+    hax = newplot (hax);
+    limits = [min(x), max(x), min(y), max(y), min(z), max(z)];
     num = numel (y);
     dn = round (num/10);
     for n = 1:(num+dn);
       m = n - dn;
       m = max ([m, 1]);
       k = min ([n, num]);
-      h = plot3 (x(1:m), y(1:m), z(1:m), "r", x(m:k), y(m:k), z(m:k), "g",
-                 x(k), y(k), z(k), "ob");
-      axis (theaxis);
+      htmp = plot3 (hax, x(1:m), y(1:m), z(1:m), "r",
+                         x(m:k), y(m:k), z(m:k), "g",
+                         x(k), y(k), z(k), "ob");
+      axis (limits);
       drawnow ();
       pause (p);
     endfor
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
 endfunction
--- a/scripts/plot/compass.m
+++ b/scripts/plot/compass.m
@@ -20,7 +20,7 @@
 ## @deftypefn  {Function File} {} compass (@var{u}, @var{v})
 ## @deftypefnx {Function File} {} compass (@var{z})
 ## @deftypefnx {Function File} {} compass (@dots{}, @var{style})
-## @deftypefnx {Function File} {} compass (@var{h}, @dots{})
+## @deftypefnx {Function File} {} compass (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} compass (@dots{})
 ##
 ## Plot the @code{(@var{u}, @var{v})} components of a vector field emanating
@@ -31,6 +31,9 @@
 ## The style to use for the plot can be defined with a line style @var{style}
 ## in a similar manner to the line styles used with the @code{plot} command.
 ##
+## If the first argument @var{hax} is an axis handle, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a vector of graphics handles to the
 ## line objects representing the drawn vectors.
 ##
@@ -44,11 +47,9 @@
 ## @seealso{polar, quiver, feather, plot}
 ## @end deftypefn
 
-function retval = compass (varargin)
+function h = compass (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("compass", varargin{:});
-
-  arrowsize = 0.25;
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("compass", varargin{:});
 
   if (nargin == 0)
     print_usage ();
@@ -63,6 +64,7 @@
     v = varargin{2}(:).';
   endif
 
+  arrowsize = 0.25;
   line_spec = "b-";
   have_line_spec = false;
   while (ioff <= nargin)
@@ -95,17 +97,18 @@
        ytmp - u * arrowsize / 3];
   [r, p] = cart2pol (x, y);
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
-    hlist = polar (h, r, p, line_spec);
+    hax = newplot (hax);
+    hlist = polar (hax, r, p, line_spec);
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
-    retval = hlist;
+    h = hlist;
   endif
 
 endfunction
--- a/scripts/plot/contour.m
+++ b/scripts/plot/contour.m
@@ -45,22 +45,25 @@
 ## The optional input and output argument @var{h} allows an axis handle to
 ## be passed to @code{contour} and the handles to the contour objects to be
 ## returned.
-## @seealso{contourc, patch, plot}
+## @seealso{contourc, contourf, contour3, patch, plot}
 ## @end deftypefn
 
 ## Author: Shai Ayal <shaiay@users.sourceforge.net>
 
 function [c, h] = contour (varargin)
 
-  [xh, varargin] = __plt_get_axis_arg__ ("contour", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("contour", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (xh);
-    newplot ();
-    [ctmp, htmp] = __contour__ (xh, "none", varargin{:});
+    hax = newplot (hax);
+    
+    [ctmp, htmp] = __contour__ (hax, "none", varargin{:});
+    
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
@@ -94,3 +97,33 @@
 %! contourf (x, y, z, [0.4, 0.4]);
 %! title ('The hole should be filled with the background color');
 
+%!test
+%! hf = figure ("visible", "off");
+%! clf (hf);
+%! unwind_protect
+%!   [x, y, z] = peaks ();
+%!   [c, h] = contour (x, y, z);
+%!   levellist = (-6):6;
+%!   set (h, "levellist", levellist);
+%!   assert (get (h, "levellist"), levellist)
+%!   assert (get (h, "levellistmode"), "manual")
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+
+%!test
+%! hf = figure ("visible", "off");
+%! clf (hf);
+%! unwind_protect
+%!   [x, y, z] = peaks ();
+%!   [c, h] = contour (x, y, z);
+%!   levelstep = 3;
+%!   set (h, "levelstep", levelstep);
+%!   assert (get (h, "levelstep"), levelstep)
+%!   assert (get (h, "levelstepmode"), "manual")
+%!   assert (get (h, "levellist"), (-6):levelstep:6)
+%!   assert (get (h, "levellistmode"), "auto")
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+
--- a/scripts/plot/contour3.m
+++ b/scripts/plot/contour3.m
@@ -33,7 +33,7 @@
 ## @example
 ## @group
 ## contour3 (peaks (19));
-## hold on
+## hold on;
 ## surface (peaks (19), "facecolor", "none", "EdgeColor", "black");
 ## colormap hot;
 ## @end group
@@ -46,24 +46,26 @@
 ## The optional input and output argument @var{h} allows an axis handle to
 ## be passed to @code{contour} and the handles to the contour objects to be
 ## returned.
-## @seealso{contourc, patch, plot}
+## @seealso{contourc, contour, contourf, patch, plot}
 ## @end deftypefn
 
 function [c, h] = contour3 (varargin)
 
-  [xh, varargin, nargin] = __plt_get_axis_arg__ ("contour3", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("contour3", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (xh);
-    newplot ();
-    [ctmp, htmp] = __contour__ (xh, "auto", varargin{:});
+    hax = newplot (hax);
+    
+    [ctmp, htmp] = __contour__ (hax, "auto", varargin{:});
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (! ishold ())
-    set (xh, "view", [-37.5, 30],
+    set (hax, "view", [-37.5, 30],
          "xgrid", "on", "ygrid", "on", "zgrid", "on");
   endif
 
--- a/scripts/plot/contourc.m
+++ b/scripts/plot/contourc.m
@@ -17,12 +17,15 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{c}, @var{lev}] =} contourc (@var{x}, @var{y}, @var{z}, @var{vn})
+## @deftypefn  {Function File} {[@var{c}, @var{lev}] =} contourc (@var{z})
+## @deftypefnx {Function File} {[@var{c}, @var{lev}] =} contourc (@var{z}, @var{vn})
+## @deftypefnx {Function File} {[@var{c}, @var{lev}] =} contourc (@var{x}, @var{y}, @var{z})
+## @deftypefnx {Function File} {[@var{c}, @var{lev}] =} contourc (@var{x}, @var{y}, @var{z}, @var{vn})
 ## Compute isolines (contour lines) of the matrix @var{z}.
-## Parameters @var{x}, @var{y} and @var{vn} are optional.
+## Parameters @var{x}, @var{y}, and @var{vn} are optional.
 ##
 ## The return value @var{lev} is a vector of the contour levels.
-## The return value @var{c} is a 2 by @var{n} matrix containing the
+## The return value @var{c} is a 2x@var{n} matrix containing the
 ## contour lines in the following format
 ##
 ## @example
@@ -37,9 +40,9 @@
 ## length of @var{lenn}.
 ##
 ## If @var{x} and @var{y} are omitted they are taken as the row/column
-## index of @var{z}.  @var{vn} is either a scalar denoting the number of lines
-## to compute or a vector containing the values of the lines.  If only one
-## value is wanted, set @code{@var{vn} = [val, val]};
+## indices of @var{z}.  @var{vn} is either a scalar denoting the number of
+## contour lines to compute or a vector containing the values of the lines.
+## If only one value is desired, set @code{@var{vn} = [val, val]};
 ## If @var{vn} is omitted it defaults to 10.
 ##
 ## For example:
@@ -54,7 +57,7 @@
 ##         2.0000   1.0000   2.0000   2.0000   2.0000   1.5000
 ## @end group
 ## @end example
-## @seealso{contour}
+## @seealso{contour, contourf, contour3}
 ## @end deftypefn
 
 ## Author: Shai Ayal <shaiay@users.sourceforge.net>
--- a/scripts/plot/contourf.m
+++ b/scripts/plot/contourf.m
@@ -18,33 +18,37 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {[@var{c}, @var{h}] =} contourf (@var{x}, @var{y}, @var{z}, @var{lvl})
-## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@var{x}, @var{y}, @var{z}, @var{n})
-## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@var{x}, @var{y}, @var{z})
-## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@var{z}, @var{n})
-## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@var{z}, @var{lvl})
-## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@var{z})
-## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@var{ax}, @dots{})
-## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@dots{}, @var{"property"}, @var{val})
+## @deftypefn  {Function File} {} contourf (@var{x}, @var{y}, @var{z}, @var{lvl})
+## @deftypefnx {Function File} {} contourf (@var{x}, @var{y}, @var{z}, @var{n})
+## @deftypefnx {Function File} {} contourf (@var{x}, @var{y}, @var{z})
+## @deftypefnx {Function File} {} contourf (@var{z}, @var{n})
+## @deftypefnx {Function File} {} contourf (@var{z}, @var{lvl})
+## @deftypefnx {Function File} {} contourf (@var{z})
+## @deftypefnx {Function File} {} contourf (@dots{}, @var{prop}, @var{val})
+## @deftypefnx {Function File} {} contourf (@var{hax}, @dots{})
+## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contourf (@dots{})
 ## Compute and plot filled contours of the matrix @var{z}.
 ## Parameters @var{x}, @var{y} and @var{n} or @var{lvl} are optional.
 ##
+## If @var{x} and @var{y} are omitted they are taken as the row/column
+## indices of @var{z}.  @var{n} is a scalar denoting the number of contour
+## lines to compute.  Alternatively @var{lvl} is a vector containing the
+## contour levels.  If only one value (e.g., lvl0) is desired, set
+## @var{lvl} to [lvl0, lvl0].  If both @var{n} or @var{lvl} are omitted
+## a default value of 10 contour levels is assumed.
+##
+## The appearance of the plot can be customized by passing
+## property/value pairs to the function. 
+##
+## If provided, the filled contours are added to the axes object
+## @var{hax} instead of the current axis.
+##
 ## The return value @var{c} is a 2xn matrix containing the contour lines
-## as described in the help to the contourc function.
+## as described in the documentation on the @code{contourc} function.
 ##
 ## The return value @var{h} is handle-vector to the patch objects creating
 ## the filled contours.
 ##
-## If @var{x} and @var{y} are omitted they are taken as the row/column
-## index of @var{z}.  @var{n} is a scalar denoting the number of lines
-## to compute.  Alternatively @var{lvl} is a vector containing the
-## contour levels.  If only one value (e.g., lvl0) is wanted, set
-## @var{lvl} to [lvl0, lvl0].  If both @var{n} or @var{lvl} are omitted
-## a default value of 10 contour level is assumed.
-##
-## If provided, the filled contours are added to the axes object
-## @var{ax} instead of the current axis.
-##
 ## The following example plots filled contours of the @code{peaks}
 ## function.
 ##
@@ -54,7 +58,7 @@
 ## contourf (x, y, z, -7:9)
 ## @end group
 ## @end example
-## @seealso{contour, contourc, patch}
+## @seealso{contourc, contour, contour3, patch}
 ## @end deftypefn
 
 ## Author: Kai Habel <kai.habel@gmx.de>
@@ -62,16 +66,19 @@
 
 function [c, h] = contourf (varargin)
 
-  [xh, varargin] = __plt_get_axis_arg__ ("contour", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("contour", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (xh);
-    newplot ();
-    [ctmp, htmp] = __contour__ (xh, "none", "fill", "on",
+    hax = newplot (hax);
+    
+    [ctmp, htmp] = __contour__ (hax, "none", "fill", "on",
                                 "linecolor", "black", varargin{:});
+    
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
--- a/scripts/plot/copyobj.m
+++ b/scripts/plot/copyobj.m
@@ -86,24 +86,28 @@
 %!demo
 %! ## FIXME: This demo fails occasionally for an obscure reason.
 %! ## It appears that there is something wrong with Octave code for patches.
-%! hdl = figure (1234);
-%! clf;
-%! subplot (2,2,1);
-%! hold on;
-%! contourf (rand (10, 10));
-%! colorbar;
-%! subplot (2,2,2);
-%! quiver (rand (10, 10), rand (10, 10));
-%! subplot (2,2,3);
-%! colormap (jet (64));
-%! hold on;
-%! sombrero;
-%! colorbar ('peer', gca, 'NorthOutside');
-%! subplot (2,2,4);
-%! imagesc (rand (30, 30));
-%! text (15, 15, 'Rotated text', ...
-%!      'HorizontAlalignment', 'Center', 'Rotation', 30);
-%! hnew = copyobj (hdl);
+%! try
+%!   hdl = figure (1234);
+%!   clf;
+%!   subplot (2,2,1);
+%!   hold on;
+%!   contourf (rand (10, 10));
+%!   colorbar;
+%!   subplot (2,2,2);
+%!   quiver (rand (10, 10), rand (10, 10));
+%!   subplot (2,2,3);
+%!   colormap (jet (64));
+%!   hold on;
+%!   sombrero;
+%!   colorbar ('peer', gca, 'NorthOutside');
+%!   subplot (2,2,4);
+%!   imagesc (rand (30, 30));
+%!   text (15, 15, 'Rotated text', ...
+%!        'HorizontAlalignment', 'Center', 'Rotation', 30);
+%!   hnew = copyobj (hdl);
+%! catch
+%!   close all
+%! end
 
 %!testif HAVE_MAGICK
 %! h1 = figure ();
--- a/scripts/plot/cylinder.m
+++ b/scripts/plot/cylinder.m
@@ -48,8 +48,7 @@
 
 function [xx, yy, zz] = cylinder (varargin)
 
-  [ax, args, nargs] = __plt_get_axis_arg__ ((nargout > 0), "cylinder",
-                                            varargin{:});
+  [hax, args, nargs] = __plt_get_axis_arg__ ("cylinder", varargin{:});
 
   if (nargs == 0)
     n = 20;
@@ -80,7 +79,17 @@
     yy = y;
     zz = z;
   else
-    surf (ax, x, y, z);
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+    unwind_protect
+      hax = newplot (hax);
+    
+      surf (hax, x, y, z);
+      
+    unwind_protect_cleanup
+      if (! isempty (oldfig))
+        set (0, "currentfigure", oldfig);
+      endif
+    end_unwind_protect
   endif
 
 endfunction
--- a/scripts/plot/ellipsoid.m
+++ b/scripts/plot/ellipsoid.m
@@ -31,8 +31,7 @@
 
 function [xx, yy, zz] = ellipsoid (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ((nargout > 0), "ellipsoid",
-                                                varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("ellipsoid", varargin{:});
 
   if (nargin != 6 && nargin != 7)
     print_usage ();
@@ -64,7 +63,17 @@
     yy = y;
     zz = z;
   else
-    surf (h, x, y, z);
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+    unwind_protect
+      hax = newplot (hax);
+    
+      surf (hax, x, y, z);
+      
+    unwind_protect_cleanup
+      if (! isempty (oldfig))
+        set (0, "currentfigure", oldfig);
+      endif
+    end_unwind_protect
   endif
 
 endfunction
--- a/scripts/plot/errorbar.m
+++ b/scripts/plot/errorbar.m
@@ -17,9 +17,12 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} errorbar (@var{args})
-## This function produces two-dimensional plots with errorbars.  Many
-## different combinations of arguments are possible.  The simplest form is
+## @deftypefn  {Function File} {} errorbar (@var{args})
+## @deftypefnx {Function File} {@var{h} =} errorbar (@var{args})
+## Create a two-dimensional plot with errorbars.
+##
+## Many different combinations of arguments are possible.  The simplest
+## form is
 ##
 ## @example
 ## errorbar (@var{y}, @var{ey})
@@ -116,23 +119,25 @@
 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
 ## Keywords: errorbar, plotting
 
-function retval = errorbar (varargin)
+function h = errorbar (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
+
+    htmp = __errcomm__ ("errorbar", hax, varargin{:});
 
-    tmp = __errcomm__ ("errorbar", h, varargin{:});
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
 
-    if (nargout > 0)
-      retval = tmp;
-    endif
-  unwind_protect_cleanup
-    axes (oldh);
-  end_unwind_protect
+  if (nargout > 0)
+    h = htmp;
+  endif
 
 endfunction
 
@@ -152,7 +157,7 @@
 %!demo
 %! clf;
 %! x = 0:0.5:2*pi;
-%! err = x/100;
+%! err = x/30;
 %! y1 = sin (x);
 %! y2 = cos (x);
 %! hg = errorbar (x, y1, err, '~', x, y2, err, '>');
@@ -160,7 +165,7 @@
 %!demo
 %! clf;
 %! x = 0:0.5:2*pi;
-%! err = x/100;
+%! err = x/30;
 %! y1 = sin (x);
 %! y2 = cos (x);
 %! hg = errorbar (x, y1, err, err, '#r', x, y2, err, err, '#~');
@@ -168,7 +173,7 @@
 %!demo
 %! clf;
 %! x = 0:0.5:2*pi;
-%! err = x/100;
+%! err = x/30;
 %! y1 = sin (x);
 %! y2 = cos (x);
 %! hg = errorbar (x, y1, err, err, err, err, '~>', ...
--- a/scripts/plot/ezcontour.m
+++ b/scripts/plot/ezcontour.m
@@ -20,23 +20,28 @@
 ## @deftypefn  {Function File} {} ezcontour (@var{f})
 ## @deftypefnx {Function File} {} ezcontour (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezcontour (@dots{}, @var{n})
-## @deftypefnx {Function File} {} ezcontour (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezcontour (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezcontour (@dots{})
 ##
-## Plot the contour lines of a function.  @var{f} is a string, inline function
-## or function handle with two arguments defining the function.  By default the
-## plot is over the domain @code{-2*pi < @var{x} < 2*pi} and @code{-2*pi <
-## @var{y} < 2*pi} with 60 points in each dimension.
+## Plot the contour lines of a function.
+## 
+## @var{f} is a string, inline function, or function handle with two arguments
+## defining the function.  By default the plot is over the meshed domain
+## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
 ##
 ## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
-## then the minimum and maximum value of @var{x} and @var{y} are specify
-## separately.
+## values of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
+## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}.
 ##
 ## @var{n} is a scalar defining the number of points to use in each dimension.
 ##
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a graphics handle to the created plot.
 ##
+## Example:
+##
 ## @example
 ## @group
 ## f = @@(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2);
@@ -44,19 +49,19 @@
 ## @end group
 ## @end example
 ##
-## @seealso{ezplot, ezcontourf, ezsurfc, ezmeshc}
+## @seealso{contour, ezcontourf, ezplot, ezmeshc, ezsurfc}
 ## @end deftypefn
 
-function retval = ezcontour (varargin)
+function h = ezcontour (varargin)
 
-  [h, needusage] = __ezplot__ ("contour", varargin{:});
+  [htmp, needusage] = __ezplot__ ("contour", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/ezcontourf.m
+++ b/scripts/plot/ezcontourf.m
@@ -20,23 +20,28 @@
 ## @deftypefn  {Function File} {} ezcontourf (@var{f})
 ## @deftypefnx {Function File} {} ezcontourf (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezcontourf (@dots{}, @var{n})
-## @deftypefnx {Function File} {} ezcontourf (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezcontourf (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezcontourf (@dots{})
 ##
-## Plot the filled contour lines of a function.  @var{f} is a string, inline
-## function or function handle with two arguments defining the function.  By
-## default the plot is over the domain @code{-2*pi < @var{x} < 2*pi} and
-## @code{-2*pi < @var{y} < 2*pi} with 60 points in each dimension.
+## Plot the filled contour lines of a function.
+## 
+## @var{f} is a string, inline function, or function handle with two arguments
+## defining the function.  By default the plot is over the meshed domain
+## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
 ##
 ## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
-## then the minimum and maximum value of @var{x} and @var{y} are specify
-## separately.
+## values of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
+## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}.
 ##
 ## @var{n} is a scalar defining the number of points to use in each dimension.
 ##
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a graphics handle to the created plot.
 ##
+## Example:
+##
 ## @example
 ## @group
 ## f = @@(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2);
@@ -44,19 +49,19 @@
 ## @end group
 ## @end example
 ##
-## @seealso{ezplot, ezcontour, ezsurfc, ezmeshc}
+## @seealso{contourf, ezcontour, ezplot, ezmeshc, ezsurfc}
 ## @end deftypefn
 
-function retval = ezcontourf (varargin)
+function h = ezcontourf (varargin)
 
-  [h, needusage] = __ezplot__ ("contourf", varargin{:});
+  [htmp, needusage] = __ezplot__ ("contourf", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/ezmesh.m
+++ b/scripts/plot/ezmesh.m
@@ -22,31 +22,36 @@
 ## @deftypefnx {Function File} {} ezmesh (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezmesh (@dots{}, @var{n})
 ## @deftypefnx {Function File} {} ezmesh (@dots{}, "circ")
-## @deftypefnx {Function File} {} ezmesh (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezmesh (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezmesh (@dots{})
 ##
-## Plot the mesh defined by a function.  @var{f} is a string, inline
-## function or function handle with two arguments defining the function.  By
-## default the plot is over the domain @code{-2*pi < @var{x} < 2*pi} and
-## @code{-2*pi < @var{y} < 2*pi} with 60 points in each dimension.
+## Plot the mesh defined by a function.
 ##
-## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
-## then the minimum and maximum value of @var{x} and @var{y} are specify
-## separately.
-##
-## @var{n} is a scalar defining the number of points to use in each dimension.
+## @var{f} is a string, inline function, or function handle with two arguments
+## defining the function.  By default the plot is over the meshed domain
+## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
 ##
 ## If three functions are passed, then plot the parametrically defined
 ## function @code{[@var{fx} (@var{s}, @var{t}), @var{fy} (@var{s}, @var{t}),
 ## @var{fz} (@var{s}, @var{t})]}.
 ##
+## If @var{dom} is a two element vector, it represents the minimum and maximum
+## values of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
+## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}.
+##
+## @var{n} is a scalar defining the number of points to use in each dimension.
+##
 ## If the argument "circ" is given, then the function is plotted over a disk
 ## centered on the middle of the domain @var{dom}.
 ##
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a graphics handle to the created 
 ## surface object.
 ##
+## Example 1: 2-argument function
+##
 ## @example
 ## @group
 ## f = @@(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2);
@@ -54,7 +59,7 @@
 ## @end group
 ## @end example
 ##
-## An example of a parametrically defined function is
+## Example 2: parametrically defined function
 ##
 ## @example
 ## @group
@@ -65,19 +70,19 @@
 ## @end group
 ## @end example
 ##
-## @seealso{ezplot, ezmeshc, ezsurf, ezsurfc}
+## @seealso{mesh, ezmeshc, ezplot, ezsurf, ezsurfc, hidden}
 ## @end deftypefn
 
-function retval = ezmesh (varargin)
+function h = ezmesh (varargin)
 
-  [h, needusage] = __ezplot__ ("mesh", varargin{:});
+  [htmp, needusage] = __ezplot__ ("mesh", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/ezmeshc.m
+++ b/scripts/plot/ezmeshc.m
@@ -22,25 +22,25 @@
 ## @deftypefnx {Function File} {} ezmeshc (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezmeshc (@dots{}, @var{n})
 ## @deftypefnx {Function File} {} ezmeshc (@dots{}, "circ")
-## @deftypefnx {Function File} {} ezmeshc (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezmeshc (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezmeshc (@dots{})
 ##
-## Plot the mesh and contour lines defined by a function.  @var{f} is a string,
-## inline function or function handle with two arguments defining the function.
-## By default the plot is over the domain @code{-2*pi < @var{x} < 2*pi} and
-## @code{-2*pi < @var{y} < 2*pi} with 60 points in each dimension.
+## Plot the mesh and contour lines defined by a function.
 ##
-## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
-## then the minimum and maximum value of @var{x} and @var{y} are specify
-## separately.
-##
-## @var{n} is a scalar defining the number of points to use in each dimension.
+## @var{f} is a string, inline function, or function handle with two arguments
+## defining the function.  By default the plot is over the meshed domain
+## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
 ##
 ## If three functions are passed, then plot the parametrically defined
 ## function @code{[@var{fx} (@var{s}, @var{t}), @var{fy} (@var{s}, @var{t}),
 ## @var{fz} (@var{s}, @var{t})]}.
 ##
+## If @var{dom} is a two element vector, it represents the minimum and maximum
+## values of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
+## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}.
+##
+## @var{n} is a scalar defining the number of points to use in each dimension.
+##
 ## If the argument "circ" is given, then the function is plotted over a disk
 ## centered on the middle of the domain @var{dom}.
 ##
@@ -48,6 +48,8 @@
 ## handle for the created mesh plot and a second handle for the created contour
 ## plot.
 ##
+## Example: 2-argument function
+##
 ## @example
 ## @group
 ## f = @@(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2);
@@ -55,19 +57,19 @@
 ## @end group
 ## @end example
 ##
-## @seealso{ezplot, ezsurfc, ezsurf, ezmesh}
+## @seealso{meshc, ezmesh, ezplot, ezsurf, ezsurfc, hidden}
 ## @end deftypefn
 
-function retval = ezmeshc (varargin)
+function h = ezmeshc (varargin)
 
-  [h, needusage] = __ezplot__ ("meshc", varargin{:});
+  [htmp, needusage] = __ezplot__ ("meshc", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/ezplot.m
+++ b/scripts/plot/ezplot.m
@@ -18,28 +18,31 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} ezplot (@var{f})
+## @deftypefnx {Function File} {} ezplot (@var{f2v})
 ## @deftypefnx {Function File} {} ezplot (@var{fx}, @var{fy})
 ## @deftypefnx {Function File} {} ezplot (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezplot (@dots{}, @var{n})
-## @deftypefnx {Function File} {} ezplot (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezplot (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezplot (@dots{})
 ##
-## Plot the curve defined by @var{f} in two dimensions.  The function
-## @var{f} may be a string, inline function or function handle and can
-## have either one or two variables.  If @var{f} has one variable, then
+## Plot the 2-D curve defined by the function @var{f}.
+##
+## The function @var{f} may be a string, inline function, or function handle
+## and can have either one or two variables.  If @var{f} has one variable, then
 ## the function is plotted over the domain @code{-2*pi < @var{x} < 2*pi}
 ## with 500 points.
 ##
-## If @var{f} has two variables then @code{@var{f}(@var{x},@var{y}) = 0}
-## is calculated over the meshed domain @code{-2*pi < @var{x} | @var{y}
-## < 2*pi} with 60 by 60 in the mesh.  For example:
+## If @var{f2v} is a function of two variables then the implicit function
+## @code{@var{f}(@var{x},@var{y}) = 0} is calculated over the meshed domain
+## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
+##
+## For example:
 ##
 ## @example
 ## ezplot (@@(@var{x}, @var{y}) @var{x}.^2 - @var{y}.^2 - 1)
 ## @end example
 ##
-## If two functions are passed as strings, inline functions or function
-## handles, then the parametric function
+## If two functions are passed as inputs then the parametric function
 ##
 ## @example
 ## @group
@@ -49,47 +52,57 @@
 ## @end example
 ##
 ## @noindent
-## is plotted over the domain @code{-2*pi < @var{t} < 2*pi} with 500
-## points.
+## is plotted over the domain @code{-2*pi <= @var{t} <= 2*pi} with 500 points.
 ##
 ## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of @var{x}, @var{y} and @var{t}.  If it is a four element
-## vector, then the minimum and maximum values of @var{x} and @var{t}
-## are determined by the first two elements and the minimum and maximum
-## of @var{y} by the second pair of elements.
+## values of both @var{x} and @var{y}, or @var{t} for a parametric plot.  If
+## @var{dom} is a four element vector, then the minimum and maximum values are
+## @code{[xmin xmax ymin ymax]}.
 ##
 ## @var{n} is a scalar defining the number of points to use in plotting
 ## the function.
 ##
-## The optional return value @var{h} is a graphics handle to the created plot.
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
 ##
-## @seealso{plot, ezplot3}
+## The optional return value @var{h} is a list of graphics handles in the
+## created plot.
+##
+## @seealso{plot, ezplot3, ezpolar, ezcontour, ezcontourf, ezmesh, ezmeshc, ezsurf, ezsurfc}
 ## @end deftypefn
 
-function retval = ezplot (varargin)
+function h = ezplot (varargin)
 
-  [h, needusage] = __ezplot__ ("plot", varargin{:});
+  [htmp, needusage] = __ezplot__ ("plot", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
 
 
 %!demo
+%! ## sinc function using function handle
+%! f = @(x) sin (pi*x) ./ (pi*x);
+%! ezplot (f);
+
+%!demo
+%! ## example of a function string and explicit limits
+%! clf;
+%! ezplot ('1/x', [-2 2]);
+
+%!demo
+%! ## parameterized function example over -2*pi <= t <= +2*pi
 %! clf;
 %! ezplot (@cos, @sin);
 
 %!demo
+%! ## implicit function of 2 variables
 %! clf;
-%! ezplot ('1/x');
+%! ezplot (inline ('x^2 - y^2 - 1'));
 
-%!demo
-%! clf;
-%! ezplot (inline ('x^2 - y^2 = 1'));
-
--- a/scripts/plot/ezplot3.m
+++ b/scripts/plot/ezplot3.m
@@ -20,17 +20,24 @@
 ## @deftypefn  {Function File} {} ezplot3 (@var{fx}, @var{fy}, @var{fz})
 ## @deftypefnx {Function File} {} ezplot3 (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezplot3 (@dots{}, @var{n})
-## @deftypefnx {Function File} {} ezplot3 (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezplot3 (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezplot3 (@dots{})
 ##
 ## Plot a parametrically defined curve in three dimensions.
-## @var{fx}, @var{fy}, and @var{fz} are strings, inline functions
-## or function handles with one arguments defining the function.  By
-## default the plot is over the domain @code{-2*pi < @var{x} < 2*pi}
-## with 60 points.
+##
+## @var{fx}, @var{fy}, and @var{fz} are strings, inline functions,
+## or function handles with one argument defining the function.  By
+## default the plot is over the domain @code{0 <= @var{t} <= 2*pi}
+## with 500 points.
 ##
 ## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of @var{t}.  @var{n} is a scalar defining the number of points to use.
+## values of @var{t}.
+##
+## @var{n} is a scalar defining the number of points to use in plotting the
+## function.
+##
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a graphics handle to the created plot.
 ##
@@ -43,19 +50,19 @@
 ## @end group
 ## @end example
 ##
-## @seealso{plot3, ezplot, ezsurf, ezmesh}
+## @seealso{plot3, ezplot, ezmesh, ezsurf}
 ## @end deftypefn
 
-function retval = ezplot3 (varargin)
+function h = ezplot3 (varargin)
 
-  [h, needusage] = __ezplot__ ("plot3", varargin{:});
+  [htmp, needusage] = __ezplot__ ("plot3", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
@@ -68,3 +75,10 @@
 %! fz = @(t) t;
 %! ezplot3 (fx, fy, fz, [0, 10*pi], 100);
 
+%!demo
+%! clf;
+%! fx = @(t) cos (t);
+%! fy = @(t) sin (t);
+%! fz = @(t) t;
+%! ezplot3 (fx, fy, fz, [0, 10*pi], 100, 'animate');
+
--- a/scripts/plot/ezpolar.m
+++ b/scripts/plot/ezpolar.m
@@ -23,17 +23,22 @@
 ## @deftypefnx {Function File} {} ezpolar (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezpolar (@dots{})
 ##
-## Plot a function in polar coordinates.  The function @var{f} is
-## a string, inline function, or function handle with a single argument.
-## The expected form of the function is
+## Plot a 2-D function in polar coordinates.
+## 
+## The function @var{f} is a string, inline function, or function handle with
+## a single argument.  The expected form of the function is
 ## @code{@var{rho} = @var{f}(@var{theta})}.
-## By default the plot is over the domain @code{0 < @var{theta} < 2*pi} with 60
-## points.
+## By default the plot is over the domain @code{0 <= @var{theta} <= 2*pi}
+## with 500 points.
 ##
 ## If @var{dom} is a two element vector, it represents the minimum and maximum
-## values of @var{theta}.  @var{n} is a scalar defining the number of points to
-## use.  If the optional input @var{hax} is given then the plot is placed into
-## the specified axes rather than the current axes.
+## values of @var{theta}.
+##
+## @var{n} is a scalar defining the number of points to use in plotting
+## the function.
+##
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a graphics handle to the created plot.
 ##
@@ -43,19 +48,19 @@
 ## ezpolar (@@(t) 1 + sin (t));
 ## @end example
 ##
-## @seealso{polar, ezplot, ezsurf, ezmesh}
+## @seealso{polar, ezplot}
 ## @end deftypefn
 
-function retval = ezpolar (varargin)
+function h = ezpolar (varargin)
 
-  [h, needusage] = __ezplot__ ("polar", varargin{:});
+  [htmp, needusage] = __ezplot__ ("polar", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/ezsurf.m
+++ b/scripts/plot/ezsurf.m
@@ -22,31 +22,36 @@
 ## @deftypefnx {Function File} {} ezsurf (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezsurf (@dots{}, @var{n})
 ## @deftypefnx {Function File} {} ezsurf (@dots{}, "circ")
-## @deftypefnx {Function File} {} ezsurf (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezsurf (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezsurf (@dots{})
 ##
-## Plot the surface defined by a function.  @var{f} is a string, inline
-## function or function handle with two arguments defining the function.  By
-## default the plot is over the domain @code{-2*pi < @var{x} < 2*pi} and
-## @code{-2*pi < @var{y} < 2*pi} with 60 points in each dimension.
+## Plot the surface defined by a function.
 ##
-## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
-## then the minimum and maximum value of @var{x} and @var{y} are specify
-## separately.
-##
-## @var{n} is a scalar defining the number of points to use in each dimension.
+## @var{f} is a string, inline function, or function handle with two arguments
+## defining the function.  By default the plot is over the meshed domain
+## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
 ##
 ## If three functions are passed, then plot the parametrically defined
 ## function @code{[@var{fx} (@var{s}, @var{t}), @var{fy} (@var{s}, @var{t}),
 ## @var{fz} (@var{s}, @var{t})]}.
 ##
+## If @var{dom} is a two element vector, it represents the minimum and maximum
+## values of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
+## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}.
+##
+## @var{n} is a scalar defining the number of points to use in each dimension.
+##
 ## If the argument "circ" is given, then the function is plotted over a disk
 ## centered on the middle of the domain @var{dom}.
 ##
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a graphics handle to the created
 ## surface object.
 ##
+## Example 1: 2-argument function
+##
 ## @example
 ## @group
 ## f = @@(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2);
@@ -54,7 +59,7 @@
 ## @end group
 ## @end example
 ##
-## An example of a parametrically defined function is
+## Example 2: parametrically defined function
 ##
 ## @example
 ## @group
@@ -65,19 +70,19 @@
 ## @end group
 ## @end example
 ##
-## @seealso{ezplot, ezmesh, ezsurfc, ezmeshc}
+## @seealso{surf, ezsurfc, ezplot, ezmesh, ezmeshc, shading}
 ## @end deftypefn
 
-function retval = ezsurf (varargin)
+function h = ezsurf (varargin)
 
-  [h, needusage] = __ezplot__ ("surf", varargin{:});
+  [htmp, needusage] = __ezplot__ ("surf", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
@@ -96,4 +101,16 @@
 %! fy = @(s,t) sin (s) .* cos (t);
 %! fz = @(s,t) sin (t);
 %! ezsurf (fx, fy, fz, [-pi,pi,-pi/2,pi/2], 20);
+%! axis equal;
 
+%!demo
+%! clf;
+%! colormap ('default');
+%! f = @(x,y) x.^2 + y.^2;
+%! subplot (1,2,1);
+%!  ezsurf (f, [-2,2]);
+%!  title ({'x^2 + y^2'; 'plotted over rectangular grid (default)'});
+%! subplot (1,2,2);
+%!  ezsurf (f, [-2,2], 'circ');
+%!  title ({'x^2 + y^2'; 'plotted over circular disk with "circ"'});
+
--- a/scripts/plot/ezsurfc.m
+++ b/scripts/plot/ezsurfc.m
@@ -22,31 +22,36 @@
 ## @deftypefnx {Function File} {} ezsurfc (@dots{}, @var{dom})
 ## @deftypefnx {Function File} {} ezsurfc (@dots{}, @var{n})
 ## @deftypefnx {Function File} {} ezsurfc (@dots{}, "circ")
-## @deftypefnx {Function File} {} ezsurfc (@var{h}, @dots{})
+## @deftypefnx {Function File} {} ezsurfc (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ezsurfc (@dots{})
 ##
-## Plot the surface and contour lines defined by a function.  @var{f} is a
-## string, inline function or function handle with two arguments defining the
-## function.  By default the plot is over the domain @code{-2*pi < @var{x} <
-## 2*pi} and @code{-2*pi < @var{y} < 2*pi} with 60 points in each dimension.
+## Plot the surface and contour lines defined by a function.
 ##
-## If @var{dom} is a two element vector, it represents the minimum and maximum
-## value of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
-## then the minimum and maximum value of @var{x} and @var{y} are specify
-## separately.
-##
-## @var{n} is a scalar defining the number of points to use in each dimension.
+## @var{f} is a string, inline function, or function handle with two arguments
+## defining the function.  By default the plot is over the meshed domain
+## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
 ##
 ## If three functions are passed, then plot the parametrically defined
 ## function @code{[@var{fx} (@var{s}, @var{t}), @var{fy} (@var{s}, @var{t}),
 ## @var{fz} (@var{s}, @var{t})]}.
 ##
+## If @var{dom} is a two element vector, it represents the minimum and maximum
+## values of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
+## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}.
+##
+## @var{n} is a scalar defining the number of points to use in each dimension.
+##
 ## If the argument "circ" is given, then the function is plotted over a disk
 ## centered on the middle of the domain @var{dom}.
 ##
+## If the first argument is an axis handle, @var{hax}, then plot into this
+## axis rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a 2-element vector with a graphics
-## for the created surface plot and a second handle for the created contour
-## plot.
+## handle for the created surface plot and a second handle for the created
+## contour plot.
+##
+## Example:
 ##
 ## @example
 ## @group
@@ -55,19 +60,19 @@
 ## @end group
 ## @end example
 ##
-## @seealso{ezplot, ezmeshc, ezsurf, ezmesh}
+## @seealso{surfc, ezsurf, ezplot, ezmesh, ezmeshc, shading}
 ## @end deftypefn
 
-function retval = ezsurfc (varargin)
+function h = ezsurfc (varargin)
 
-  [h, needusage] = __ezplot__ ("surfc", varargin{:});
+  [htmp, needusage] = __ezplot__ ("surfc", varargin{:});
 
   if (needusage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = h;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/feather.m
+++ b/scripts/plot/feather.m
@@ -46,7 +46,7 @@
 
 function retval = feather (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("feather", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("feather", varargin{:});
 
   arrowsize = 0.25;
 
@@ -94,13 +94,14 @@
   y = [zeros(1, n); yend; ytmp  + u * arrowsize / 3; yend; ...
        ytmp - u * arrowsize / 3];
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
-    hlist = plot (h, x, y, line_spec, [1, n], [0, 0], line_spec);
+    hax = newplot (hax);
+    hlist = plot (hax, x, y, line_spec, [1, n], [0, 0], line_spec);
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
--- a/scripts/plot/fill.m
+++ b/scripts/plot/fill.m
@@ -20,52 +20,89 @@
 ## @deftypefn  {Function File} {} fill (@var{x}, @var{y}, @var{c})
 ## @deftypefnx {Function File} {} fill (@var{x1}, @var{y1}, @var{c1}, @var{x2}, @var{y2}, @var{c2})
 ## @deftypefnx {Function File} {} fill (@dots{}, @var{prop}, @var{val})
-## @deftypefnx {Function File} {} fill (@var{h}, @dots{})
+## @deftypefnx {Function File} {} fill (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} fill (@dots{})
-## Create one or more filled patch objects.
+## Create one or more filled 2-D polygons.
+##
+## The inputs @var{x} and @var{y} are the coordinates of the polygon vertices.
+## If the inputs are matrices then the rows represent different vertices and
+## each column produces a different polygon.
+## @code{fill} will close any open polygons before plotting. 
+##
+## The input @var{c} determines the color of the polygon.  The simplest form
+## is a single color specification such as a @code{plot} format or an
+## RGB-triple.  In this case the polygon(s) will have one unique color.  If
+## @var{c} is a vector or matrix then the color data is first scaled using
+## @code{caxis} and then indexed into the current colormap.  A row vector will
+## color each polygon (a column from matrices @var{x} and @var{y}) with a
+## single computed color.  A matrix @var{c} of the same size as @var{x} and
+## @var{y} will compute the color of each vertex and then interpolate the face
+## color between the vertices.
+##
+## Multiple property/value pairs for the underlying patch object may be
+## specified, but they must appear in pairs.
+##
+## If the first argument @var{hax} is an axis handle, then plot into this axis,
+## rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is an array of graphics handles to
 ## the created patch objects.
-## @seealso{patch}
+##
+## Example: red square
+##
+## @example
+## @group
+## vertices = [0 0
+##             1 0
+##             1 1
+##             0 1];
+## fill (vertices(:,1), vertices(:,2), "r");
+## axis ([-0.5 1.5, -0.5 1.5])
+## axis equal
+## @end group
+## @end example
+##
+## @seealso{patch, caxis, colormap}
 ## @end deftypefn
 
-function retval = fill (varargin)
+function h = fill (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("fill", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("fill", varargin{:});
 
-  htmp = [];
+  hlist = [];
   iargs = __find_patches__ (varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
+    hax = newplot (hax);
+    old_nxtplt = get (hax, "nextplot");
+    set (hax, "nextplot", "add");
 
-    nextplot = get (h, "nextplot");
     for i = 1 : length (iargs)
-      if (i > 1 && strncmp (nextplot, "replace", 7))
-        set (h, "nextplot", "add");
-      endif
       if (i == length (iargs))
         args = varargin(iargs(i):end);
       else
         args = varargin(iargs(i):iargs(i+1)-1);
       endif
-      newplot ();
-      [tmp, fail] = __patch__ (h, args{:});
+      [htmp, fail] = __patch__ (hax, args{:});
       if (fail)
         print_usage ();
       endif
-      htmp(end + 1, 1) = tmp;
+      hlist(end + 1, 1) = htmp;
     endfor
-    if (strncmp (nextplot, "replace", 7))
-      set (h, "nextplot", nextplot);
+
+    if (strncmp (old_nxtplt, "replace", 7))
+      set (hax, "nextplot", old_nxtplt);
     endif
+
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
-    retval = htmp;
+    h = hlist;
   endif
 
 endfunction
--- a/scripts/plot/findall.m
+++ b/scripts/plot/findall.m
@@ -45,9 +45,8 @@
 
 
 %!testif HAVE_FLTK
-%! toolkit = graphics_toolkit ();
-%! graphics_toolkit ("fltk");
-%! hf = figure ("visible", "off");
+%! toolkit = graphics_toolkit ("fltk");
+%! hf = figure ("visible", "off")
 %! unwind_protect
 %!   h = findall (hf);
 %!   all_handles(1:13,1) = {"uimenu"};
--- a/scripts/plot/findobj.m
+++ b/scripts/plot/findobj.m
@@ -110,6 +110,7 @@
   pvalue            = {};
   np = 1;
   na = 1;
+  operatorprecedence = {"-not", "-and", "-or", "-xor"};
 
   while (na <= numel (args))
     regularexpression(np) = 0;
@@ -148,17 +149,8 @@
           na = na + 1;
           if (na <= numel (args))
             if (ischar (args{na}))
-              if (strcmpi (args{na}, "-and"))
-                logicaloperator{np} = "and";
-                na = na+1;
-              elseif (strcmpi (args{na}, "-or"))
-                logicaloperator{np} = "or";
-                na = na+1;
-              elseif (strcmpi (args{na}, "-xor"))
-                logicaloperator{np} = "xor";
-                na = na+1;
-              elseif (strcmpi (args{na}, "-not"))
-                logicaloperator{np} = "not";
+              if (any (strcmpi (args{na}, operatorprecedence)))
+                logicaloperator{np} = args{na}(2:end);
                 na = na+1;
               endif
             else
@@ -202,52 +194,87 @@
     idepth = idepth + 1;
   endwhile
 
-  keepers = ones (size (h));
   if (numpairs > 0)
+    match = true (numel (h), numpairs);
     for nh = 1 : numel (h)
-      p = get (h (nh));
+      p = get (h(nh));
       for np = 1 : numpairs
         fields = fieldnames (p);
         fieldindex = find (strcmpi (fields, pname{np}), 1);
         if (numel (fieldindex))
           pname{np} = fields{fieldindex};
           if (property(np))
-            match = 1;
+            match(nh,np) = true;
           else
             if (regularexpression(np))
-              match = regexp (p.(pname{np}), pvalue{np});
-              if (isempty (match))
-                match = 0;
+              foo = regexp (p.(pname{np}), pvalue{np}, "once");
+              if (isempty (foo))
+                match(nh,np) = false;
+              else
+                match(nh,np) = foo;
               endif
             elseif (numel (p.(pname{np})) == numel (pvalue{np}))
-              if (ischar (pvalue{np}))
-                match = strcmpi (pvalue{np}, p.(pname{np}));
+              if (ischar (pvalue{np}) && ischar (p.(pname{np})))
+                match(nh,np) = strcmpi (pvalue{np}, p.(pname{np}));
+              elseif (isnumeric (pvalue{np} && isnumeric (p.(pname{np}))))
+                match(nh,np) = (pvalue{np} == p.(pname{np}));
               else
-                match = (pvalue{np} == p.(pname{np}));
+                match(nh,np) = isequal (pvalue{np}, p.(pname{np}));
               endif
             else
-              match = 0;
+              match(nh,np) = false;
             endif
-            match = all (match);
-          endif
-          if (strcmpi (logicaloperator{np}, "not"))
-            keepers(nh) = ! keepers(nh) & ! match;
-          else
-            keepers(nh) = feval (logicaloperator{np}, keepers(nh), match);
           endif
         else
-          keepers(nh) = 0;
+          match(nh,np) = false;
         endif
       endfor
     endfor
+
+    if (numpairs > 1)
+      for no = 1 : numel (operatorprecedence)
+        pairs = find (strcmp (logicaloperator(2:end), ...
+                              operatorprecedence{no}(2:end)));
+        for np = sort (pairs, "descend")
+          if (no == 1)
+            match(:,np+1) = ! match(:,np+1);
+            logicaloperator(np+1) = {"and"};
+          else
+            match(:,np) = feval (logicaloperator{np+1}, match(:,np), ...
+                                 match(:,np+1));
+            logicaloperator(np+1) = [];
+            match(:,np+1) = [];
+            numpairs = numpairs - 1;
+          endif
+          if (numpairs < 2)
+            break;
+          endif
+        endfor
+        if (numpairs < 2)
+          break;
+        endif
+      endfor
+    endif
+  else
+    match = true (numel (h), 1);
   endif
 
-  h = h (keepers != 0);
-  h = reshape (h, [numel(h), 1]);
+  h = h(match);
+  h = h(:);
 endfunction
 
 %!test
 %! hf = figure ("visible", "off");
+%! clf (hf);
+%! unwind_protect
+%!   h = findobj (gca (), "-property", "foo");
+%!   assert (h, zeros (0, 1))
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+
+%!test
+%! hf = figure ("visible", "off");
 %! unwind_protect
 %!   h = plot (1:10);
 %!   set (h, "tag", "foobar")
@@ -288,3 +315,88 @@
 %! end_unwind_protect
 %! assert (h2, h1)
 
+%!test
+%! toolkit = graphics_toolkit ("gnuplot");
+%! hf = figure ("visible", "off")
+%! unwind_protect
+%!   h1 = subplot (2, 2, 1);
+%!   h2 = subplot (2, 2, 2);
+%!   h3 = subplot (2, 2, 3);
+%!   h4 = subplot (2, 2, 4);
+%!   userdata = struct ("foo", "bar");
+%!   set (h3, "userdata", userdata);
+%!   h = findobj (hf, "userdata", userdata);
+%! unwind_protect_cleanup
+%!   close (hf);
+%!   graphics_toolkit (toolkit);
+%! end_unwind_protect
+%! assert (h, h3)
+
+%!test
+%! toolkit = graphics_toolkit ("gnuplot");
+%! hf = figure ("visible", "off")
+%! unwind_protect
+%!   h1 = subplot (2, 2, 1);
+%!   set (h1, 'tag', '1')
+%!   h2 = subplot (2, 2, 2);
+%!   set (h2, 'tag', '2')
+%!   h3 = subplot (2, 2, 3);
+%!   set (h3, 'tag', '3')
+%!   h4 = subplot (2, 2, 4);
+%!   set (h4, 'tag', '4')
+%!   h = findobj (hf, 'type', 'axes', '-not', 'tag', '1');
+%! unwind_protect_cleanup
+%!   close (hf);
+%!   graphics_toolkit (toolkit);
+%! end_unwind_protect
+%! assert (h, [h2; h3; h4])
+
+%!test
+%! hf = figure ("visible", "off");
+%! unwind_protect
+%!   h1 = subplot (2, 2, 1);
+%!   set (h1, 'userdata', struct ('column', 1, 'row', 1));
+%!   h2 = subplot (2, 2, 2);
+%!   set (h2, 'userdata', struct ('column', 2, 'row', 1));
+%!   h3 = subplot (2, 2, 3);
+%!   set (h3, 'userdata', struct ('column', 1, 'row', 2));
+%!   h4 = subplot (2, 2, 4);
+%!   set (h4, 'userdata', struct ('column', 2, 'row', 2));
+%!   h = findobj (hf, 'type', 'axes', '-not', 'userdata', ...
+%!                struct ('column', 1, 'row', 1));
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+%! assert (h, [h2; h3; h4])
+
+%!test
+%! hf = figure ("visible", "off");
+%! unwind_protect
+%!   ha = axes ();
+%!   plot (1:10);
+%!   h = findobj (hf, 'type', 'figure', ...
+%!                '-or', 'parent', hf, ...
+%!                '-and', 'type', 'axes');
+%! unwind_protect_cleanup
+%!   close (hf)
+%! end_unwind_protect
+%! assert (h, [ha; hf])
+
+%!test
+%! hf = figure ("visible", "off");
+%! set (hf, 'tag', 'foo');
+%! unwind_protect
+%!   h1 = subplot (2, 2, 1);
+%!   set (h1, 'tag', 'foo');
+%!   h2 = subplot (2, 2, 2);
+%!   set (h2, 'tag', 'bar');
+%!   h3 = subplot (2, 2, 3);
+%!   set (h3, 'tag', 'foo');
+%!   h4 = subplot (2, 2, 4);
+%!   set (h4, 'tag', 'bar')
+%!   h = findobj (hf, 'type', 'axes', '-xor', ...
+%!                'tag', 'foo');
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
+%! assert (h, [h2; h4; hf])
--- a/scripts/plot/fplot.m
+++ b/scripts/plot/fplot.m
@@ -20,41 +20,51 @@
 ## @deftypefn  {Function File} {} fplot (@var{fn}, @var{limits})
 ## @deftypefnx {Function File} {} fplot (@var{fn}, @var{limits}, @var{tol})
 ## @deftypefnx {Function File} {} fplot (@var{fn}, @var{limits}, @var{n})
-## @deftypefnx {Function File} {} fplot (@dots{}, @var{fmt})
-## Plot a function @var{fn} within defined limits.
+## @deftypefnx {Function File} {} fplot (@var{fn}, @var{limits}, @var{fmt})
+## @deftypefnx {Function File} {} fplot (@var{fn}, @var{limits}, @var{tol}, @var{n}, @var{fmt})
+## @deftypefnx {Function File} {[@var{x}, @var{y}] =} fplot (@dots{})
+## Plot a function @var{fn} within the range defined by @var{limits}.
+##
 ## @var{fn} is a function handle, inline function, or string
 ## containing the name of the function to evaluate.
-## The limits of the plot are given by @var{limits} of the form
-## @code{[@var{xlo}, @var{xhi}]} or @code{[@var{xlo}, @var{xhi},
-## @var{ylo}, @var{yhi}]}.  @var{tol} is the default tolerance to use for the
-## plot, and if @var{tol} is an integer it is assumed that it defines the
-## number points to use in the plot.  The @var{fmt} argument is passed
-## to the plot command.
+## The limits of the plot are of the form @code{[@var{xlo}, @var{xhi}]} or
+## @code{[@var{xlo}, @var{xhi}, @var{ylo}, @var{yhi}]}.
+## The next three arguments are all optional and any number of them may be
+## given in any order.
+## @var{tol} is the relative tolerance to use for the plot and defaults
+## to 2e-3 (.2%).
+## @var{n} is the minimum number of of points to use.  When @var{n} is
+## specified, the maximum stepsize will be
+## @code{@var{xhi} - @var{xlo} / @var{n}}.  More than @var{n} points may still
+## be used in order to meet the relative tolerance requirement.
+## The @var{fmt} argument specifies the linestyle to be used by the plot
+## command.
+##
+## With no output arguments the results are immediately plotted.  With two
+## output arguments the 2-D plot data is returned.  The data can subsequently
+## be plotted manually with @code{plot (@var{x}, @var{y})}.
+##
+## Example:
 ##
 ## @example
 ## @group
-## fplot ("cos", [0, 2*pi])
+## fplot (@@cos, [0, 2*pi])
 ## fplot ("[cos(x), sin(x)]", [0, 2*pi])
 ## @end group
 ## @end example
+##
+## Note: @code{fplot} works best with continuous functions.  Functions with
+## discontinuities are unlikely to plot well.  This restriction may be
+## removed in the future.
 ## @seealso{plot}
 ## @end deftypefn
 
 ## Author: Paul Kienzle <pkienzle@users.sf.net>
 
-function fplot (fn, limits, n = 0.002, fmt = "")
-
-  if (nargin < 2 || nargin > 4)
-    print_usage ();
-  endif
+function [X, Y] = fplot (fn, limits, varargin)
 
-  if (iscomplex (limits) || (numel (limits) != 2 && numel (limits) != 4))
-    error ("fplot: LIMITS must be a real vector with 2 or 4 elements");
-  endif
-
-  if (ischar (n))
-    fmt = n;
-    n = 0.002;
+  if (nargin < 2 || nargin > 5)
+    print_usage ();
   endif
 
   if (strcmp (typeinfo (fn), "inline function"))
@@ -71,46 +81,89 @@
     error ("fplot: FN must be a function handle, inline function, or string");
   endif
 
-  if (n != fix (n))
-    tol = n;
-    x0 = linspace (limits(1), limits(2), 5)';
+  if (iscomplex (limits) || (numel (limits) != 2 && numel (limits) != 4))
+    error ("fplot: LIMITS must be a real vector with 2 or 4 elements");
+  endif
+
+  n = 5;
+  tol = 2e-3;
+  fmt = "";
+  for i = 1:numel (varargin)
+    arg = varargin{i};
+    if (ischar (arg))
+      fmt = arg;
+    elseif (isnumeric (arg) && isscalar (arg) && arg > 0)
+      if (arg == fix (arg))
+        n = arg;
+      else
+        tol = arg;
+      endif
+    else
+      error ("fplot: bad input in position %d", i+2);
+    endif
+  endfor
+
+  if (n != 5) 
+    ## n was specified 
+    x0 = linspace (limits(1), limits(2), n/2 + 1)';
     y0 = feval (fn, x0);
-    err0 = Inf;
-    n = 8;
     x = linspace (limits(1), limits(2), n)';
     y = feval (fn, x);
-
-    while (n < 2 .^ 20)
-      y00 = interp1 (x0, y0, x, "linear");
-      err = 0.5 * max (abs ((y00 - y) ./ (y00 + y))(:));
-      if (err == err0 || err < tol)
-        break;
-      endif
-      x0 = x;
-      y0 = y;
-      err0 = err;
-      n = 2 * (n - 1) + 1;
-      x = linspace (limits(1), limits(2), n)';
-      y = feval (fn, x);
-    endwhile
   else
+    x0 = linspace (limits(1), limits(2), 5)';
+    y0 = feval (fn, x0);
+    n = 8;
     x = linspace (limits(1), limits(2), n)';
     y = feval (fn, x);
   endif
 
-  plot (x, y, fmt);
-
-  if (length (limits) > 2)
-    axis (limits);
+  if (rows (x0) != rows (y0))
+    ## FN is a constant value function
+    y0 = repmat (y0, size (x0));
+    y = repmat (y, size (x));
   endif
 
-  if (isvector (y))
-    legend (nam);
+  err0 = Inf;
+
+  ## FIXME: This algorithm should really use adaptive scaling as the 
+  ##        the numerical quadrature algorithms do so that extra points are
+  ##        used where they are needed and not spread evenly over the entire
+  ##        x-range.  Try any function with a discontinuity such as
+  ##        fplot (@tan, [-2, 2]) or fplot ("1./x", [-3, 2]) to see the
+  ##        problems with the current solution.
+
+  while (n < 2^18)    # Something is wrong if we need more than 250K points
+    yi = interp1 (x0, y0, x, "linear");
+    ## relative error calculation using average of [yi,y] as reference
+    ## since neither estimate is known a priori to be better than the other.
+    err = 0.5 * max (abs ((yi - y) ./ (yi + y))(:));
+    if (err < tol || abs (err - err0) < tol/2)
+      ## Either relative tolerance has been met OR
+      ## algorithm has stopped making any reasonable progress per iteration.
+      break;
+    endif
+    x0 = x;
+    y0 = y;
+    err0 = err;
+    n = 2 * (n - 1) + 1;
+    x = linspace (limits(1), limits(2), n)';
+    y = feval (fn, x);
+  endwhile
+
+  if (nargout == 2)
+    X = x;
+    Y = y;
   else
-    for i = 1:columns (y)
-      nams{i} = sprintf ("%s(:,%i)", nam, i);
-    endfor
-    legend (nams{:});
+    plot (x, y, fmt);
+    axis (limits);
+    if (isvector (y))
+      legend (nam);
+    else
+      for i = 1:columns (y)
+        nams{i} = sprintf ("%s(:,%i)", nam, i);
+      endfor
+      legend (nams{:});
+    endif
   endif
 
 endfunction
@@ -118,9 +171,30 @@
 
 %!demo
 %! clf;
-%! fplot ('cos', [0, 2*pi]);
+%! fplot (@cos, [0, 2*pi]);
 
 %!demo
 %! clf;
 %! fplot ('[cos(x), sin(x)]', [0, 2*pi]);
 
+%!demo
+%! clf;
+%! ## sinc function
+%! fh = @(x) sin (pi*x) ./ (pi*x);
+%! fplot (fh, [-5, 5]);
+
+%!test
+%! [x, y] = fplot ("[cos(x), sin(x)]", [0, 2*pi]);
+%! assert (columns (y) == 2);
+%! assert (rows (x) == rows (y));
+%! assert (y, [cos(x), sin(x)], -2e-3);
+
+%% Test input validation
+%!error fplot (1)
+%!error fplot (1,2,3,4,5,6)
+%!error <FN must be a function handle> fplot (1, [0 1])
+%!error <LIMITS must be a real vector> fplot (@cos, [i, 2*i])
+%!error <LIMITS must be a real vector with 2 or 4> fplot (@cos, [1])
+%!error <LIMITS must be a real vector with 2 or 4> fplot (@cos, [1 2 3])
+%!error <bad input in position 3> fplot (@cos,[-1,1], {1})
+
--- a/scripts/plot/gca.m
+++ b/scripts/plot/gca.m
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} gca ()
+## @deftypefn {Function File} {@var{h} =} gca ()
 ## Return a handle to the current axis object.  If no axis object
 ## exists, create one and return its handle.  The handle may then be
 ## used to examine or set properties of the axes.  For example,
@@ -32,7 +32,7 @@
 ## @noindent
 ## creates an empty axes object, then changes its location and size in
 ## the figure window.
-## @seealso{get, set}
+## @seealso{gcf, gco, get, set}
 ## @end deftypefn
 
 ## Author: jwe
--- a/scripts/plot/gcbf.m
+++ b/scripts/plot/gcbf.m
@@ -21,9 +21,9 @@
 ## Return a handle to the figure containing the object whose callback
 ## is currently executing.  If no callback is executing, this function
 ## returns the empty matrix.  The handle returned by this function is
-## the same as the second output argument of gcbo.
+## the same as the second output argument of @code{gcbo}.
 ##
-##@seealso{gcf, gca, gcbo}
+##@seealso{gcbo, gcf, gca}
 ##@end deftypefn
 
 function fig = gcbf ()
--- a/scripts/plot/gcbo.m
+++ b/scripts/plot/gcbo.m
@@ -24,11 +24,11 @@
 ## empty matrix.  This handle is obtained from the root object property
 ## "CallbackObject".
 ##
-## Additionally return the handle of the figure containing the
-## object whose callback is currently executing.  If no callback is
-## executing, the second output is also set to the empty matrix.
+## When called with a second output argument, return the handle of the figure
+## containing the object whose callback is currently executing.  If no callback
+## is executing the second output is also set to the empty matrix.
 ##
-##@seealso{gcf, gca, gcbf}
+##@seealso{gcbf, gco, gcf, gca}
 ##@end deftypefn
 
 function [h, fig] = gcbo ()
--- a/scripts/plot/gcf.m
+++ b/scripts/plot/gcf.m
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} gcf ()
+## @deftypefn {Function File} {@var{h} =} gcf ()
 ## Return the current figure handle.  If a figure does not exist, create
 ## one and return its handle.  The handle may then be used to examine or
 ## set properties of the figure.  For example,
@@ -34,7 +34,7 @@
 ## plots a sine wave, finds the handle of the current figure, and then
 ## makes that figure invisible.  Setting the visible property of the
 ## figure to @code{"on"} will cause it to be displayed again.
-## @seealso{get, set}
+## @seealso{gca, gco, get, set}
 ## @end deftypefn
 
 ## Author: jwe, Bill Denney
--- a/scripts/plot/gco.m
+++ b/scripts/plot/gco.m
@@ -27,7 +27,7 @@
 ## If the last mouse click didn't occur on any child object of the figure,
 ## the current object is the figure itself.
 ##
-## If no mouse click occured in the target figure, this function returns an
+## If no mouse click occurred in the target figure, this function returns an
 ## empty matrix.
 ##
 ## Note that the value returned by this function is not necessarily the same
@@ -35,7 +35,7 @@
 ## callback can be interrupted by another callback and the current object
 ## can be modified.
 ##
-##@seealso{gcbo, gcf}
+##@seealso{gcbo, gcf, gca, get, set}
 ##@end deftypefn
 
 function h = gco ()
--- a/scripts/plot/graphics_toolkit.m
+++ b/scripts/plot/graphics_toolkit.m
@@ -90,10 +90,10 @@
 
 %!testif HAVE_FLTK
 %! unwind_protect
-%!   hf = figure ("visible", "off"); 
+%!   hf = figure ("visible", "off");
 %!   toolkit = graphics_toolkit ();
 %!   assert (get (0, "defaultfigure__graphics_toolkit__"), toolkit);
-%!   graphics_toolkit (hf, "fltk"); 
+%!   graphics_toolkit (hf, "fltk");
 %!   assert (graphics_toolkit (hf), "fltk");
 %! unwind_protect_cleanup
 %!   close (hf);
@@ -101,7 +101,7 @@
 
 %!testif HAVE_FLTK
 %! old_toolkit = graphics_toolkit ();
-%! switch old_toolkit
+%! switch (old_toolkit)
 %!   case {"gnuplot"}
 %!     new_toolkit = "fltk";
 %!   otherwise
--- a/scripts/plot/grid.m
+++ b/scripts/plot/grid.m
@@ -17,83 +17,98 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} grid (@var{arg})
-## @deftypefnx {Function File} {} grid ("minor", @var{arg2})
+## @deftypefn  {Function File} {} grid
+## @deftypefnx {Function File} {} grid on
+## @deftypefnx {Function File} {} grid off
+## @deftypefnx {Function File} {} grid minor
+## @deftypefnx {Function File} {} grid minor on
+## @deftypefnx {Function File} {} grid minor off
 ## @deftypefnx {Function File} {} grid (@var{hax}, @dots{})
-## Force the display of a grid on the plot.
-## The argument may be either @code{"on"}, or @code{"off"}.
+## Control the display of grid lines on a plot.
+##
+## The function input may be either @code{"on"}, or @code{"off"}.
 ## If it is omitted, the current grid state is toggled.
 ##
-## If @var{arg} is @code{"minor"} then the minor grid is toggled.  When
-## using a minor grid a second argument @var{arg2} is allowed, which can
-## be either @code{"on"} or @code{"off"} to explicitly set the state of
-## the minor grid.
+## If the first argument is @code{"minor"} then all further commands
+## modify the minor grid rather than the major grid.
 ##
 ## If the first argument is an axis handle, @var{hax}, operate on the
 ## specified axis object.
-## @seealso{plot}
+##
+## To control the grid lines for an individual axis use the @code{set}
+## function.  For example,
+##
+## @example
+## set (gca, "ygrid", "on");
+## @end example
+## @seealso{box}
 ## @end deftypefn
 
 ## Author: jwe
 
 function grid (varargin)
 
-  [ax, varargin, nargs] = __plt_get_axis_arg__ ("grid", varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("grid", varargin{:});
 
-  grid_on = (strcmp (get (ax, "xgrid"), "on")
-             && strcmp (get (ax, "ygrid"), "on")
-             && strcmp (get (ax, "zgrid"), "on"));
-
-  minor_on = (strcmp (get (ax, "xminorgrid"), "on")
-              && strcmp (get (ax, "yminorgrid"), "on")
-              && strcmp (get (ax, "zminorgrid"), "on"));
-
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
   if (nargs > 2)
     print_usage ();
-  elseif (nargs == 0)
+  endif
+
+  grid_on = (   strcmp (get (hax, "xgrid"), "on")
+             && strcmp (get (hax, "ygrid"), "on")
+             && strcmp (get (hax, "zgrid"), "on"));
+
+  minor_on = (   strcmp (get (hax, "xminorgrid"), "on")
+              && strcmp (get (hax, "yminorgrid"), "on")
+              && strcmp (get (hax, "zminorgrid"), "on"));
+
+  if (nargs == 0)
     grid_on = ! grid_on;
   else
     x = varargin{1};
-    if (ischar (x))
-      if (strcmpi (x, "off"))
-        grid_on = false;
-      elseif (strcmpi (x, "on"))
-        grid_on = true;
-      elseif (strcmpi (x, "minor"))
-        if (nargs == 2)
-          x2 = varargin{2};
-          if (strcmpi (x2, "on"))
-            minor_on = true;
-            grid_on = true;
-          elseif (strcmpi (x2, "off"))
-            minor_on = false;
-          else
-            print_usage ();
-          endif
+    if (! ischar (x))
+      error ("grid: argument 1 must be an axis handle or a string");
+    endif
+    if (strcmpi (x, "off"))
+      grid_on = false;
+    elseif (strcmpi (x, "on"))
+      grid_on = true;
+    elseif (strcmpi (x, "minor"))
+      if (nargs == 2)
+        x2 = varargin{2};
+        if (strcmpi (x2, "on"))
+          minor_on = true;
+          grid_on = true;
+        elseif (strcmpi (x2, "off"))
+          minor_on = false;
         else
-           minor_on = ! minor_on;
-           if (minor_on)
-             grid_on = true;
-           endif
+          print_usage ();
         endif
       else
-        print_usage ();
+        minor_on = ! minor_on;
+        if (minor_on)
+          grid_on = true;
+        endif
       endif
     else
-      error ("grid: argument must be a string");
+      print_usage ();
     endif
   endif
 
   if (grid_on)
-    set (ax, "xgrid", "on", "ygrid", "on", "zgrid", "on");
+    set (hax, "xgrid", "on", "ygrid", "on", "zgrid", "on");
     if (minor_on)
-      set (ax, "xminorgrid", "on", "yminorgrid", "on", "zminorgrid", "on");
+      set (hax, "xminorgrid", "on", "yminorgrid", "on", "zminorgrid", "on");
     else
-      set (ax, "xminorgrid", "off", "yminorgrid", "off", "zminorgrid", "off");
+      set (hax, "xminorgrid", "off", "yminorgrid", "off", "zminorgrid", "off");
     endif
   else
-    set (ax, "xgrid", "off", "ygrid", "off", "zgrid", "off");
-    set (ax, "xminorgrid", "off", "yminorgrid", "off", "zminorgrid", "off");
+    set (hax, "xgrid", "off", "ygrid", "off", "zgrid", "off",
+              "xminorgrid", "off", "yminorgrid", "off", "zminorgrid", "off");
   endif
 
 endfunction
--- a/scripts/plot/hdl2struct.m
+++ b/scripts/plot/hdl2struct.m
@@ -146,7 +146,7 @@
 
   nflds = length (fields);
   ii = 0;
-  while nflds
+  while (nflds)
     prop = fields{nflds};
     val = obj.(fields{nflds});
     ii++;
--- a/scripts/plot/hggroup.m
+++ b/scripts/plot/hggroup.m
@@ -32,12 +32,16 @@
 
 function h = hggroup (varargin)
 
-  [ax, varargin] = __plt_get_axis_arg__ ("hggroup", varargin{:});
-
-  tmp = __go_hggroup__ (ax, varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("hggroup", varargin{:});
+  
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
+  htmp = __go_hggroup__ (hax, varargin{:});
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/hidden.m
+++ b/scripts/plot/hidden.m
@@ -17,43 +17,50 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} hidden (@var{mode})
-## @deftypefnx {Function File} {} hidden ()
-## Manipulation the mesh hidden line removal.  Called with no argument
-## the hidden line removal is toggled.  The argument @var{mode} can be either
-## "on" or "off" and the set of the hidden line removal is set accordingly.
-## @seealso{mesh, meshc, surf}
+## @deftypefn  {Function File} {} hidden ()
+## @deftypefnx {Function File} {} hidden ("on")
+## @deftypefnx {Function File} {} hidden ("off")
+## @deftypefnx {Function File} {@var{state} =} hidden (@dots{})
+## Control mesh hidden line removal.
+##
+## When called with no argument the hidden line removal state is toggled.
+## When called with one of the modes "on" or "off" the state is set accordingly.
+##
+## The optional output argument @var{mode} is the current state.
+##
+## Hidden Line Removal determines what graphic objects behind a mesh plot
+## are visible.  The default is for the mesh to be opaque and lines behind
+## the mesh are not visible.  If hidden line removal is turned off then
+## objects behind the mesh can be seen through the faces (openings) of the
+## mesh, although the mesh grid lines are still opaque.
+##
+## @seealso{mesh, meshc, meshz, ezmesh, ezmeshc}
 ## @end deftypefn
 
-function retval = hidden (mode)
+function state = hidden (mode = "toggle")
 
-  if (nargin == 0)
-    mode = "swap";
-  elseif (nargin == 1);
-    if (ischar (mode))
-      mode = tolower (mode);
-      if (! strcmp (mode, "on") && ! strcmp (mode, "off"))
-        error ("hidden: MODE expected to be 'on' or 'off'");
-      endif
-    else
+  if (nargin > 2)
+    print_usage ();
+  elseif (nargin == 1)
+    if (! ischar (mode))
       error ("hidden: expecting MODE to be a string");
+    elseif (! any (strcmpi (mode, {"on", "off"})))
+      error ('hidden: MODE must be "on" or "off"');
     endif
-  else
-    print_usage ();
   endif
 
-  for h = get (gca (), "children");
-    htype = lower (get (h, "type"));
+  for h = (get (gca (), "children")).';
+    htype = get (h, "type");
     if (strcmp (htype, "surface"))
       fc = get (h, "facecolor");
       if ((! ischar (fc) && is_white (fc))
-          || (ischar (fc) && strcmpi (fc, "none")))
+          || (ischar (fc) && strcmp (fc, "none")))
         switch (mode)
         case "on"
           set (h, "facecolor", "w");
         case "off"
           set (h, "facecolor", "none");
-        case "swap"
+        case "toggle"
           if (ischar (fc))
             set (h, "facecolor", "w");
             mode = "on";
@@ -67,7 +74,7 @@
   endfor
 
   if (nargout > 0)
-    retval = mode;
+    state = mode;
   endif
 
 endfunction
@@ -75,3 +82,4 @@
 function retval = is_white (color)
   retval = all (color == 1);
 endfunction
+
--- a/scripts/plot/hold.m
+++ b/scripts/plot/hold.m
@@ -18,7 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Command} {} hold
-## @deftypefnx {Command} {} hold @var{state}
+## @deftypefnx {Command} {} hold on
+## @deftypefnx {Command} {} hold off
+## @deftypefnx {Command} {} hold all
 ## @deftypefnx {Function File} {} hold (@var{hax}, @dots{})
 ## Toggle or set the "hold" state of the plotting engine which determines
 ## whether new graphic objects are added to the plot or replace the existing
@@ -30,13 +32,13 @@
 ## on a single graph.
 ##
 ## @item hold all
-## Retain plot line color, line style, data and settings so that subsequent
+## Retain plot line color, line style, data, and settings so that subsequent
 ## plot commands are displayed on a single graph with the next line color and
 ## style.
 ##
 ## @item hold off
-## Clear plot and restore default graphics settings before each new plot
-## command.  (default).
+## Restore default graphics settings which clear the graph and reset axis
+## properties before each new plot command.  (default).
 ##
 ## @item hold
 ## Toggle the current hold state.
@@ -46,26 +48,30 @@
 ## only for the given axis handle.
 ##
 ## To query the current hold state use the @code{ishold} function.
-## @seealso{ishold, cla, newplot, clf}
+## @seealso{ishold, cla, clf, newplot}
 ## @end deftypefn
 
 function hold (varargin)
 
-  if (nargin > 0 && numel (varargin{1}) == 1 && ishandle (varargin{1})
+  if (nargin > 0 && isscalar (varargin{1}) && ishandle (varargin{1})
       && strcmp (get (varargin{1}, "type"), "axes"))
-    [ax, varargin, nargs] = __plt_get_axis_arg__ ("hold", varargin{:});
-    fig = get (ax, "parent");
+    [hax, varargin, nargs] = __plt_get_axis_arg__ ("hold", varargin{:});
+    if (isempty (hax))
+      hax = gca ();
+    endif
+    ## FIXME: Should this be ancestor (hax, "parent")?
+    hfig = get (hax, "parent");
   elseif (nargin > 0 && numel (varargin{1}) > 1 && ishandle (varargin{1}))
     print_usage ();
   else
-    ax = gca ();
-    fig = gcf ();
+    hax = gca ();
+    hfig = gcf ();
     nargs = numel (varargin);
   endif
 
   hold_all = false;
   if (nargs == 0)
-    turn_hold_off = ishold (ax);
+    turn_hold_off = ishold (hax);
   elseif (nargs == 1)
     state = varargin{1};
     if (ischar (state))
@@ -85,18 +91,36 @@
   endif
 
   if (turn_hold_off)
-    set (ax, "nextplot", "replace");
+    set (hax, "nextplot", "replace");
   else
-    set (ax, "nextplot", "add");
-    set (fig, "nextplot", "add");
+    set (hax, "nextplot", "add");
+    set (hfig, "nextplot", "add");
   endif
-  set (ax, "__hold_all__", hold_all);
+  set (hax, "__hold_all__", hold_all);
 
 endfunction
 
 
 %!demo
 %! clf;
+%! t = linspace (0, 2*pi, 100);
+%! plot (t, sin (t));
+%! hold on;
+%! plot (t, cos (t));
+%! title ({'hold on', '2 plots shown on same graph'});
+%! hold off;
+
+%!demo
+%! clf;
+%! t = linspace (0, 2*pi, 100);
+%! plot (t, sin (t));
+%! hold all;
+%! plot (t, cos (t));
+%! title ({'hold all', '2 plots shown on same graph with linestyle also preserved'});
+%! hold off;
+
+%!demo
+%! clf;
 %! A = rand (100);
 %! [X, Y] = find (A > 0.9);
 %! imshow (A);
@@ -143,7 +167,7 @@
 %! colorbar ('SouthOutside');
 %! title ('Test script for some plot functions');
 
-##hold on
+## hold on test
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
@@ -159,7 +183,7 @@
 %!   close (hf);
 %! end_unwind_protect
 
-##hold off
+## hold off test
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
--- a/scripts/plot/isfigure.m
+++ b/scripts/plot/isfigure.m
@@ -18,8 +18,11 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} isfigure (@var{h})
-## Return true if @var{h} is a graphics handle that contains a figure
-## object.
+## Return true if @var{h} is a figure graphics handle and false otherwise.
+##
+## If @var{h} is a matrix then return a logical array which is true where
+## the elements of @var{h} are figure graphics handles and false where
+## they are not.
 ## @seealso{ishandle}
 ## @end deftypefn
 
@@ -27,10 +30,15 @@
 
 function retval = isfigure (h)
 
-  if (nargin == 1)
-    retval = (ishandle (h) && strcmp (get (h, "type"), "figure"));
+  if (nargin != 1)
+    print_usage ();
+  endif
+
+  hlist = ishandle (h);
+  if (any (hlist))
+    retval(hlist) = strcmp (get (h(hlist), "type"), "figure");
   else
-    print_usage ();
+    retval = hlist;
   endif
 
 endfunction
--- a/scripts/plot/ishghandle.m
+++ b/scripts/plot/ishghandle.m
@@ -18,7 +18,10 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} ishghandle (@var{h})
-## Return true if @var{h} is a graphics handle and false otherwise.
+## Return true if @var{h} is a graphics handle and false otherwise.  This
+## function is equivalent to @code{ishandle} and is provided for compatibility
+## with @sc{matlab}.
+## @seealso{ishandle}
 ## @end deftypefn
 
 function retval = ishghandle (h)
--- a/scripts/plot/isosurface.m
+++ b/scripts/plot/isosurface.m
@@ -51,7 +51,7 @@
 ##
 ## If called with two or three output arguments then return the
 ## information about the faces @var{f}, vertices @var{v} and color data
-## @var{c} as seperate arrays instead of a single structure array.
+## @var{c} as separate arrays instead of a single structure array.
 ##
 ## If called with no output argument then directly process the
 ## isosurface geometry with the @command{patch} command.
@@ -150,7 +150,7 @@
   endif
   if (calc_colors)
     if (nargout == 2)
-      warning ( "Colors will be calculated, but you did not specify an output argument for it!" );
+      warning ("isosurface: colors will be calculated, but no output argument to receive it.");
     endif
     [fvc.faces, fvc.vertices, fvc.facevertexcdata] = __marching_cube__ (x, y, z, val, iso, colors);
   else
@@ -158,13 +158,13 @@
   endif
 
   if (isempty (fvc.vertices) || isempty (fvc.faces))
-    warning ( "The resulting triangulation is empty" );
+    warning ("isosurface: triangulation is empty");
   endif
 
   switch (nargout)
     case 0
       ## plot the calculated surface
-      newplot ();
+      hax = newplot ();
       if (calc_colors)
         pa = patch ("Faces", fvc.faces, "Vertices", fvc.vertices,
                     "FaceVertexCData", fvc.facevertexcdata,
@@ -174,8 +174,8 @@
                     "FaceColor", "g", "EdgeColor", "k");
       endif
       if (! ishold ())
-        set (gca (), "view", [-37.5, 30],
-             "xgrid", "on", "ygrid", "on", "zgrid", "on");
+        set (hax, "view", [-37.5, 30],
+                  "xgrid", "on", "ygrid", "on", "zgrid", "on");
       endif
     case 1
       varargout = {fvc};
@@ -197,15 +197,17 @@
 %! isosurface (x, y, z, v, 1);
 
 %!shared x, y, z, val
-%! [x, y, z]  = meshgrid (0:1, 0:1, 0:1); %% Points for single
-%! val        = [0, 0; 0, 0];             %% cube and a 3-D
-%! val(:,:,2) = [0, 0; 1, 0];             %% array of values
+%! [x, y, z]  = meshgrid (0:1, 0:1, 0:1); # Points for single
+%! val        = [0, 0; 0, 0];             # cube and a 3-D
+%! val(:,:,2) = [0, 0; 1, 0];             # array of values
+
 %!test
 %! fv = isosurface (x, y, z, val, 0.3);
 %! assert (isfield (fv, "vertices"), true);
 %! assert (isfield (fv, "faces"), true);
 %! assert (size (fv.vertices), [3 3]);
 %! assert (size (fv.faces), [1 3]);
+
 %!test
 %! fvc = isosurface (x, y, z, val, .3, y);
 %! assert (isfield (fvc, "vertices"), true);
@@ -214,10 +216,12 @@
 %! assert (size (fvc.vertices), [3 3]);
 %! assert (size (fvc.faces), [1 3]);
 %! assert (size (fvc.facevertexcdata), [3 1]);
+
 %!test
 %! [f, v] = isosurface (x, y, z, val, .3);
 %! assert (size (f), [1 3]);
 %! assert (size (v), [3 3]);
+
 %!test
 %! [f, v, c] = isosurface (x, y, z, val, .3, y);
 %! assert (size (f), [1 3]);
--- a/scripts/plot/legend.m
+++ b/scripts/plot/legend.m
@@ -125,7 +125,7 @@
 ## The legend label text is either provided in the call to @code{legend} or
 ## is taken from the DisplayName property of graphics objects.  If no
 ## labels or DisplayNames are available, then the label text is simply
-## "data1", "data2", @dots{}, "dataN".
+## "data1", "data2", @dots{}, @nospell{"dataN"}.
 ## @end deftypefn
 
 function [hlegend2, hobjects2, hplot2, text_strings2] = legend (varargin)
@@ -134,7 +134,10 @@
       && (! ishandle (varargin{1})
           || (strcmp (get (varargin{1}, "type"), "axes")
               && ! strcmp (get (varargin{1}, "tag"), "legend"))))
-    [ca, varargin, nargs] = __plt_get_axis_arg__ ("legend", varargin{:});
+    [ca, varargin, nargin] = __plt_get_axis_arg__ ("legend", varargin{:});
+    if (isempty (ca))
+      ca = gca ();
+    endif
     fig = get (ca, "parent");
   else
     fig = get (0, "currentfigure");
@@ -177,31 +180,31 @@
   nkids = numel (kids);
 
   orientation = "default";
-  position = "default";
+  location = "default";
   show = "create";
   textpos = "default";
   box = "default";
 
-  ## Process old way of specifying position with a number rather than a string.
+  ## Process old way of specifying location with a number rather than a string.
   if (nargs > 0)
     pos = varargin{nargs};
     if (isnumeric (pos) && isscalar (pos) && pos == fix (pos))
       if (pos >= -1 && pos <= 4)
-        position = [{"northeastoutside", "best", "northeast",
+        location = [{"northeastoutside", "best", "northeast",
                      "northwest", "southwest", "southeast"}] {pos + 2};
         nargs--;
       else
-        error ("legend: invalid position specified");
+        error ("legend: invalid location specified");
       endif
     endif
   endif
 
-  ## Find position and orientation property/value pairs
+  ## Find location and orientation property/value pairs
   while (nargs > 1)
     pos = varargin{nargs-1};
     str = varargin{nargs};
     if (strcmpi (pos, "location") && ischar (str))
-      position = lower (str);
+      location = lower (str);
       nargs -= 2;
     elseif (strcmpi (pos, "orientation") && ischar (str))
       orientation = lower (str);
@@ -214,28 +217,29 @@
   ## Validate the orientation
   switch (orientation)
     case {"vertical", "horizontal", "default"}
+      ## These are all accepted orientations.
     otherwise
       error ("legend: unrecognized legend orientation");
   endswitch
 
-  ## Validate the position type
+  ## Validate the location type
   outside = false;
-  inout = strfind (position, "outside");
+  inout = strfind (location, "outside");
   if (! isempty (inout))
     outside = true;
-    position = position(1:inout-1);
+    location = location(1:inout-1);
   else
     outside = false;
   endif
 
-  switch (position)
+  switch (location)
     case {"north", "south", "east", "west", "northeast", "northwest", ...
           "southeast", "southwest", "default"}
     case "best"
-      warning ("legend: 'Best' not yet implemented for location specifier\n");
-      position = "northeast";
+      warning ("legend: 'best' not yet implemented for location specifier\n");
+      location = "northeast";
     otherwise
-      error ("legend: unrecognized legend position");
+      error ("legend: unrecognized legend location");
   endswitch
 
   ## Find any existing legend object on figure
@@ -341,28 +345,28 @@
     if (! isempty (hlegend))
       set (hlegend, "box", "off", "visible", "off");
     endif
-  elseif (! have_labels && !(strcmp (position, "default") &&
+  elseif (! have_labels && !(strcmp (location, "default") &&
                              strcmp (orientation, "default")))
     ## Changing location or orientation of existing legend
     if (! isempty (hlegend))
       hax = getfield (get (hlegend, "userdata"), "handle");
       [hplots, text_strings] = __getlegenddata__ (hlegend);
 
-      if (strcmp (position, "default"))
+      if (strcmp (location, "default"))
         h = legend (hax, hplots, text_strings, "orientation", orientation);
       elseif (strcmp (orientation, "default"))
         if (outside)
           h = legend (hax, hplots, text_strings, "location",
-                      strcat (position, "outside"));
+                      strcat (location, "outside"));
         else
-          h = legend (hax, hplots, text_strings, "location", position);
+          h = legend (hax, hplots, text_strings, "location", location);
         endif
       else
         if (outside)
           h = legend (hax, hplots, text_strings, "location",
-                      strcat (position, "outside"), "orientation", orientation);
+                      strcat (location, "outside"), "orientation", orientation);
         else
-          h = legend (hax, hplots, text_strings, "location", position,
+          h = legend (hax, hplots, text_strings, "location", location,
                       "orientation", orientation);
         endif
       endif
@@ -420,7 +424,9 @@
     if (have_labels || ! have_dname)
       k = nkids;
       if (! have_labels)
-        varargin = arrayfun (@(x) sprintf ("data%d", x), [1:nkids]', "uniformoutput", false);
+        varargin = arrayfun (@(x) sprintf ("data%d", x), [1:nkids]',
+                             "uniformoutput", false);
+        have_labels = true;
         nargs = nkids;
       endif
       for i = 1 : nargs
@@ -479,7 +485,7 @@
         endwhile
         if (! (strcmp (typ, "line") || strcmp (typ, "surface")
                || strcmp (typ, "patch") || strcmp (typ, "hggroup")))
-          break
+          break;
         endif
         if (k > 0)
           if (strcmp (get (kids(k), "type"), "hggroup"))
@@ -521,12 +527,12 @@
         if (strcmp (textpos, "default"))
           textpos = get (hlegend, "textposition");
         endif
-        if (strcmp (position, "default"))
-          position = get (hlegend, "location");
-          inout = strfind (position, "outside");
+        if (strcmp (location, "default"))
+          location = get (hlegend, "location");
+          inout = strfind (location, "outside");
           if (! isempty (inout))
             outside = true;
-            position = position(1:inout-1);
+            location = location(1:inout-1);
           else
             outside = false;
           endif
@@ -539,8 +545,8 @@
         if (strcmp (textpos, "default"))
           textpos = "left";
         endif
-        if (strcmp (position, "default"))
-          position = "northeast";
+        if (strcmp (location, "default"))
+          location = "northeast";
         endif
         if (strcmp (orientation, "default"))
           orientation = "vertical";
@@ -555,9 +561,21 @@
       unwind_protect
         set (ca(1), "units", "points");
         set (ca(1), "fontunits", "points");
-        ca_pos = get (ca(1), "position");
-        ca_outpos = get (ca(1), "outerposition");
+        if (isempty (hlegend) || ! isprop (hlegend, "unmodified_axes_position"))
+          unmodified_axes_position = get (ca(1), "position");
+          unmodified_axes_outerposition = get (ca(1), "outerposition");
+        else
+          unmodified_axes_position = get (hlegend, "unmodified_axes_position");
+          unmodified_axes_outerposition = get (hlegend, ...
+                                               "unmodified_axes_outerposition");
+        endif
+        ca_pos = unmodified_axes_position;
+        ca_outpos = unmodified_axes_outerposition;
         ca_fontsize = get (ca(1), "fontsize");
+        tightinset = get (ca(1), "tightinset");
+        for i = 2 : numel (ca)
+          tightinset = max (tightinset, get (ca(i), "tightinset"));
+        endfor
       unwind_protect_cleanup
         set (ca(1), "units", units);
         set (ca(1), "fontunits", fontunits);
@@ -567,7 +585,6 @@
       xpad = 2;
       ypad = 2;
 
-      ## Length of line segments in the legend in points
       linelength = 15;
 
       ## Create the axis first
@@ -661,13 +678,40 @@
         ystep = (ypad + maxheight);
         yoffset = ystep / 2;
 
-        ## Place the legend in the desired position
+        ## Place the legend in the desired location
         if (strcmp (orientation, "vertical"))
           lpos = [0, 0, num2 * xstep, num1 * ystep];
         else
           lpos = [0, 0, num1 * xstep, num2 * ystep];
         endif
-        switch (position)
+
+        gnuplot =  strcmp (get (fig, "__graphics_toolkit__"), "gnuplot");
+        if (gnuplot)
+          ## Gnuplot places the key (legend) at edge of the figure window.
+          ## OpenGL places the legend box at edge of the unmodified axes
+          ## position.
+          if (isempty (strfind (location, "east")))
+            gnuplot_offset = unmodified_axes_outerposition(1) ...
+                         + unmodified_axes_outerposition(3) ...
+                         - unmodified_axes_position(1) ...
+                         - unmodified_axes_position(3);
+          else
+            gnuplot_offset = unmodified_axes_position(1) ...
+                         - unmodified_axes_outerposition(1);
+          endif
+          ## FIXME - the "fontsize" is added to match the behavior of OpenGL.
+          ## This implies that a change in fontsize should trigger a listener
+          ## to update the legend.  The "2" was determined using a long legend
+          ## key in the absence of any subplots.
+          gnuplot_offset = gnuplot_offset - 2 * fontsize;
+        else
+          gnuplot_offset = 0;
+        endif
+
+        ## For legend's outside the associated axes postion, align their edge
+        ## to the unmodified_axes_outerpostion, and adjust the axes postion
+        ## accordingly.
+        switch (location)
           case "north"
             if (outside)
               lpos = [ca_pos(1) + (ca_pos(3) - lpos(3)) / 2, ...
@@ -683,7 +727,8 @@
             if (outside)
               lpos = [ca_pos(1) + (ca_pos(3) - lpos(3)) / 2, ...
                       ca_outpos(2) + ypad, lpos(3), lpos(4)];
-              new_pos = [ca_pos(1), ca_pos(2) + lpos(4), ca_pos(3), ...
+              new_pos = [ca_pos(1), lpos(2) + lpos(4) + 2 * ypad ...
+                      + tightinset(2), ca_pos(3), ...
                          ca_pos(4) - lpos(4)];
             else
               lpos = [ca_pos(1) + (ca_pos(3) - lpos(3)) / 2, ...
@@ -693,7 +738,10 @@
             if (outside)
               lpos = [ca_outpos(1) + ca_outpos(3) - lpos(3) - ypad, ...
                       ca_pos(2) + (ca_pos(4) - lpos(4)) / 2, lpos(3), lpos(4)];
-              new_pos = [ca_pos(1), ca_pos(2), ca_pos(3) - lpos(3), ca_pos(4)];
+              new_pos = [ca_pos(1), ca_pos(2), ...
+                         lpos(1) - 2 * xpad - ca_pos(1) - tightinset(3), ...
+                         ca_pos(4)];
+              new_pos(3) = new_pos(3) + gnuplot_offset;
             else
               lpos = [ca_pos(1) + ca_pos(3) - lpos(3) - ypad, ...
                       ca_pos(2) + (ca_pos(4) - lpos(4)) / 2, lpos(3), lpos(4)];
@@ -703,8 +751,10 @@
               lpos = [ca_outpos(1) + ypad, ...
                       ca_pos(2) + (ca_pos(4) - lpos(4)) / 2, ...
                       lpos(3), lpos(4)];
-              new_pos = [ca_pos(1) + lpos(3), ca_pos(2), ...
-                         ca_pos(3) - lpos(3), ca_pos(4)];
+              new_pos = [lpos(1) + lpos(3) + 2 * xpad + tightinset(1), ...
+                         ca_pos(2), ca_pos(3) - lpos(3) - 2 * xpad, ca_pos(4)];
+              new_pos(1) = new_pos(1) - gnuplot_offset;
+              new_pos(3) = new_pos(3) + gnuplot_offset;
             else
               lpos = [ca_pos(1) +  ypad, ...
                       ca_pos(2) + (ca_pos(4) - lpos(4)) / 2, lpos(3), lpos(4)];
@@ -713,7 +763,10 @@
             if (outside)
               lpos = [ca_outpos(1) + ca_outpos(3) - lpos(3) - ypad, ...
                       ca_pos(2) + ca_pos(4) - lpos(4), lpos(3), lpos(4)];
-              new_pos = [ca_pos(1), ca_pos(2), ca_pos(3) - lpos(3), ca_pos(4)];
+              new_pos = [ca_pos(1), ca_pos(2), ...
+                         lpos(1) - 2 * xpad - tightinset(3) - ca_pos(1), ...
+                         ca_pos(4)];
+              new_pos(3) = new_pos(3) + gnuplot_offset;
             else
               lpos = [ca_pos(1) + ca_pos(3) - lpos(3) - ypad, ...
                       ca_pos(2) + ca_pos(4) - lpos(4) - ypad, lpos(3), lpos(4)];
@@ -722,8 +775,10 @@
             if (outside)
               lpos = [ca_outpos(1) + ypad , ca_pos(2) + ca_pos(4) - lpos(4), ...
                       lpos(3), lpos(4)];
-              new_pos = [ca_pos(1) + lpos(3), ca_pos(2), ...
-                         ca_pos(3) - lpos(3), ca_pos(4)];
+              new_pos = [lpos(1) + lpos(3) + 2 * xpad + tightinset(1), ...
+              ca_pos(2), ca_pos(3) - lpos(3) - 2 * xpad, ca_pos(4)];
+              new_pos(1) = new_pos(1) - gnuplot_offset;
+              new_pos(3) = new_pos(3) + gnuplot_offset;
             else
               lpos = [ca_pos(1) + ypad, ...
                       ca_pos(2) + ca_pos(4) - lpos(4) - ypad, lpos(3), lpos(4)];
@@ -733,7 +788,9 @@
               lpos = [ca_outpos(1) + ca_outpos(3) - lpos(3) - ypad, ...
                       ca_pos(2), lpos(3), lpos(4)];
               new_pos = [ca_pos(1), ca_pos(2), ...
-                         ca_pos(3) - lpos(3), ca_pos(4)];
+                         lpos(1) - 2 * xpad - ca_pos(1) - tightinset(3), ...
+                         ca_pos(4)];
+              new_pos(3) = new_pos(3) + gnuplot_offset;
             else
               lpos = [ca_pos(1) + ca_pos(3) - lpos(3) - ypad, ...
                       ca_pos(2) + ypad, lpos(3), lpos(4)];
@@ -741,8 +798,10 @@
           case "southwest"
             if (outside)
               lpos = [ca_outpos(1) + ypad, ca_pos(2), lpos(3), lpos(4)];
-              new_pos = [ca_pos(1) + lpos(3), ca_pos(2), ...
-                         ca_pos(3) - lpos(3), ca_pos(4)];
+              new_pos = [lpos(1) + lpos(3) + 2 * xpad + tightinset(1), ...
+              ca_pos(2), ca_pos(3) - lpos(3) - 2 * xpad, ca_pos(4)];
+              new_pos(1) = new_pos(1) - gnuplot_offset;
+              new_pos(3) = new_pos(3) + gnuplot_offset;
             else
               lpos = [ca_pos(1) + ypad, ca_pos(2) + ypad, lpos(3), lpos(4)];
             endif
@@ -784,13 +843,20 @@
               hobjects = [hobjects, l1];
             endif
 
-            addlistener (hplots(k), "color", {@updateline, hlegend, linelength});
-            addlistener (hplots(k), "linestyle", {@updateline, hlegend, linelength});
-            addlistener (hplots(k), "marker", {@updateline, hlegend, linelength});
-            addlistener (hplots(k), "markeredgecolor", {@updateline, hlegend, linelength});
-            addlistener (hplots(k), "markerfacecolor", {@updateline, hlegend, linelength});
-            addlistener (hplots(k), "markersize", {@updateline, hlegend, linelength});
-            addlistener (hplots(k), "displayname", {@updateline, hlegend, linelength});
+            addlistener (hplots(k), "color",
+                         {@updateline, hlegend, linelength});
+            addlistener (hplots(k), "linestyle",
+                         {@updateline, hlegend, linelength});
+            addlistener (hplots(k), "marker",
+                         {@updateline, hlegend, linelength});
+            addlistener (hplots(k), "markeredgecolor",
+                         {@updateline, hlegend, linelength});
+            addlistener (hplots(k), "markerfacecolor",
+                         {@updateline, hlegend, linelength});
+            addlistener (hplots(k), "markersize",
+                         {@updateline, hlegend, linelength});
+            addlistener (hplots(k), "displayname",
+                         {@updateline, hlegend, linelength});
           case "patch"
             facecolor = get (hplots(k), "facecolor");
             edgecolor = get (hplots(k), "edgecolor");
@@ -800,8 +866,8 @@
                                    xoffset + xk * xstep) / lpos(3),
                          "ydata", (lpos(4) - yoffset -
                                    [yk-0.3, yk-0.3, yk+0.3, yk+0.3] .* ystep) / lpos(4),
-                         "facecolor", facecolor, "edgecolor", edgecolor, "cdata", cdata,
-                         "userdata", hplots(k));
+                         "facecolor", facecolor, "edgecolor", edgecolor,
+                         "cdata", cdata, "userdata", hplots(k));
               hobjects = [hobjects, p1];
             endif
           case "surface"
@@ -825,10 +891,24 @@
 
         ## Add an invisible text object to original axis
         ## that when it is destroyed will remove the legend
-        t1 = text (0, 0, "", "parent", ca(1), "tag", "legend",
-                   "handlevisibility", "off", "visible", "off",
-                   "xliminclude", "off", "yliminclude", "off");
-        set (t1, "deletefcn", {@deletelegend1, hlegend});
+        props = {"parent", ca(1), "tag", "legend", ...
+                 "handlevisibility", "off", "visible", "off", ...
+                 "xliminclude", "off", "yliminclude", "off"};
+        t1 = findall (ca(1), props{3:4}, "type", "text");
+        if (isempty (t1))
+          t1 = text (0, 0, "", props{:});
+          set (t1, "deletefcn", {@deletelegend1, hlegend});
+        endif
+        if (isprop (hlegend, "unmodified_axes_position"))
+          set (hlegend, "unmodified_axes_position", unmodified_axes_position);
+          set (hlegend, "unmodified_axes_outerposition", 
+               unmodified_axes_outerposition);
+        else
+          addproperty ("unmodified_axes_position", hlegend,
+                       "data", unmodified_axes_position);
+          addproperty ("unmodified_axes_outerposition", hlegend,
+                       "data", unmodified_axes_outerposition);
+        endif
 
         ## Resize the axis that the legend is attached to if the
         ## legend is "outside" the plot and create a listener to
@@ -839,16 +919,28 @@
             units = get (ca(i), "units");
             unwind_protect
               set (ca(i), "units", "points");
-              set (ca(i), "position", new_pos);
+              if (gnuplot && numel (ca) == 1)
+                ## Let Gnuplot handle the positioning of the keybox.
+                ## This violates strict Matlab compatibility, but reliably
+                ## renders an esthetic result.
+                set (ca(i), "position",  unmodified_axes_position);
+                set (ca(i), "activepositionproperty", "outerposition")
+              else
+                ## numel (ca) > 1 for axes overlays (like plotyy)
+                set (ca(i), "position", new_pos);
+              endif
             unwind_protect_cleanup
               set (ca(i), "units", units);
             end_unwind_protect
           endfor
 
           set (hlegend, "deletefcn", {@deletelegend2, ca, ...
-                                      ca_pos, ca_outpos, t1, hplots});
+                                      unmodified_axes_position, ...
+                                      unmodified_axes_outerposition, ...
+                                      t1, hplots});
           addlistener (hlegend, "visible", {@hideshowlegend, ca, ...
-                                            ca_pos, new_pos});
+                                            unmodified_axes_position, ...
+                                            new_pos});
         else
           set (hlegend, "deletefcn", {@deletelegend2, ca, [], [], t1, hplots});
         endif
@@ -856,7 +948,13 @@
         if (addprops)
           addproperty ("edgecolor", hlegend, "color", [0, 0, 0]);
           addproperty ("textcolor", hlegend, "color", [0, 0, 0]);
-          addproperty ("location", hlegend, "radio", "north|south|east|west|{northeast}|southeast|northwest|southwest|northoutside|southoutside|eastoutside|westoutside|northeastoutside|southeastoutside|northwestoutside|southwestoutside");
+          locations = {"north", "south", "east", "west", ...
+                       "northeast", "southeast", "northwest", "southwest", ...
+                       "northoutside", "southoutside", ...
+                       "eastoutside", "westoutside", ...
+                       "northeastoutside", "southeastoutside", ...
+                       "northwestoutside", "southwestoutside"};
+          addproperty ("location", hlegend, "radio", strjoin (locations, "|"));
           addproperty ("orientation", hlegend, "radio",
                        "{vertical}|horizontal");
           addproperty ("string", hlegend, "any", text_strings);
@@ -866,21 +964,24 @@
         endif
 
         if (outside)
-          set (hlegend, "location", strcat (position, "outside"),
+          set (hlegend, "location", strcat (location, "outside"),
                "orientation", orientation, "textposition", textpos);
         else
-          set (hlegend, "location", position, "orientation", orientation,
+          set (hlegend, "location", location, "orientation", orientation,
                "textposition", textpos);
         endif
         if (addprops)
           addlistener (hlegend, "edgecolor", @updatelegendtext);
           addlistener (hlegend, "textcolor", @updatelegendtext);
-          addlistener (hlegend, "fontsize", @updatelegend);
+          addlistener (hlegend, "fontsize", @updatelegendtext);
           addlistener (hlegend, "interpreter", @updatelegendtext);
           addlistener (hlegend, "location", @updatelegend);
           addlistener (hlegend, "orientation", @updatelegend);
           addlistener (hlegend, "string", @updatelegend);
           addlistener (hlegend, "textposition", @updatelegend);
+          ## TODO - need to add listeners for tighinset and position
+          ##        addlistener (ca, "tightinset", @update????);
+          ##        addlistener (ca, "position", @update????);
         endif
       unwind_protect_cleanup
         set (fig, "currentaxes", curaxes);
@@ -899,16 +1000,31 @@
 
 function updatelegend (h, d)
   persistent recursive = false;
+
   if (! recursive)
     recursive = true;
     unwind_protect
       hax = getfield (get (h, "userdata"), "handle");
       [hplots, text_strings] = __getlegenddata__ (h);
+      position = get (h, "unmodified_axes_position");
+      outerposition = get (h, "unmodified_axes_outerposition");
+      units = get (hax, "units");
+      set (hax, "units", "points");
+      switch (get (hax, "activepositionproperty"))
+      case "position"
+        set (hax, "outerposition", outerposition);
+        set (hax, "position", position);
+      case "outerposition"
+        set (hax, "position", position);
+        set (hax, "outerposition", outerposition);
+      endswitch
+      set (hax, "units", units);
       h = legend (hax, hplots, get (h, "string"));
     unwind_protect_cleanup
       recursive = false;
     end_unwind_protect
   endif
+
 endfunction
 
 function updatelegendtext (h, d)
@@ -1029,8 +1145,8 @@
   elseif ((!isempty (displayname)
            && (! strcmp (marker, "none") || ! strcmp (linestyle, "none")))
           && isempty (lm) && isempty (ll))
-    ## An element was added to the legend. Need to recall the
-    ## legend function to recreate a new legend
+    ## An element was added to the legend.  Need to re-call the
+    ## legend function to recreate a new legend.
     [hplots, text_strings] = __getlegenddata__ (hlegend);
     hplots = [hplots, h];
     text_strings = {text_strings{:}, displayname};
@@ -1067,21 +1183,28 @@
   endif
 endfunction
 
+
 %!demo
+%! clf;
 %! plot (rand (2));
 %! title ('legend called with cellstr and string inputs for labels');
 %! h = legend ({'foo'}, 'bar');
-%! set (h, 'fontsize', 20)
+%! legend location northeastoutside
+%! set (h, 'fontsize', 20);
 
 %!demo
+%! clf;
 %! plot (rand (3));
 %! title ('legend() without inputs creates default labels');
-%! legend ();
+%! h = legend ();
 
 %!demo
 %! clf;
 %! x = 0:1;
 %! plot (x,x,';I am Blue;', x,2*x, x,3*x,';I am Red;');
+%! legend location northeastoutside
+%! ## Placing legend inside should return axes to original size
+%! legend location northeast
 %! title ('Blue and Red keys, with Green missing');
 
 %!demo
@@ -1089,32 +1212,37 @@
 %! plot (1:10, 1:10, 1:10, fliplr (1:10));
 %! title ('incline is blue and decline is green');
 %! legend ({'I am blue', 'I am green'}, 'location', 'east');
+%! legend hide
+%! legend show
 
 %!demo
 %! clf;
 %! plot (1:10, 1:10, 1:10, fliplr (1:10));
 %! title ('Legend with keys in horizontal orientation');
-%! legend ({'I am blue', 'I am green'}, 'location', 'east', 'orientation', 'horizontal');
-%! legend boxoff;
+%! legend ({'I am blue', 'I am green'}, ...
+%!         'location', 'east', 'orientation', 'horizontal');
+%! legend boxoff
+%! legend boxon
 
 %!demo
 %! clf;
 %! plot (1:10, 1:10, 1:10, fliplr (1:10));
 %! title ('Legend with box off');
 %! legend ({'I am blue', 'I am green'}, 'location', 'east');
-%! legend boxoff;
+%! legend boxoff
 
 %!demo
 %! clf;
 %! plot (1:10, 1:10, 1:10, fliplr (1:10));
 %! title ('Legend with text to the right of key');
 %! legend ({'I am blue', 'I am green'}, 'location', 'east');
-%! legend right;
+%! legend right
 
 %!demo
 %! clf;
 %! plot (1:10, 1:10, 1:10, fliplr (1:10));
-%! title ('Using properties to have legend text shown to the right of key');
+%! title ({'Use properties to place legend text to the right of key', ...
+%!         'Legend text color is magenta'});
 %! h = legend ({'I am blue', 'I am green'}, 'location', 'east');
 %! legend ('left');
 %! set (h, 'textposition', 'right');
@@ -1125,13 +1253,14 @@
 %! plot (1:10, 1:10, 1:10, fliplr (1:10));
 %! title ('Legend is hidden')
 %! legend ({'I am blue', 'I am green'}, 'location', 'east');
-%! legend hide;
+%! legend hide
 
 %!demo
 %! clf;
 %! x = 0:1;
 %! plot (x,x,';I am Blue;', x,2*x,';I am Green;', x,3*x,';I am Red;');
-%! title ('labels embedded in call to plot');
+%! title ({'Labels are embedded in call to plot', ...
+%!         'Legend is hidden and then shown'});
 %! legend boxon
 %! legend hide
 %! legend show
@@ -1142,7 +1271,7 @@
 %! plot (x, x, ';\alpha;',  ...
 %!       x, 2*x, ';\beta=2\alpha;',  ...
 %!       x, 3*x, ';\gamma=3\alpha;');
-%! title ('labels with interpreted Greek text');
+%! title ('Labels with interpreted Greek text');
 
 %!demo
 %! clf;
@@ -1273,6 +1402,7 @@
 %! legend ('Hello', 'World', 'interpreter', 'foobar');
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! y1 = rand (size (x));
 %! y2 = rand (size (x));
@@ -1281,6 +1411,7 @@
 %! legend ([h1, h2], {'Blue', 'Green'}, 'location', 'south');
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! y1 = rand (size (x));
 %! y2 = rand (size (x));
@@ -1289,6 +1420,7 @@
 %! legend ({'Blue', 'Green'}, 'location', 'south');
 
 %!demo
+%! clf;
 %! x = 0:10;
 %! y1 = rand (size (x));
 %! y2 = rand (size (x));
@@ -1296,3 +1428,137 @@
 %! title ('plotyy legend test #3: Blue and Green labels');
 %! legend ('Blue', 'Green', 'location', 'south');
 
+%!demo % bug 36408
+%! clf;
+%! option = 'right';
+%! subplot (3,1,1);
+%!  plot (rand (1,4));
+%!  xlabel xlabel;
+%!  ylabel ylabel;
+%!  title ('Subplots should adjust to the legend placed outside');
+%!  legend ({'1'}, 'location', 'northeastoutside');
+%!  legend (option);
+%! subplot (3,1,2);
+%!  plot (rand (1,4));
+%!  xlabel xlabel;
+%!  ylabel ylabel;
+%!  legend ({'1234567890'}, 'location', 'eastoutside');
+%!  legend (option);
+%! subplot (3,1,3);
+%!  plot (rand (1,4));
+%!  xlabel xlabel;
+%!  ylabel ylabel;
+%!  legend ({'12345678901234567890'}, 'location', 'southeastoutside');
+%!  legend (option);
+
+%!demo % bug 36408
+%! clf;
+%! option = 'right';
+%! subplot (3,1,1);
+%!  plot (rand (1,4));
+%!  title ('Subplots should adjust to the legend placed outside');
+%!  legend ({'1'}, 'location', 'northwestoutside');
+%!  legend (option);
+%! subplot (3,1,2);
+%!  plot (rand (1,4));
+%!  legend ({'1234567890'}, 'location', 'westoutside');
+%!  legend (option);
+%! subplot (3,1,3);
+%!  plot (rand (1,4));
+%!  legend ({'12345678901234567890'}, 'location', 'southwestoutside');
+%!  legend (option);
+
+%!demo % bug 36408
+%! clf;
+%! option = 'right';
+%! subplot (3,1,1);
+%!  plot (rand (1,4));
+%!  set (gca (), 'yaxislocation', 'right');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  title ('Subplots should adjust to the legend placed outside');
+%!  legend ({'1'}, 'location', 'northeastoutside');
+%!  legend (option);
+%! subplot (3,1,2);
+%!  plot (rand (1,4));
+%!  set (gca (), 'yaxislocation', 'right');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  legend ({'1234567890'}, 'location', 'eastoutside');
+%!  legend (option);
+%! subplot (3,1,3);
+%!  plot (rand (1,4));
+%!  set (gca (), 'yaxislocation', 'right');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  legend ({'12345678901234567890'}, 'location', 'southeastoutside');
+%!  legend (option);
+
+%!demo % bug 36408
+%! clf;
+%! option = 'right';
+%! subplot (3,1,1);
+%!  plot (rand (1,4));
+%!  set (gca (), 'yaxislocation', 'right');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  title ('Subplots should adjust to the legend placed outside');
+%!  legend ({'1'}, 'location', 'northwestoutside');
+%!  legend (option);
+%! subplot (3,1,2);
+%!  plot (rand (1,4));
+%!  set (gca (), 'yaxislocation', 'right');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  legend ({'1234567890'}, 'location', 'westoutside');
+%!  legend (option);
+%! subplot (3,1,3);
+%!  plot (rand (1,4));
+%!  set (gca (), 'yaxislocation', 'right');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  legend ({'12345678901234567890'}, 'location', 'southwestoutside');
+%!  legend (option);
+
+%!demo % bug 36408;
+%! clf;
+%! option = 'right';
+%! subplot (3,1,1);
+%!  plot (rand (1,4));
+%!  set (gca (), 'xaxislocation', 'top');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  title ('Subplots should adjust to the legend placed outside');
+%!  legend ({'1'}, 'location', 'northwestoutside');
+%!  legend (option);
+%! subplot (3,1,2);
+%!  plot (rand (1,4));
+%!  set (gca (), 'xaxislocation', 'top');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  legend ({'1234567890'}, 'location', 'westoutside');
+%!  legend (option);
+%! subplot (3,1,3);
+%!  plot (rand (1,4));
+%!  set (gca (), 'xaxislocation', 'top');
+%!  xlabel ('xlabel');
+%!  ylabel ('ylabel');
+%!  legend ({'12345678901234567890'}, 'location', 'southwestoutside');
+%!  legend (option);
+
+%!test
+%! toolkit = graphics_toolkit ("gnuplot");
+%! h = figure ("visible", "off")
+%! unwind_protect
+%!   position = get (h, "position");
+%!   plot (rand (3));
+%!   legend ();
+%!   filename = sprintf ("%s.eps", tmpnam ());
+%!   print (filename);
+%!   unlink (filename);
+%!   assert (get (h, "position"), position);
+%! unwind_protect_cleanup
+%!   close (h);
+%!   graphics_toolkit (toolkit);
+%! end_unwind_protect
+
--- a/scripts/plot/line.m
+++ b/scripts/plot/line.m
@@ -19,44 +19,57 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} line ()
 ## @deftypefnx {Function File} {} line (@var{x}, @var{y})
+## @deftypefnx {Function File} {} line (@var{x}, @var{y}, @var{property}, @var{value}, @dots{})
 ## @deftypefnx {Function File} {} line (@var{x}, @var{y}, @var{z})
 ## @deftypefnx {Function File} {} line (@var{x}, @var{y}, @var{z}, @var{property}, @var{value}, @dots{})
-## Create line object from @var{x} and @var{y} and insert in current
-## axes object.  Return a handle (or vector of handles) to the line
-## objects created.
+## @deftypefnx {Function File} {} line (@var{property}, @var{value}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} line (@dots{})
+## Create line object from @var{x} and @var{y} (and possibly @var{z}) and
+## insert in the current axes.
 ##
-## Multiple property-value pairs may be specified for the line, but they
+## Multiple property-value pairs may be specified for the line object, but they
 ## must appear in pairs.
+##
+## The optional return value @var{h} is a graphics handle (or vector of handles)
+## to the line objects created.
+##
+## @seealso{image, patch, rectangle, surface, text}
 ## @end deftypefn
 
 ## Author: jwe
 
 function h = line (varargin)
 
-  ## make a default line object, and make it the current axes for
-  ## the current figure.
-  tmp = __line__ (gca (), varargin{:});
+  ## Get axis argument which may be in a 'parent' PROP/VAL pair
+  [hax, varargin] = __plt_get_axis_arg__ ("line", varargin{:});
+
+  if (isempty (hax))
+    hax = gca ();
+  endif
+
+  htmp = __line__ (hax, varargin{:});
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
 
+
 %!demo
 %! clf
 %! x = 0:0.3:10;
 %! y1 = cos (x);
 %! y2 = sin (x);
 %! subplot (3,1,1);
-%! args = {"color", "b", "marker", "s"};
-%! line ([x(:), x(:)], [y1(:), y2(:)], args{:})
-%! title ("Test broadcasting for line()")
+%!  args = {'color', 'b', 'marker', 's'};
+%!  line ([x(:), x(:)], [y1(:), y2(:)], args{:});
+%!  title ('Test broadcasting for line()');
 %! subplot (3,1,2);
-%! line (x(:), [y1(:), y2(:)], args{:})
+%!  line (x(:), [y1(:), y2(:)], args{:});
 %! subplot (3,1,3);
-%! line ([x(:), x(:)+pi/2], y1(:), args{:})
-%! xlim ([0 10])
+%!  line ([x(:), x(:)+pi/2], y1(:), args{:});
+%!  xlim ([0 10]);
 
 %!test
 %! hf = figure ("visible", "off");
--- a/scripts/plot/loglog.m
+++ b/scripts/plot/loglog.m
@@ -33,33 +33,35 @@
 
 ## Author: jwe
 
-function retval = loglog (varargin)
+function h = loglog (varargin)
 
-  [h, varargin, nargs] = __plt_get_axis_arg__ ("loglog", varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("loglog", varargin{:});
 
   if (nargs < 1)
     print_usage ();
   endif
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
-    set (h, "xscale", "log", "yscale", "log");
-    if (any( strcmp (get (gca, "nextplot"), {"new", "replace"})))
-      set (h, "xminortick", "on", "yminortick", "on");
+    set (hax, "xscale", "log", "yscale", "log");
+    if (! ishold (hax))
+      set (hax, "xminortick", "on", "yminortick", "on");
     endif
 
-    tmp = __plt__ ("loglog", h, varargin{:});
+    htmp = __plt__ ("loglog", hax, varargin{:});
 
-    if (nargout > 0)
-      retval = tmp;
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
     endif
-  unwind_protect_cleanup
-    axes (oldh);
   end_unwind_protect
 
+  if (nargout > 0)
+    h = htmp;
+  endif
+
 endfunction
 
 
--- a/scripts/plot/loglogerr.m
+++ b/scripts/plot/loglogerr.m
@@ -17,10 +17,13 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} loglogerr (@var{args})
-## Produce two-dimensional plots on double logarithm axis with
-## errorbars.  Many different combinations of arguments are possible.
-## The most used form is
+## @deftypefn  {Function File} {} loglogerr (@var{args})
+## @deftypefnx {Function File} {@var{h} =} loglogerr (@var{args})
+## Produce two-dimensional plots on a double logarithm axis with
+## errorbars.
+##
+## Many different combinations of arguments are possible.  The most common
+## form is
 ##
 ## @example
 ## loglogerr (@var{x}, @var{y}, @var{ey}, @var{fmt})
@@ -29,7 +32,7 @@
 ## @noindent
 ## which produces a double logarithm plot of @var{y} versus @var{x}
 ## with errors in the @var{y}-scale defined by @var{ey} and the plot
-## format defined by @var{fmt}.  See errorbar for available formats and
+## format defined by @var{fmt}.  See @code{errorbar} for available formats and
 ## additional information.
 ## @seealso{errorbar, semilogxerr, semilogyerr}
 ## @end deftypefn
@@ -38,26 +41,30 @@
 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
 ## Keywords: errorbar, plotting
 
-function retval = loglogerr (varargin)
+function h = loglogerr (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("loglogerr", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("loglogerr", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
-    set (h, "xscale", "log", "yscale", "log");
-
-    tmp = __errcomm__ ("loglogerr", h, varargin{:});
+    set (hax, "xscale", "log", "yscale", "log");
+    if (! ishold (hax))
+      set (hax, "xminortick", "on", "yminortick", "on");
+    endif
+    htmp = __errcomm__ ("loglogerr", hax, varargin{:});
 
-    if (nargout > 0)
-      retval = tmp;
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
     endif
-  unwind_protect_cleanup
-    axes (oldh);
   end_unwind_protect
 
+  if (nargout > 0)
+    h = htmp;
+  endif
+
 endfunction
 
 
--- a/scripts/plot/mesh.m
+++ b/scripts/plot/mesh.m
@@ -42,46 +42,56 @@
 
 function h = mesh (varargin)
 
-  newplot ();
-
-  tmp = surface (varargin{:});
-
-  ax = get (tmp, "parent");
-
-  set (tmp, "facecolor", "w");
-  set (tmp, "edgecolor", "flat");
-
-  if (! ishold ())
-    set (ax, "view", [-37.5, 30],
-         "xgrid", "on", "ygrid", "on", "zgrid", "on");
+  if (! all (cellfun ("isreal", varargin)))
+    error ("mesh: X, Y, Z, C arguments must be real");
   endif
 
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("mesh", varargin{:});
+
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+    htmp = surface (hax, varargin{:});
+
+    set (htmp, "facecolor", "w");
+    set (htmp, "edgecolor", "flat");
+
+    if (! ishold ())
+      set (hax, "view", [-37.5, 30],
+               "xgrid", "on", "ygrid", "on", "zgrid", "on");
+    endif
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
+
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
 
 
 %!demo
-%! clf ();
+%! clf;
 %! x = logspace (0,1,11);
 %! z = x'*x;
 %! mesh (x, x, z, z.^2);
-%! xlabel xlabel
-%! ylabel ylabel
-%! zlabel "linear scale"
+%! xlabel 'X-axis';
+%! ylabel 'Y-axis';
+%! zlabel 'linear scale';
 
 %!demo
-%! clf ();
+%! clf;
 %! x = logspace (0,1,11);
 %! z = x'*x;
 %! mesh (x, x, z, z.^2);
-%! set (gca, "zscale", "log")
-%! xlabel xlabel
-%! ylabel ylabel
-%! zlabel "log scale"
-%! if (strcmp (get (gcf, "__graphics_toolkit__"), "gnuplot"))
-%!   title ({"Gnuplot: mesh color is wrong", "This a Gnuplot bug"})
+%! set (gca, 'zscale', 'log');
+%! xlabel 'X-axis';
+%! ylabel 'Y-axis';
+%! zlabel 'log scale';
+%! if (strcmp (get (gcf, '__graphics_toolkit__'), 'gnuplot'))
+%!   title ({'Gnuplot: mesh color is wrong', 'This is a Gnuplot bug'});
 %! endif
 
--- a/scripts/plot/meshc.m
+++ b/scripts/plot/meshc.m
@@ -29,33 +29,46 @@
 
 function h = meshc (varargin)
 
-  newplot ();
-
-  tmp = surface (varargin{:});
-
-  ax = get (tmp, "parent");
-
-  set (tmp, "facecolor", "w");
-  set (tmp, "edgecolor", "flat");
-  ## FIXME - gnuplot does not support a filled surface and a
-  ## non-filled contour. 3D filled patches are also not supported.
-  ## Thus, the facecolor will be transparent for the gnuplot
-  ## backend.
-
-  if (! ishold ())
-    set (ax, "view", [-37.5, 30],
-         "xgrid", "on", "ygrid", "on", "zgrid", "on");
+  if (! all (cellfun ("isreal", varargin)))
+    error ("meshc: X, Y, Z, C arguments must be real");
   endif
 
-  drawnow ();
-  zmin = get (ax, "zlim")(1);
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("meshc", varargin{:});
+
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+
+    htmp = surface (hax, varargin{:});
+
+    ## FIXME - gnuplot does not support a filled surface and a
+    ## non-filled contour.  3D filled patches are also not supported.
+    ## Thus, the facecolor will be transparent for the gnuplot backend.
+    set (htmp, "facecolor", "w");
+    set (htmp, "edgecolor", "flat");
 
-  [c, tmp2] = __contour__ (ax, zmin, varargin{:});
+    if (! ishold ())
+      set (hax, "view", [-37.5, 30],
+                "xgrid", "on", "ygrid", "on", "zgrid", "on");
+    endif
+
+    drawnow ();
+
+    zmin = get (hax, "zlim")(1);
 
-  tmp = [tmp; tmp2];
+    [~, htmp2] = __contour__ (hax, zmin, varargin{:});
+
+    htmp = [htmp; htmp2];
+
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
+
--- a/scripts/plot/meshz.m
+++ b/scripts/plot/meshz.m
@@ -27,24 +27,26 @@
 ## @seealso{meshgrid, mesh, contour}
 ## @end deftypefn
 
-function retval = meshz (varargin)
-
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("meshz", varargin{:});
+function h = meshz (varargin)
 
-  ioff = nargin + 1;
-  for i = 1:nargin
-    if (ischar (varargin{i}))
-      ioff = i;
-      break;
-    endif
-  endfor
-
-  ## Bundle C matrix back into varargin
-  if (ioff == 3 || ioff == 5)
-    ioff --;
+  if (! all (cellfun ("isreal", varargin)))
+    error ("meshz: X, Y, Z, C arguments must be real");
   endif
 
-  if (ioff == 2)
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("meshz", varargin{:});
+
+  ## Find where property/value pairs start
+  charidx = find (cellfun ("isclass", varargin, "char"), 1);
+
+  if (isempty (charidx))
+    if (nargin == 2 || nargin == 4) 
+      charidx = nargin;   # bundle C matrix back into varargin 
+    else
+      charidx = nargin + 1;
+    endif
+  endif
+
+  if (charidx == 2)
     z = varargin{1};
     [m, n] = size (z);
     x = 1:n;
@@ -55,34 +57,36 @@
     z = varargin{3};
   endif
 
-
   if (isvector (x) && isvector (y))
     x = [x(1), x(:).', x(end)];
     y = [y(1); y(:); y(end)];
   else
-    x = [x(1, 1), x(1, :), x(1, end);
-         x(:, 1), x, x(:, end);
-         x(end, 1), x(end, :), x(end, end)];
-    y = [y(1, 1), y(1, :), y(1, end);
-         y(:, 1), y, y(:, end);
-         y(end, 1), y(end, :), y(end, end)];
+    x = [x(1,1), x(1,:), x(1,end);
+         x(:,1), x, x(:,end);
+         x(end,1), x(end,:), x(end,end)];
+    y = [y(1,1), y(1,:), y(1,end);
+         y(:,1), y, y(:,end);
+         y(end,1), y(end,:), y(end,end)];
   endif
 
   zref = min (z(isfinite (z)));
   z = [zref .* ones(1, columns(z) + 2);
        zref .* ones(rows(z), 1), z, zref .* ones(rows(z), 1);
-       zref.* ones(1, columns(z) + 2)];
+       zref .* ones(1, columns(z) + 2)];
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    tmp = mesh (x, y, z, varargin{ioff:end});
+    hax = newplot (hax);
+    htmp = mesh (hax, x, y, z, varargin{charidx:end});
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
+
--- a/scripts/plot/ndgrid.m
+++ b/scripts/plot/ndgrid.m
@@ -34,11 +34,13 @@
 
 function varargout = ndgrid (varargin)
 
-  if (nargin == 1)
+  if (nargin == 0)
+    print_usage ();
+  elseif (nargin == 1)
     n = max ([nargout, 1]);
     ## If only one input argument is given, repeat it n-times
     varargin(1:n) = varargin(1);
-  elseif (nargin > 0 && nargin >= nargout)
+  elseif (nargin >= nargout)
     n = max ([nargin, 1]);
   else
     error ("ndgrid: wrong number of input arguments");
@@ -47,12 +49,10 @@
   ## Determine the size of the output arguments
 
   shape = zeros (1, n);
-
   for i = 1:n
-    if (! isvector (varargin{i}))
+    if (! isvector (varargin{i}) && ! isempty (varargin{i}))
       error ("ndgrid: arguments must be vectors");
     endif
-
     shape(i) = length (varargin{i});
   endfor
 
@@ -108,3 +108,11 @@
 %! assert (XX1, XX2.');
 %! assert (YY1, YY2.');
 
+%!assert (ndgrid ([]), zeros(0,1))
+%!assert (ndgrid ([], []), zeros(0,0))
+
+%% Test input validation
+%!error ndgrid ()
+%!error <wrong number of input arguments> [a,b,c] = ndgrid (1:3,1:3)
+%!error <arguments must be vectors> ndgrid (ones (2,2))
+
--- a/scripts/plot/newplot.m
+++ b/scripts/plot/newplot.m
@@ -18,56 +18,165 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} newplot ()
-## @deftypefnx {Function File} {@var{h} =} newplot ()
-## Prepare graphics engine to produce a new plot.  This function is
-## called at the beginning of all high-level plotting functions.
-## It is not normally required in user programs.
+## @deftypefnx {Function File} {} newplot (@var{hfig})
+## @deftypefnx {Function File} {} newplot (@var{hax})
+## @deftypefnx {Function File} {@var{hax} =} newplot (@dots{})
+## Prepare graphics engine to produce a new plot.
+##
+## This function is called at the beginning of all high-level plotting
+## functions.  It is not normally required in user programs.  @code{newplot}
+## queries the "NextPlot" field of the current figure and axis to determine
+## what to do.
+##
+## @multitable @columnfractions .25 .75
+## @headitem Figure NextPlot @tab Action
+## @item "new" @tab Create a new figure and make it the current figure.
+##
+## @item "add" (default) @tab Add new graphic objects to the current figure.
+##
+## @item "replacechildren" @tab Delete child objects whose HandleVisibility is
+## set to "on".  Set NextPlot property to "add".  This typically clears a
+## figure, but leaves in place hidden objects such as menubars.  This is
+## equivalent to @code{clf}.
+##
+## @item "replace" @tab Delete all child objects of the figure and reset all
+## figure properties to their defaults.  However, the following four properties
+## are not reset: Position, Units, PaperPosition, PaperUnits.  This is
+## equivalent to @code{clf reset}.
 ##
-## The optional return value @var{h} is a graphics handle to the created
-## axes (not figure).
+## @end multitable    
+##
+## @multitable @columnfractions .25 .75
+## @headitem Axis NextPlot @tab Action
+## @item "add" @tab Add new graphic objects to the current axes.  This is
+## equivalent to @code{hold on}.
+##
+## @item "replacechildren" @tab Delete child objects whose HandleVisibility is
+## set to "on", but leave axis properties unmodified.  This typically clears a
+## plot, but preserves special settings such as log scaling for axes.
+## This is equivalent to @code{cla}.
+##
+## @item "replace" (default) @tab Delete all child objects of the axis and reset all axis
+## properties to their defaults.  However, the following properties
+## are not reset: Position, Units.  This is equivalent to @code{cla reset}.
+##
+## @end multitable    
+##
+## If the optional input @var{hfig} or @var{hax} is given then prepare the
+## specified figure or axes rather than the current figure and axes.
+##
+## The optional return value @var{hax} is a graphics handle to the created
+## axes object (not figure).
+##
+## @strong{Caution:} Calling @code{newplot} may change the current figure and
+## current axis.
 ## @end deftypefn
 
-function h = newplot ()
+## FIXME: The Matlab function takes an optional list of file handles, hsave,
+##        which are not deleted when the figure and axes are prepared.
+##        I'm sure there is a good reason for that, but coding such
+##        compatibility is really tricky and doesn't serve much purpose since
+##        newplot is nearly exclusively used by Octave internal plotting
+##        functions.  In Octave's case the argument is almost always null,
+##        or occasionally the axis handle to plot into.
+
+function hax = newplot (hsave = [])
+
+  if (nargin > 1)
+    print_usage ();
+  endif
 
-  if (nargin == 0)
+  cf = [];
+  ca = [];
+
+  if (! isempty (hsave))
+    ## Find the first valid axes 
+    ca = ancestor (hsave, "axes", "toplevel"); 
+    ca = ca(find (ca, 1));
+    ## Next, find the figure associated with any axis found
+    if (! isempty (ca))
+      cf = ancestor (ca, "figure", "toplevel");
+    else
+      cf = ancestor (hsave, "figure", "toplevel"); 
+      cf = cf(find (cf, 1));
+    endif
+  endif
+
+  if (isempty (cf))
+    ## get current figure, or create a new one if necessary
     cf = gcf ();
-    fnp = get (cf, "nextplot");
-    switch (fnp)
-      ## FIXME -- probably we should do more than validate the nextplot
-      ## property value...
-      case "new"
-      case "add"
-      case "replacechildren"
-        delete (get (cf, "children"));
-      case "replace"
-      otherwise
-        error ("newplot: unrecognized nextplot property for current figure");
-    endswitch
+  else
+    ## switch to figure provided without causing other updates
+    set (0, "currentfigure", cf);
+  endif
+
+  fnp = get (cf, "nextplot");
+  switch (fnp)
+    case "add"
+      ## Default case.  Doesn't require action.
+    case "new"
+      ## Ordinarily, create a new figure to hold plot.
+      ## But, if user has requested preparing a specific axis, then
+      ## use the existing figure to hold the requested axis.
+      if (isempty (ca))
+        cf = figure ();
+      endif
+    case "replacechildren"
+      kids = get (cf, "children");
+      if (! isempty (ca))
+        kids(kids == ca) = [];
+      endif
+      delete (kids);
+    case "replace"
+      kids = allchild (cf);
+      if (! isempty (ca))
+        kids(kids == ca) = [];
+      endif
+      delete (kids);
+      reset (cf);
+  endswitch
+  set (cf, "nextplot", "add");  # Matlab compatibility
+
+  if (isempty (ca))
     ca = gca ();
-    anp = get (ca, "nextplot");
-    if (strcmp (get (ca, "__hold_all__"), "off"))
-      __next_line_color__ (true);
-      __next_line_style__ (true);
-    else
-      __next_line_color__ (false);
-      __next_line_style__ (false);
-    endif
-    switch (anp)
-      case "new"
-      case "add"
-      case "replacechildren"
-        delete (get (ca, "children"));
-      case "replace"
-        __go_axes_init__ (ca, "replace");
-        __request_drawnow__ ();
-      otherwise
-        error ("newplot: unrecognized nextplot property for current axes");
-    endswitch
-    if (nargout > 0)
-      h = ca;
-    endif
+  else
+    set (cf, "currentaxes", ca);
+  endif
+
+  ## FIXME: Is this necessary anymore?
+  ##        It seems like a kluge that belongs somewhere else.
+  if (strcmp (get (ca, "__hold_all__"), "off"))
+    __next_line_color__ (true);
+    __next_line_style__ (true);
   else
-    print_usage ();
+    __next_line_color__ (false);
+    __next_line_style__ (false);
+  endif
+
+  anp = get (ca, "nextplot");
+  switch (anp)
+    case "add"
+      ## Default case.  Doesn't require action.
+    case "replacechildren"
+      delete (get (ca, "children"));
+    case "replace"
+      __go_axes_init__ (ca, "replace");
+      __request_drawnow__ ();
+      ## FIXME: The code above should perform the following:
+      ###########################
+      ## delete (allchild (ca));
+      ## reset (ca);
+      ###########################
+      ## Actually, __go_axes_init__ does both less and more.
+      ## It doesn't really remove all children since it re-instantiates
+      ## xlabel, ylabel, zlabel, and title text objects.
+      ## Also it preserves font properties like fontsize.
+      ## For the time being, in order to have axis labels and title work,
+      ## the above code is is required.
+  endswitch
+
+  if (nargout > 0)
+    hax = ca;
   endif
 
 endfunction
@@ -77,8 +186,8 @@
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   p = plot ([0, 1]);
-%!   ha = newplot ();
-%!   assert (ha, gca);
+%!   hax = newplot ();
+%!   assert (hax, gca);
 %!   assert (isempty (get (gca, "children")));
 %! unwind_protect_cleanup
 %!   close (hf);
--- a/scripts/plot/pareto.m
+++ b/scripts/plot/pareto.m
@@ -38,7 +38,7 @@
 ##
 ## The data are passed as @var{x} and the abscissa as @var{y}.  If @var{y} is
 ## absent, then the abscissa are assumed to be @code{1 : length (@var{x})}.
-## @var{y} can be a string array, a cell array of strings or a numerical
+## @var{y} can be a string array, a cell array of strings, or a numerical
 ## vector.
 ##
 ## The optional return value @var{h} is a 2-element vector with a graphics
@@ -55,6 +55,7 @@
 ## pareto (Sold, Cheese);
 ## @end group
 ## @end example
+## @seealso{bar, barh, pie, plot}
 ## @end deftypefn
 
 function h = pareto (varargin)
--- a/scripts/plot/patch.m
+++ b/scripts/plot/patch.m
@@ -45,16 +45,20 @@
 
 function retval = patch (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("patch", varargin{:});
-
-  [tmp, failed] = __patch__ (h, varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("patch", varargin{:});
+  
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
+  [htmp, failed] = __patch__ (hax, varargin{:});
 
   if (failed)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = tmp;
+    retval = htmp;
   endif
 
 endfunction
--- a/scripts/plot/pcolor.m
+++ b/scripts/plot/pcolor.m
@@ -19,21 +19,24 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} pcolor (@var{x}, @var{y}, @var{c})
 ## @deftypefnx {Function File} {} pcolor (@var{c})
-## Density plot for given matrices @var{x}, and @var{y} from @code{meshgrid} and
-## a matrix @var{c} corresponding to the @var{x} and @var{y} coordinates of
-## the mesh's vertices.  If @var{x} and @var{y} are vectors, then a typical
-## vertex
-## is (@var{x}(j), @var{y}(i), @var{c}(i,j)).  Thus, columns of @var{c}
-## correspond to different @var{x} values and rows of @var{c} correspond
-## to different @var{y} values.
+## @deftypefnx {Function File} {} pcolor (@var{hax}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} pcolor (@dots{})
+## Produce a 2D density plot.
 ##
-## The @code{colormap} is scaled to the extents of @var{c}.
-## Limits may be placed on the color axis by the
-## command @code{caxis}, or by setting the @code{clim} property of the
-## parent axis.
+## A @code{pcolor} plot draws rectangles with colors from the matrix @var{c}
+## over the two-dimensional region represented by the matrices @var{x} and
+## @var{y}.  @var{x} and @var{y} are the coordinates of the mesh's vertices
+## and are typically the output of @code{meshgrid}.  If @var{x} and @var{y} are
+## vectors, then a typical vertex is (@var{x}(j), @var{y}(i), @var{c}(i,j)).
+## Thus, columns of @var{c} correspond to different @var{x} values and rows
+## of @var{c} correspond to different @var{y} values.
+##
+## The values in @var{c} are scaled to span the range of the current
+## colormap.  Limits may be placed on the color axis by the command
+## @code{caxis}, or by setting the @code{clim} property of the parent axis.
 ##
 ## The face color of each cell of the mesh is determined by interpolating
-## the values of @var{c} for the cell's vertices.  Contrast this with
+## the values of @var{c} for each of the cell's vertices; Contrast this with
 ## @code{imagesc} which renders one cell for each element of @var{c}.
 ##
 ## @code{shading} modifies an attribute determining the manner by which the
@@ -42,41 +45,55 @@
 ## "faceted", which renders a single color for each cell's face with the edge
 ## visible.
 ##
-## @var{h} is the handle to the surface object.
+## If the first argument @var{hax} is an axis handle, then plot into this axis,
+## rather than the current axis handle returned by @code{gca}.
 ##
-## @seealso{caxis, contour, meshgrid, imagesc, shading}
+## The optional return value @var{h} is a graphics handle to the created
+## surface object.
+##
+## @seealso{caxis, shading, meshgrid, contour, imagesc}
 ## @end deftypefn
 
 ## Author: Kai Habel <kai.habel@gmx.de>
 
-function h = pcolor (x, y, c)
+function h = pcolor (varargin)
 
-  newplot ();
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("pcolor", varargin{:});
 
   if (nargin == 1)
-    c = x;
+    c = varargin{1};
     [nr, nc] = size (c);
+    [x, y] = meshgrid (1:nc, 1:nr);
     z = zeros (nr, nc);
-    [x, y] = meshgrid (1:nc, 1:nr);
   elseif (nargin == 3)
+    x = varargin{1};
+    y = varargin{2};
+    c = varargin{3};
     z = zeros (size (c));
   else
     print_usage ();
   endif
 
-  tmp = surface (x, y, z, c);
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+    htmp = surface (x, y, z, c);
 
-  ax = get (tmp, "parent");
+    set (htmp, "facecolor", "flat");
+    set (hax, "box", "on");
 
-  set (tmp, "facecolor", "flat");
-  set (ax, "box", "on");
+    if (! ishold ())
+      set (hax, "view", [0, 90]);
+    endif
 
-  if (! ishold ())
-    set (ax, "view", [0, 90]);
-  endif
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
@@ -95,4 +112,5 @@
 %! [Fx,Fy] = gradient (Z);
 %! pcolor (X,Y,Fx+Fy);
 %! shading interp;
+%! axis tight;
 
--- a/scripts/plot/pie.m
+++ b/scripts/plot/pie.m
@@ -18,50 +18,60 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} pie (@var{x})
-## @deftypefnx {Function File} {} pie (@var{x}, @var{explode})
+## @deftypefnx {Function File} {} pie (@dots{}, @var{explode})
 ## @deftypefnx {Function File} {} pie (@dots{}, @var{labels})
-## @deftypefnx {Function File} {} pie (@var{h}, @dots{});
+## @deftypefnx {Function File} {} pie (@var{hax}, @dots{});
 ## @deftypefnx {Function File} {@var{h} =} pie (@dots{});
-## Produce a 2-D pie chart.
+## Plot a 2-D pie chart.
 ##
-## Called with a single vector argument, produces a pie chart of the
-## elements in @var{x}, with the size of the slice determined by percentage
-## size of the values of @var{x}.
+## When called with a single vector argument, produce a pie chart of the
+## elements in @var{x}.  The size of the ith slice is the percentage that the
+## element @var{x}i represents of the total sum of @var{x}:
+## @code{pct = @var{x}(i) / sum (@var{x})}. 
 ##
-## The variable @var{explode} is a vector of the same length as @var{x} that
-## if non zero "explodes" the slice from the pie chart.
+## The optional input @var{explode} is a vector of the same length as @var{x}
+## that, if non-zero, "explodes" the slice from the pie chart.
 ##
-## If given @var{labels} is a cell array of strings of the same length as
-## @var{x}, giving the labels of each of the slices of the pie chart.
+## The optional input @var{labels} is a cell array of strings of the same
+## length as @var{x} specifying the label for each slice.
+## 
+## If the first argument @var{hax} is an axis handle, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a list of handles to the patch
 ## and text objects generating the plot.
 ##
-## @seealso{pie3, bar, stem}
+## Note: If @code{sum (@var{x}) @leq{} 1} then the elements of @var{x} are
+## interpreted as percentages directly and are not normalized by @code{sum (x)}.
+## Furthermore, if the sum is less than 1 then there will be a missing slice
+## in the pie plot to represent the missing, unspecified percentage.
+##
+## @seealso{pie3, bar, hist, rose}
 ## @end deftypefn
 
 ## Very roughly based on pie.m from octave-forge whose author was
 ## Daniel Heiserer <Daniel.heiserer@physik.tu-muenchen.de>
 
-function retval = pie (varargin)
+function h = pie (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("pie", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("pie", varargin{:});
 
   if (nargin < 1)
     print_usage ();
-  else
-    oldh = gca ();
-    unwind_protect
-      axes (h);
-      newplot ();
-      tmp = __pie__ ("pie", h, varargin{:});
-    unwind_protect_cleanup
-      axes (oldh);
-    end_unwind_protect
   endif
 
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+    htmp = __pie__ ("pie", hax, varargin{:});
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
+
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/pie3.m
+++ b/scripts/plot/pie3.m
@@ -19,50 +19,60 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} pie3 (@var{x})
-## @deftypefnx {Function File} {} pie3 (@var{x}, @var{explode})
+## @deftypefnx {Function File} {} pie3 (@dots{}, @var{explode})
 ## @deftypefnx {Function File} {} pie3 (@dots{}, @var{labels})
-## @deftypefnx {Function File} {} pie3 (@var{h}, @dots{});
+## @deftypefnx {Function File} {} pie3 (@var{hax}, @dots{});
 ## @deftypefnx {Function File} {@var{h} =} pie3 (@dots{});
-## Draw a 3-D pie chart.
+## Plot a 3-D pie chart.
 ##
 ## Called with a single vector argument, produces a 3-D pie chart of the
-## elements in @var{x}, with the size of the slice determined by percentage
-## size of the values of @var{x}.
+## elements in @var{x}.  The size of the ith slice is the percentage that the
+## element @var{x}i represents of the total sum of @var{x}:
+## @code{pct = @var{x}(i) / sum (@var{x})}. 
 ##
-## The variable @var{explode} is a vector of the same length as @var{x} that
-## if non zero "explodes" the slice from the pie chart.
+## The optional input @var{explode} is a vector of the same length as @var{x}
+## that, if non-zero, "explodes" the slice from the pie chart.
 ##
-## If given @var{labels} is a cell array of strings of the same length as
-## @var{x}, giving the labels of each of the slices of the pie chart.
+## The optional input @var{labels} is a cell array of strings of the same
+## length as @var{x} specifying the label for each slice.
+##
+## If the first argument @var{hax} is an axis handle, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a list of graphics handles to the patch,
 ## surface, and text objects generating the plot.
 ##
-## @seealso{pie, bar, stem}
+## Note: If @code{sum (@var{x}) @leq{} 1} then the elements of @var{x} are
+## interpreted as percentages directly and are not normalized by @code{sum (x)}.
+## Furthermore, if the sum is less than 1 then there will be a missing slice
+## in the pie plot to represent the missing, unspecified percentage.
+##
+## @seealso{pie, bar, hist, rose}
 ## @end deftypefn
 
 ## Very roughly based on pie.m from octave-forge whose author was
 ## Daniel Heiserer <Daniel.heiserer@physik.tu-muenchen.de>
 
-function retval = pie3 (varargin)
+function h = pie3 (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("pie", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("pie3", varargin{:});
 
   if (nargin < 1)
     print_usage ();
-  else
-    oldh = gca ();
-    unwind_protect
-      axes (h);
-      newplot ();
-      tmp = __pie__ ("pie3", h, varargin{:});
-    unwind_protect_cleanup
-      axes (oldh);
-    end_unwind_protect
   endif
 
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+    htmp = __pie__ ("pie3", hax, varargin{:});
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
+
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/plot.m
+++ b/scripts/plot/plot.m
@@ -181,25 +181,26 @@
 
 ## Author: jwe
 
-function retval = plot (varargin)
+function h = plot (varargin)
 
-  [h, varargin, nargs] = __plt_get_axis_arg__ ("plot", varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("plot", varargin{:});
 
   if (nargs < 1)
     print_usage ();
   endif
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
-    tmp = __plt__ ("plot", h, varargin{:});
+    hax = newplot (hax);
+    htmp = __plt__ ("plot", hax, varargin{:});
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/plot3.m
+++ b/scripts/plot/plot3.m
@@ -17,9 +17,17 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} plot3 (@var{args})
-## Produce three-dimensional plots.  Many different combinations of
-## arguments are possible.  The simplest form is
+## @deftypefn  {Function File} {} plot3 (@var{x}, @var{y}, @var{z})
+## @deftypefnx {Function File} {} plot3 (@var{x}, @var{y}, @var{z}, @var{property}, @var{value}, @dots{})
+## @deftypefnx {Function File} {} plot3 (@var{x}, @var{y}, @var{z}, @var{fmt})
+## @deftypefnx {Function File} {} plot3 (@var{x}, @var{cplx})
+## @deftypefnx {Function File} {} plot3 (@var{cplx})
+## @deftypefnx {Function File} {} plot3 (@var{hax}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} plot3 (@dots{})
+## Produce three-dimensional plots.
+##
+## Many different combinations of arguments are possible.  The simplest
+## form is
 ##
 ## @example
 ## plot3 (@var{x}, @var{y}, @var{z})
@@ -29,14 +37,13 @@
 ## in which the arguments are taken to be the vertices of the points to
 ## be plotted in three dimensions.  If all arguments are vectors of the
 ## same length, then a single continuous line is drawn.  If all arguments
-## are matrices, then each column of the matrices is treated as a
-## separate line.  No attempt is made to transpose the arguments to make
-## the number of rows match.
+## are matrices, then each column of is treated as a separate line.  No attempt
+## is made to transpose the arguments to make the number of rows match.
 ##
 ## If only two arguments are given, as
 ##
 ## @example
-## plot3 (@var{x}, @var{c})
+## plot3 (@var{x}, @var{cplx})
 ## @end example
 ##
 ## @noindent
@@ -46,7 +53,7 @@
 ## If only one argument is given, as
 ##
 ## @example
-## plot3 (@var{c})
+## plot3 (@var{cplx})
 ## @end example
 ##
 ## @noindent
@@ -70,6 +77,15 @@
 ## plot3 (@var{x1}, @var{c1}, "", @var{c2}, "", @dots{})
 ## @end example
 ##
+## Multiple property-value pairs may be specified which will affect the line
+## objects drawn by @code{plot3}.  If the @var{fmt} argument is supplied it
+## will format the line objects in the same manner as @code{plot}.
+##
+## If the first argument is an axis handle @var{hax}, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
+##
+## The optional return value @var{h} is a graphics handle to the created plot.
+##
 ## An example of the use of @code{plot3} is
 ##
 ## @example
@@ -79,7 +95,7 @@
 ## plot3 (z, exp (2i*pi*z), ";complex sinusoid;");
 ## @end group
 ## @end example
-## @seealso{plot, xlabel, ylabel, zlabel, title, print}
+## @seealso{ezplot3, plot}
 ## @end deftypefn
 
 ## Author: Paul Kienzle
@@ -87,73 +103,209 @@
 
 function retval = plot3 (varargin)
 
-  newplot ();
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("plot3", varargin{:});
+
+  if (nargs < 1)
+    print_usage ();
+  endif
+
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+
+    x_set = 0;
+    y_set = 0;
+    z_set = 0;
+    property_set = 0;
+    fmt_set = 0;
+    properties = {};
+    tlgnd = {};
+    hlgnd = [];
+    idx = 0;
+
+    ## Gather arguments, decode format, and plot lines.
+    arg = 0;
+    while (arg++ < nargs)
+      new = varargin{arg};
+      new_cell = varargin(arg);
+
+      if (property_set)
+        properties = [properties, new_cell];
+        property_set = 0;
+        continue;
+      endif
+
+      if (ischar (new))
+        if (! z_set)
+          if (! y_set)
+            if (! x_set)
+              error ("plot3: needs X, [ Y, [ Z ] ]");
+            else
+              y = real (x);
+              z = imag (x);
+              y_set = 1;
+              z_set = 1;
+              if (rows (x) > 1)
+                x = repmat ((1:rows (x))', 1, columns (x));
+              else
+                x = 1:columns (x);
+              endif
+            endif
+          else
+            z = imag (y);
+            y = real (y);
+            z_set = 1;
+          endif
+        endif
+
+        if (! fmt_set)
+          [options, valid] = __pltopt__ ("plot3", new, false);
+          if (! valid)
+            properties = [properties, new_cell];
+            property_set = 1;
+            continue;
+          else
+            fmt_set = 1;
+            while (arg < nargs && ischar (varargin{arg+1}))
+              if (nargs - arg < 2)
+                error ("plot3: properties must appear followed by a value");
+              endif
+              properties = [properties, varargin(arg+1:arg+2)];
+              arg += 2;
+            endwhile
+          endif
+        else
+          properties = [properties, new_cell];
+          property_set = 1;
+          continue;
+        endif
+
+        if (isvector (x) && isvector (y))
+          if (isvector (z))
+            x = x(:);
+            y = y(:);
+            z = z(:);
+          elseif (length (x) == rows (z) && length (y) == columns (z))
+            [x, y] = meshgrid (x, y);
+          else
+            error ("plot3: [length(X), length(Y)] must match size (Z)");
+          endif
+        endif
 
-  x_set = 0;
-  y_set = 0;
-  z_set = 0;
-  property_set = 0;
-  fmt_set = 0;
-  properties = {};
-  tlgnd = {};
-  hlgnd = [];
-  idx = 0;
+        if (! size_equal (x, y, z))
+          error ("plot3: X, Y, and Z must have the same shape");
+        elseif (ndims (x) > 2)
+          error ("plot3: X, Y, and Z must not have more than two dimensions");
+        endif
+
+        for i = 1 : columns (x)
+          linestyle = options.linestyle;
+          marker = options.marker;
+          if (isempty (marker) && isempty (linestyle))
+             [linestyle, marker] = __next_line_style__ ();
+          endif
+          color = options.color;
+          if (isempty (color))
+            color = __next_line_color__ ();
+          endif
+
+          htmp(++idx) = line (hax, x(:, i), y(:, i), z(:, i),
+                              "color", color, "linestyle", linestyle,
+                              "marker", marker, properties{:});
+          key = options.key;
+          if (! isempty (key))
+            hlgnd = [hlgnd, htmp(idx)];
+            tlgnd = {tlgnd{:}, key};
+          endif
+        endfor
 
-  ## Gather arguments, decode format, and plot lines.
-  arg = 0;
-  while (arg++ < nargin)
-    new = varargin{arg};
-    new_cell = varargin(arg);
+        x_set = 0;
+        y_set = 0;
+        z_set = 0;
+        fmt_set = 0;
+        properties = {};
+      elseif (! x_set)
+        x = new;
+        x_set = 1;
+      elseif (! y_set)
+        y = new;
+        y_set = 1;
+      elseif (! z_set)
+        z = new;
+        z_set = 1;
+      else
+        if (isvector (x) && isvector (y))
+          if (isvector (z))
+            x = x(:);
+            y = y(:);
+            z = z(:);
+          elseif (length (x) == rows (z) && length (y) == columns (z))
+            [x, y] = meshgrid (x, y);
+          else
+            error ("plot3: [length(X), length(Y)] must match size (Z)");
+          endif
+        endif
+
+        if (! size_equal (x, y, z))
+          error ("plot3: X, Y, and Z must have the same shape");
+        elseif (ndims (x) > 2)
+          error ("plot3: X, Y, and Z must not have more than two dimensions");
+        endif
+
+        options = __default_plot_options__ ();
+        for i = 1 : columns (x)
+          linestyle = options.linestyle;
+          marker = options.marker;
+          if (isempty (marker) && isempty (linestyle))
+            [linestyle, marker] = __next_line_style__ ();
+          endif
+          color = options.color;
+          if (isempty (color))
+            color = __next_line_color__ ();
+          endif
+
+          htmp(++idx) = line (hax, x(:, i), y(:, i), z(:, i),
+                              "color", color, "linestyle", linestyle,
+                              "marker", marker, properties{:});
+          key = options.key;
+          if (! isempty (key))
+            hlgnd = [hlgnd, htmp(idx)];
+            tlgnd = {tlgnd{:}, key};
+          endif
+        endfor
+
+        x = new;
+        y_set = 0;
+        z_set = 0;
+        fmt_set = 0;
+        properties = {};
+      endif
+
+    endwhile
 
     if (property_set)
-      properties = [properties, new_cell];
-      property_set = 0;
-      continue;
+      error ("plot3: properties must appear followed by a value");
     endif
 
-    if (ischar (new))
-      if (! z_set)
-        if (! y_set)
-          if (! x_set)
-            error ("plot3: needs x, [ y, [ z ] ]");
-          else
-            z = imag (x);
-            y = real (x);
-            y_set = 1;
-            z_set = 1;
-            if (rows (x) > 1)
-              x = repmat ((1:rows (x))', 1, columns (x));
-            else
-              x = 1:columns (x);
-            endif
-          endif
-        else
+    ## Handle last plot.
+
+    if (x_set)
+      if (y_set)
+        if (! z_set)
           z = imag (y);
           y = real (y);
           z_set = 1;
         endif
-      endif
-
-      if (! fmt_set)
-        [options, valid] = __pltopt__ ("plot3", new, false);
-        if (! valid)
-          properties = [properties, new_cell];
-          property_set = 1;
-          continue;
+      else
+        y = real (x);
+        z = imag (x);
+        y_set = 1;
+        z_set = 1;
+        if (rows (x) > 1)
+          x = repmat ((1:rows (x))', 1, columns (x));
         else
-          fmt_set = 1;
-          while (arg < nargin && ischar (varargin{arg+1}))
-            if (nargin - arg < 2)
-              error ("plot3: properties must appear followed by a value");
-            endif
-            properties = [properties, varargin(arg+1:arg+2)];
-            arg += 2;
-          endwhile
+          x = 1:columns (x);
         endif
-      else
-        properties = [properties, new_cell];
-        property_set = 1;
-        continue;
       endif
 
       if (isvector (x) && isvector (y))
@@ -164,176 +316,56 @@
         elseif (length (x) == rows (z) && length (y) == columns (z))
           [x, y] = meshgrid (x, y);
         else
-          error ("plot3: [length(x), length(y)] must match size (z)");
+          error ("plot3: [length(X), length(Y)] must match size (Z)");
         endif
       endif
 
       if (! size_equal (x, y, z))
-        error ("plot3: x, y, and z must have the same shape");
+        error ("plot3: X, Y, and Z must have the same shape");
       elseif (ndims (x) > 2)
-        error ("plot3: x, y, and z must not have more than two dimensions");
+        error ("plot3: X, Y, and Z must not have more than two dimensions");
       endif
 
+      options = __default_plot_options__ ();
+
       for i = 1 : columns (x)
         linestyle = options.linestyle;
         marker = options.marker;
         if (isempty (marker) && isempty (linestyle))
-           [linestyle, marker] = __next_line_style__ ();
-        endif
-        color = options.color;
-        if (isempty (color))
-          color = __next_line_color__ ();
-        endif
-
-        tmp(++idx) = line (x(:, i), y(:, i), z(:, i),
-                           "color", color, "linestyle", linestyle,
-                           "marker", marker, properties{:});
-        key = options.key;
-        if (! isempty (key))
-          hlgnd = [hlgnd, tmp(idx)];
-          tlgnd = {tlgnd{:}, key};
-        endif
-      endfor
-
-      x_set = 0;
-      y_set = 0;
-      z_set = 0;
-      fmt_set = 0;
-      properties = {};
-    elseif (! x_set)
-      x = new;
-      x_set = 1;
-    elseif (! y_set)
-      y = new;
-      y_set = 1;
-    elseif (! z_set)
-      z = new;
-      z_set = 1;
-    else
-      if (isvector (x) && isvector (y))
-        if (isvector (z))
-          x = x(:);
-          y = y(:);
-          z = z(:);
-        elseif (length (x) == rows (z) && length (y) == columns (z))
-          [x, y] = meshgrid (x, y);
-        else
-          error ("plot3: [length(x), length(y)] must match size (z)");
-        endif
-      endif
-
-      if (! size_equal (x, y, z))
-        error ("plot3: x, y, and z must have the same shape");
-      elseif (ndims (x) > 2)
-        error ("plot3: x, y, and z must not have more than two dimensions");
-      endif
-
-      options =  __default_plot_options__ ();
-      for i = 1 : columns (x)
-        linestyle = options.linestyle;
-        marker = options.marker;
-        if (isempty (marker) && isempty (linestyle))
-           [linestyle, marker] = __next_line_style__ ();
+          [linestyle, marker] = __next_line_style__ ();
         endif
         color = options.color;
         if (isempty (color))
           color = __next_line_color__ ();
         endif
 
-        tmp(++idx) = line (x(:, i), y(:, i), z(:, i),
-                           "color", color, "linestyle", linestyle,
-                           "marker", marker, properties{:});
+        htmp(++idx) = line (hax, x(:, i), y(:, i), z(:, i),
+                            "color", color, "linestyle", linestyle,
+                            "marker", marker, properties{:});
         key = options.key;
         if (! isempty (key))
-          hlgnd = [hlgnd, tmp(idx)];
+          hlgnd = [hlgnd, htmp(idx)];
           tlgnd = {tlgnd{:}, key};
         endif
       endfor
-
-      x = new;
-      y_set = 0;
-      z_set = 0;
-      fmt_set = 0;
-      properties = {};
     endif
 
-  endwhile
-
-  if (property_set)
-    error ("plot3: properties must appear followed by a value");
-  endif
-
-  ## Handle last plot.
-
-  if (x_set)
-    if (y_set)
-      if (! z_set)
-        z = imag (y);
-        y = real (y);
-        z_set = 1;
-      endif
-    else
-      z = imag (x);
-      y = real (x);
-      y_set = 1;
-      z_set = 1;
-      if (rows (x) > 1)
-        x = repmat ((1:rows (x))', 1, columns (x));
-      else
-        x = 1:columns (x);
-      endif
+    if (! isempty (hlgnd))
+      legend (hax, hlgnd, tlgnd);
     endif
 
-    if (isvector (x) && isvector (y))
-      if (isvector (z))
-        x = x(:);
-        y = y(:);
-        z = z(:);
-      elseif (length (x) == rows (z) && length (y) == columns (z))
-        [x, y] = meshgrid (x, y);
-      else
-        error ("plot3: [length(x), length(y)] must match size (z)");
-      endif
-    endif
-
-    if (! size_equal (x, y, z))
-      error ("plot3: x, y, and z must have the same shape");
-    elseif (ndims (x) > 2)
-      error ("plot3: x, y, and z must not have more than two dimensions");
+    if (! ishold ())
+      set (hax, "view", [-37.5, 30]);
     endif
 
-    options =  __default_plot_options__ ();
-
-    for i = 1 : columns (x)
-      linestyle = options.linestyle;
-      marker = options.marker;
-      if (isempty (marker) && isempty (linestyle))
-        [linestyle, marker] = __next_line_style__ ();
-      endif
-      color = options.color;
-      if (isempty (color))
-        color = __next_line_color__ ();
-      endif
-
-      tmp(++idx) = line (x(:, i), y(:, i), z(:, i),
-                         "color", color, "linestyle", linestyle,
-                         "marker", marker, properties{:});
-      key = options.key;
-      if (! isempty (key))
-        hlgnd = [hlgnd, tmp(idx)];
-        tlgnd = {tlgnd{:}, key};
-      endif
-    endfor
-  endif
-
-  if (!isempty (hlgnd))
-    legend (gca (), hlgnd, tlgnd);
-  endif
-
-  set (gca (), "view", [-37.5, 30]);
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
 
   if (nargout > 0 && idx > 0)
-    retval = tmp;
+    retval = htmp;
   endif
 
 endfunction
@@ -343,5 +375,9 @@
 %! clf;
 %! z = [0:0.05:5];
 %! plot3 (cos (2*pi*z), sin (2*pi*z), z, ';helix;');
+
+%!demo
+%! clf;
+%! z = [0:0.05:5];
 %! plot3 (z, exp (2i*pi*z), ';complex sinusoid;');
 
--- a/scripts/plot/plotmatrix.m
+++ b/scripts/plot/plotmatrix.m
@@ -20,17 +20,17 @@
 ## @deftypefn  {Function File} {} plotmatrix (@var{x}, @var{y})
 ## @deftypefnx {Function File} {} plotmatrix (@var{x})
 ## @deftypefnx {Function File} {} plotmatrix (@dots{}, @var{style})
-## @deftypefnx {Function File} {} plotmatrix (@var{h}, @dots{})
+## @deftypefnx {Function File} {} plotmatrix (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {[@var{h}, @var{ax}, @var{bigax}, @var{p}, @var{pax}] =} plotmatrix (@dots{})
 ## Scatter plot of the columns of one matrix against another.  Given the
 ## arguments @var{x} and @var{y}, that have a matching number of rows,
 ## @code{plotmatrix} plots a set of axes corresponding to
 ##
 ## @example
-## plot (@var{x} (:, i), @var{y} (:, j)
+## plot (@var{x}(:, i), @var{y}(:, j))
 ## @end example
 ##
-## Given a single argument @var{x}, then this is equivalent to
+## Given a single argument @var{x} this is equivalent to
 ##
 ## @example
 ## plotmatrix (@var{x}, @var{x})
@@ -38,12 +38,13 @@
 ##
 ## @noindent
 ## except that the diagonal of the set of axes will be replaced with the
-## histogram @code{hist (@var{x} (:, i))}.
+## histogram @code{hist (@var{x}(:, i))}.
 ##
 ## The marker to use can be changed with the @var{style} argument, that is a
-## string defining a marker in the same manner as the @code{plot}
-## command.  If a leading axes handle @var{h} is passed to
-## @code{plotmatrix}, then this axis will be used for the plot.
+## string defining a marker in the same manner as the @code{plot} command.
+##
+## If the first argument is an axis handle @var{hax}, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} provides handles to the individual
 ## graphics objects in the scatter plots, whereas @var{ax} returns the
@@ -53,10 +54,13 @@
 ## axis.  Finally @var{p} returns the graphics objects associated with
 ## the histogram and @var{pax} the corresponding axes objects.
 ##
+## Example:
+##
 ## @example
 ## plotmatrix (randn (100, 3), "g+")
 ## @end example
 ##
+## @seealso{plot}
 ## @end deftypefn
 
 function [h, ax, bigax, p, pax] = plotmatrix (varargin)
@@ -65,38 +69,42 @@
 
   if (nargin > 3 || nargin < 1)
     print_usage ();
-  else
-    oldh = gca ();
-    unwind_protect
-      axes (bigax2);
-      newplot ();
-      [h2, ax2, p2, pax2, need_usage] = __plotmatrix__ (bigax2, varargin{:});
-      if (need_usage)
-        print_usage ();
-      endif
-      if (nargout > 0)
-        h = h2;
-        ax = ax2;
-        bigax = bigax2;
-        p = p2;
-        pax = pax2;
-      endif
-      axes (bigax2);
-      ctext = text (0, 0, "", "visible", "off",
-                    "handlevisibility", "off", "xliminclude", "off",
-                    "yliminclude", "off", "zliminclude", "off",
-                    "deletefcn", {@plotmatrixdelete, [ax2; pax2]});
-      set (bigax2, "visible", "off");
-    unwind_protect_cleanup
-      axes (oldh);
-    end_unwind_protect
   endif
+
+  oldfig = ifelse (isempty (bigax2), [], get (0, "currentfigure"));
+  unwind_protect
+    bigax2 = newplot (bigax2);
+
+    [h2, ax2, p2, pax2] = __plotmatrix__ (bigax2, varargin{:});
+
+    if (nargout > 0)
+      h = h2;
+      ax = ax2;
+      bigax = bigax2;
+      p = p2;
+      pax = pax2;
+    endif
+    axes (bigax2);
+    ctext = text (0, 0, "", "visible", "off",
+                  "handlevisibility", "off", "xliminclude", "off",
+                  "yliminclude", "off", "zliminclude", "off",
+                  "deletefcn", {@plotmatrixdelete, [ax2; pax2]});
+    set (bigax2, "visible", "off");
+
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
+
 endfunction
 
+
 %!demo
 %! clf;
 %! plotmatrix (randn (100, 3), 'g+');
 
+
 function plotmatrixdelete (h, d, ax)
   for i = 1 : numel (ax)
     hc = ax(i);
@@ -111,8 +119,7 @@
   endfor
 endfunction
 
-function [h, ax, p, pax, need_usage] = __plotmatrix__ (bigax, varargin)
-  need_usage = false;
+function [h, ax, p, pax] = __plotmatrix__ (bigax, varargin)
   have_line_spec = false;
   have_hist = false;
   parent = get (bigax, "parent");
@@ -127,8 +134,7 @@
         nargin = nargin - 1;
         break;
       else
-        need_usage = true;
-        returm;
+        print_usage ("plotmatrix");
       endif
     endif
   endfor
@@ -141,8 +147,7 @@
     X = varargin{1};
     Y = varargin{2};
   else
-    need_usage = true;
-    returm;
+    print_usage ("plotmatrix");
   endif
 
   if (rows (X) != rows (Y))
@@ -186,3 +191,4 @@
     endfor
   endfor
 endfunction
+
--- a/scripts/plot/plotyy.m
+++ b/scripts/plot/plotyy.m
@@ -51,6 +51,7 @@
 ## ylabel (ax(2), "Axis 2");
 ## @end group
 ## @end example
+## @seealso{plot}
 ## @end deftypefn
 
 function [Ax, H1, H2] = plotyy (varargin)
@@ -170,7 +171,9 @@
     set (ax, "activepositionproperty", "position");
   endif
 
-  h2 = feval (fun2, x2, y2);
+  ## Kluge, until __plt_get_axis_arg__ and newplot are reworked. 
+  set (ax(2), "nextplot", "replacechildren");
+  h2 = feval (fun2, ax(2), x2, y2);
   set (ax(2), "yaxislocation", "right");
   set (ax(2), "ycolor", getcolor (h2(1)));
 
@@ -276,11 +279,11 @@
 %! y = 5 * cos (t);
 %! [hax, h1, h2] = plotyy (t, x, t, y);
 %! [~, h3, h4] = plotyy (t+1, x, t+1, y);
-%! set ([h3, h4], "linestyle", "--")
-%! xlabel (hax(1), 'xlabel')
-%! title (hax(2), 'title')
-%! ylabel (hax(1), 'Left axis is Blue')
-%! ylabel (hax(2), 'Right axis is Green')
+%! set ([h3, h4], 'linestyle', '--');
+%! xlabel (hax(1), 'xlabel');
+%! title (hax(2), 'title');
+%! ylabel (hax(1), 'Left axis is Blue');
+%! ylabel (hax(2), 'Right axis is Green');
 
 function deleteplotyy (h, d, ax2, t2)
   if (ishandle (ax2) && strcmp (get (ax2, "type"), "axes")
--- a/scripts/plot/polar.m
+++ b/scripts/plot/polar.m
@@ -19,42 +19,49 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} polar (@var{theta}, @var{rho})
 ## @deftypefnx {Function File} {} polar (@var{theta}, @var{rho}, @var{fmt})
-## @deftypefnx {Function File} {} polar (@var{h}, @dots{})
+## @deftypefnx {Function File} {} polar (@var{cplx})
+## @deftypefnx {Function File} {} polar (@var{cplx}, @var{fmt})
+## @deftypefnx {Function File} {} polar (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} polar (@dots{})
-## Create a two-dimensional plot from polar coordinates @var{theta} and
-## @var{rho}.
+## Create a 2-D plot from polar coordinates @var{theta} and @var{rho}.
+##
+## If a single complex input @var{cplx} is given then the real part is used
+## for @var{theta} and the imaginary part is used for @var{rho}.
 ##
-## The optional argument @var{fmt} specifies the line format.
+## The optional argument @var{fmt} specifies the line format in the same way
+## as @code{plot}.
+##
+## If the first argument @var{hax} is an axis handle, then plot into this axis,
+## rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a graphics handle to the created plot.
 ##
-## @seealso{plot}
+## @seealso{rose, compass, plot}
 ## @end deftypefn
 
 ## Author: jwe
 
-function retval = polar (varargin)
+function h = polar (varargin)
 
-  [h, varargin, nargs] = __plt_get_axis_arg__ ("polar", varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("polar", varargin{:});
 
   if (nargs < 1)
     print_usage ();
   endif
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
     if (nargs == 3)
       if (! ischar (varargin{3}))
-        error ("polar: third argument must be a string");
+        error ("polar: FMT argument must be a string");
       endif
-      tmp = __plr2__ (h, varargin{:});
-      maxr = max (varargin {2} (:));
+      htmp = __plr2__ (hax, varargin{:});
+      maxr = max (varargin{2}(:));
     elseif (nargs == 2)
       if (ischar (varargin{2}))
-        tmp = __plr1__ (h, varargin{:});
+        htmp = __plr1__ (hax, varargin{:});
         if (iscomplex (varargin{1}))
           maxr = max (imag (varargin{1})(:));
         else
@@ -62,12 +69,12 @@
         endif
       else
         fmt = "";
-        tmp = __plr2__ (h, varargin{:}, fmt);
-        maxr = max (varargin {2} (:));
+        htmp = __plr2__ (hax, varargin{:}, fmt);
+        maxr = max (varargin{2}(:));
       endif
     elseif (nargs == 1)
       fmt = "";
-      tmp = __plr1__ (h, varargin{:}, fmt);
+      htmp = __plr1__ (hax, varargin{:}, fmt);
       if (iscomplex (varargin{1}))
         maxr = max (imag (varargin{1})(:));
       else
@@ -77,39 +84,31 @@
       print_usage ();
     endif
 
-    set (h, "xlim", [-maxr, maxr], "ylim", [-maxr, maxr],
-         "xaxislocation", "zero", "yaxislocation", "zero",
-         "plotboxaspectratio", [1, 1, 1]);
+    set (hax, "xlim", [-maxr, maxr], "ylim", [-maxr, maxr],
+              "xaxislocation", "zero", "yaxislocation", "zero",
+              "plotboxaspectratio", [1, 1, 1]);
 
-    if (nargout > 0)
-      retval = tmp;
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
     endif
-  unwind_protect_cleanup
-    axes (oldh);
   end_unwind_protect
 
+  if (nargout > 0)
+    h = htmp;
+  endif
+
 endfunction
 
 function retval = __plr1__ (h, theta, fmt)
 
-  if (nargin != 3)
-    print_usage ();
-  endif
-
-  [nr, nc] = size (theta);
-  if (nr == 1)
-    theta = theta';
-    tmp = nr;
-    nr = nc;
-    nc = tmp;
-  endif
-  theta_i = imag (theta);
-  if (any (theta_i))
-    rho = theta_i;
+  theta = theta(:);
+  if (iscomplex (theta))
+    rho = imag (theta);
     theta = real (theta);
   else
     rho = theta;
-    theta = (1:nr)';
+    theta = (1:rows (rho))';
   endif
 
   retval = __plr2__ (h, theta, rho, fmt);
@@ -118,17 +117,11 @@
 
 function retval = __plr2__ (h, theta, rho, fmt)
 
-  if (nargin != 4)
-    print_usage ();
+  if (ndims (theta) > 2 || ndims (rho) > 2)
+    error ("polar: THETA and RHO must be 2-D objects");
   endif
-
-  if (any (imag (theta)))
-    theta = real (theta);
-  endif
-
-  if (any (imag (rho)))
-    rho = real (rho);
-  endif
+  theta = real (theta);
+  rho = real (rho);
 
   if (isscalar (theta))
     if (isscalar (rho))
@@ -136,64 +129,46 @@
       y = rho * sin (theta);
       retval = __plt__ ("polar", h, x, y, fmt);
     else
-      error ("__plr2__: invalid data for plotting");
+      error ("polar: Can't plot constant THETA with varying RHO");
     endif
   elseif (isvector (theta))
     if (isvector (rho))
       if (length (theta) != length (rho))
-        error ("__plr2__: vector lengths must match");
+        error ("polar: THETA and RHO vector lengths must match");
       endif
-      if (rows (rho) == 1)
-        rho = rho';
-      endif
-      if (rows (theta) == 1)
-        theta = theta';
-      endif
+      rho = rho(:);
+      theta = theta(:);
       x = rho .* cos (theta);
       y = rho .* sin (theta);
       retval = __plt__ ("polar", h, x, y, fmt);
     elseif (ismatrix (rho))
-      [t_nr, t_nc] = size (theta);
-      if (t_nr == 1)
-        theta = theta';
-        tmp = t_nr;
-        t_nr = t_nc;
-        t_nc = tmp;
-      endif
+      theta = theta(:);
+      t_nr = rows (theta);
       [r_nr, r_nc] = size (rho);
       if (t_nr != r_nr)
         rho = rho';
-        tmp = r_nr;
         r_nr = r_nc;
-        r_nc = tmp;
       endif
       if (t_nr != r_nr)
-        error ("__plr2__: vector and matrix sizes must match");
+        error ("polar: THETA vector and RHO matrix sizes must match");
       endif
       x = diag (cos (theta)) * rho;
       y = diag (sin (theta)) * rho;
       retval = __plt__ ("polar", h, x, y, fmt);
     else
-      error ("__plr2__: invalid data for plotting");
+      error ("polar: invalid data for plotting");
     endif
   elseif (ismatrix (theta))
     if (isvector (rho))
-      [r_nr, r_nc] = size (rho);
-      if (r_nr == 1)
-        rho = rho';
-        tmp = r_nr;
-        r_nr = r_nc;
-        r_nc = tmp;
-      endif
+      rho = rho(:);
+      r_nr = rows (rho);
       [t_nr, t_nc] = size (theta);
       if (r_nr != t_nr)
         theta = theta';
-        tmp = t_nr;
         t_nr = t_nc;
-        t_nc = tmp;
       endif
       if (r_nr != t_nr)
-        error ("__plr2__: vector and matrix sizes must match");
+        error ("polar: THETA matrix and RHO vector sizes must match");
       endif
       diag_r = diag (rho);
       x = diag_r * cos (theta);
@@ -201,16 +176,16 @@
       retval = __plt__ ("polar", h, x, y, fmt);
     elseif (ismatrix (rho))
       if (! size_equal (rho, theta))
-        error ("__plr2__: matrix dimensions must match");
+        error ("polar: THETA and RHO matrix dimensions must match");
       endif
       x = rho .* cos (theta);
       y = rho .* sin (theta);
       retval = __plt__ ("polar", h, x, y, fmt);
     else
-      error ("__plr2__: invalid data for plotting");
+      error ("polar: invalid data for plotting");
     endif
   else
-    error ("__plr2__: invalid data for plotting");
+    error ("polar: invalid data for plotting");
   endif
 
 endfunction
@@ -224,6 +199,12 @@
 
 %!demo
 %! clf;
+%! theta = linspace (0,2*pi,1000);
+%! cplx = theta + i*sin (7*theta);
+%! polar (cplx, 'g');
+
+%!demo
+%! clf;
 %! theta = linspace (0,10*pi,1000);
 %! rho = sin (5/4*theta);
 %! polar (theta, rho);
--- a/scripts/plot/print.m
+++ b/scripts/plot/print.m
@@ -175,7 +175,7 @@
 ##
 ##   @table @code
 ##   @item ljet2p
-##     HP LaserJet IIP
+##     HP LaserJet @nospell{IIP}
 ##
 ##   @item ljet3
 ##     HP LaserJet III
@@ -199,7 +199,7 @@
 ##     Produces pdf output from eps
 ##   @end table
 ##
-##   For a complete list, type `system ("gs -h")' to see what formats
+##   For a complete list, type @samp{system ("gs -h")} to see what formats
 ## and devices are available.
 ##
 ##   When Ghostscript output is sent to a printer the size is determined
@@ -263,7 +263,7 @@
 ## @end group
 ## @end example
 ##
-## Example: Print to an HP Deskjet 550C.
+## Example: Print to an HP DeskJet 550C.
 ##
 ## @example
 ## @group
@@ -495,7 +495,7 @@
       if (opts.tight_flag)
         cmd = "--copy --bbox";
       elseif (! isempty (opts.preview))
-        switch opts.preview
+        switch (opts.preview)
         case "tiff"
           cmd = sprintf ("--add-%s-preview --device tiffg3", opts.preview);
         case {"tiff6u", "tiff6p", "metafile"}
@@ -617,7 +617,7 @@
     opts.name = opts.name(1:n-1);
   endif
   latexfile = strcat (opts.name, ".tex");
-  switch opts.devopt
+  switch (opts.devopt)
   case {"pdflatexstandalone"}
     packages = "\\usepackage{graphicx,color}";
     graphicsfile = strcat (opts.name, "-inc.pdf");
--- a/scripts/plot/printd.m
+++ b/scripts/plot/printd.m
@@ -51,7 +51,7 @@
   ## It seems best to only use convert for image output.  Its ps and pdf
   ## are badly rendered.
   opt = lower (opt);
-  switch opt
+  switch (opt)
     case {"pdf"}
       enscr = sprintf (
                        "enscript --no-header -o %s.ps %s ; ps2pdf %s.ps %s.pdf; mv %s.pdf %s;exit",...
@@ -84,18 +84,19 @@
   pr_out =  sprintf ("%s file %s written\n", opt, filename);
 endfunction
 
+
 %!demo
 %! r2 = char (
-%! "stem step: 10, data: unsorted.",
-%! "Hinges:    lo: 12, hi: 42"     ,
-%! "   1 | 22118"                  ,
-%! "   2 | 28"                     ,
-%! "   3 | 98"                     ,
-%! "   4 | 244"                    ,
-%! "   5 | 2"                      );
-%! printd (r2, "test_p.txt");
-%! system ("cat test_p.txt");
-%! delete ("test_p.txt");
+%! 'stem step: 10, data: unsorted.',
+%! 'Hinges:    lo: 12, hi: 42'     ,
+%! '   1 | 22118'                  ,
+%! '   2 | 28'                     ,
+%! '   3 | 98'                     ,
+%! '   4 | 244'                    ,
+%! '   5 | 2'                      );
+%! printd (r2, 'test_p.txt');
+%! system ('cat test_p.txt');
+%! delete ('test_p.txt');
 
 %!test
 %! r2 = char (
@@ -110,6 +111,5 @@
 %! r4 = fileread ("test_p.txt");
 %! delete ("test_p.txt");
 %! r2 = disp (r2);
-%! assert (r4, r2)
+%! assert (r4, r2);
 
-
--- a/scripts/plot/private/__actual_axis_position__.m
+++ b/scripts/plot/private/__actual_axis_position__.m
@@ -30,7 +30,7 @@
     axis_obj = get (h);
   elseif (isstruct (h))
     axis_obj = h;
-    h = axis_obj.__my_handle__;
+    h = axis_obj.__cbar_hax__;
   endif
 
   ## Get figure size in pixels
--- a/scripts/plot/private/__axes_limits__.m
+++ b/scripts/plot/private/__axes_limits__.m
@@ -27,18 +27,22 @@
 
   fcnmode = sprintf ("%smode", fcn);
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:});
+
+  if (isempty (hax))
+    hax = gca ();
+  endif
 
   if (nargin == 0)
-    retval = get (h, fcn);
+    retval = get (hax, fcn);
   else
     arg = varargin{1};
 
     if (ischar (arg))
       if (strcmpi (arg, "mode"))
-        retval = get (h, fcnmode);
-      elseif (strcmpi (arg, "auto") ||  strcmpi (arg, "manual"))
-        set (h, fcnmode, arg);
+        retval = get (hax, fcnmode);
+      elseif (strcmpi (arg, "auto") || strcmpi (arg, "manual"))
+        set (hax, fcnmode, arg);
       endif
     else
       if (!isnumeric (arg) && any (size (arg(:)) != [2, 1]))
@@ -47,7 +51,7 @@
         if (arg(1) >= arg(2))
           error ("%s: axis limits must be increasing", fcn);
         else
-          set (h, fcn, arg(:));
+          set (hax, fcn, arg(:));
         endif
       endif
     endif
--- a/scripts/plot/private/__axis_label__.m
+++ b/scripts/plot/private/__axis_label__.m
@@ -23,17 +23,17 @@
 
 ## Author: jwe
 
-function retval = __axis_label__ (ah, caller, txt, varargin)
+function retval = __axis_label__ (hax, caller, txt, varargin)
 
-  h = get (ah, caller);
+  h = get (hax, caller);
 
-  set (h, "fontangle", get (ah, "fontangle"),
-       "fontname", get (ah, "fontname"),
-       "fontsize", get (ah, "fontsize"),
-       "fontunits", get (ah, "fontunits"),
-       "fontweight", get (ah, "fontweight"),
-       "string", txt,
-       varargin{:});
+  set (h, "fontangle", get (hax, "fontangle"),
+          "fontname", get (hax, "fontname"),
+          "fontunits", get (hax, "fontunits"),   # must precede fontsize
+          "fontsize", get (hax, "fontsize"),
+          "fontweight", get (hax, "fontweight"),
+          "string", txt,
+          varargin{:});
 
   if (nargout > 0)
     retval = h;
--- a/scripts/plot/private/__bar__.m
+++ b/scripts/plot/private/__bar__.m
@@ -25,18 +25,14 @@
 
 function varargout = __bar__ (vertical, func, varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ((nargout > 1), func, varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ (func, varargin{:});
 
   ## Slightly smaller than 0.8 to avoid clipping issue in gnuplot 4.0
   width = 0.8 - 10 * eps;
   group = true;
   bv = 0;
 
-  if (nargin < 3)
-    print_usage ();
-  endif
-
-  if (nargin > 3 && isnumeric (varargin{2}))
+  if (nargs > 1 && isnumeric (varargin{2}))
     x = varargin{1};
     if (isvector (x))
       x = x(:);
@@ -54,7 +50,7 @@
       idx = 2;
     else
       if (! isvector (x))
-        error ("%s: x must be a vector", func);
+        error ("%s: X must be a vector", func);
       endif
       idx = 3;
     endif
@@ -69,7 +65,7 @@
 
   newargs = {};
   have_line_spec = false;
-  while (idx <= nargin - 2)
+  while (idx <= nargs)
     if (ischar (varargin{idx}) && strcmpi (varargin{idx}, "grouped"))
       group = true;
       idx++;
@@ -91,7 +87,7 @@
       endif
       if (isscalar (varargin{idx}))
         width = varargin{idx++};
-      elseif (idx == nargin - 2)
+      elseif (idx == nargs)
         newargs = [newargs,varargin(idx++)];
       elseif (ischar (varargin{idx})
               && strcmpi (varargin{idx}, "basevalue")
@@ -109,10 +105,10 @@
   ylen = rows (y);
 
   if (xlen != ylen)
-    error ("%s: length of x and y must be equal", func);
+    error ("%s: length of X and Y must be equal", func);
   endif
   if (any (x(2:end) < x(1:end-1)))
-    error ("%s: x vector values must be in ascending order", func);
+    error ("%s: X vector values must be in ascending order", func);
   endif
 
   ycols = columns (y);
@@ -153,19 +149,20 @@
   yb = reshape (yb, [4, numel(yb) / 4 / ycols, ycols]);
 
   if (nargout < 2)
-    oldh = gca ();
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
     unwind_protect
-      axes (h);
-      newplot ();
+      hax = newplot (hax);
 
-      tmp = bars (h, vertical, x, y, xb, yb, width, group,
-                  have_line_spec, bv, newargs{:});
-      if (nargout == 1)
-        varargout{1} = tmp;
+      htmp = bars (hax, vertical, x, y, xb, yb, width, group,
+                   have_line_spec, bv, newargs{:});
+    unwind_protect_cleanup
+      if (! isempty (oldfig))
+        set (0, "currentfigure", oldfig);
       endif
-    unwind_protect_cleanup
-      axes (oldh);
     end_unwind_protect
+    if (nargout == 1)
+      varargout{1} = htmp;
+    endif
   else
     if (vertical)
       varargout{1} = xb;
@@ -196,10 +193,10 @@
         else
           lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1);
         endif
-        h = patch (xb(:,:,i), yb(:,:,i), "FaceColor", "flat",
+        h = patch (ax, xb(:,:,i), yb(:,:,i), "FaceColor", "flat",
                    "cdata", lev, "parent", hg);
       else
-        h = patch (xb(:,:,i), yb(:,:,i), "parent", hg);
+        h = patch (ax, xb(:,:,i), yb(:,:,i), "parent", hg);
       endif
     else
       if (! have_color_spec)
@@ -208,16 +205,16 @@
         else
           lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1);
         endif
-        h = patch (yb(:,:,i), xb(:,:,i), "FaceColor", "flat",
+        h = patch (ax, yb(:,:,i), xb(:,:,i), "FaceColor", "flat",
                    "cdata", lev, "parent", hg);
       else
-        h = patch (yb(:,:,i), xb(:,:,i), "parent", hg);
+        h = patch (ax, yb(:,:,i), xb(:,:,i), "parent", hg);
       endif
     endif
 
     if (i == 1)
       x_axis_range = get (ax, "xlim");
-      h_baseline = line (x_axis_range, [base_value, base_value],
+      h_baseline = line (ax, x_axis_range, [base_value, base_value],
                          "color", [0, 0, 0]);
       set (h_baseline, "handlevisibility", "off");
       set (h_baseline, "xliminclude", "off");
@@ -362,9 +359,9 @@
 function update_props (h, d)
   kids = get (h, "children");
   set (kids, "edgecolor", get (h, "edgecolor"),
-       "linewidth", get (h, "linewidth"),
-       "linestyle", get (h, "linestyle"),
-       "facecolor", get (h, "facecolor"));
+             "linewidth", get (h, "linewidth"),
+             "linestyle", get (h, "linestyle"),
+             "facecolor", get (h, "facecolor"));
 endfunction
 
 function update_data (h, d)
@@ -436,3 +433,4 @@
     end_unwind_protect
   endif
 endfunction
+
--- a/scripts/plot/private/__contour__.m
+++ b/scripts/plot/private/__contour__.m
@@ -92,7 +92,7 @@
     error ("__contour__: z argument must be a matrix");
   endif
   if (length (varargin) == 4 || length (varargin) == 6)
-    vn = varargin {end};
+    vn = varargin{end};
     vnauto = false;
   else
     vnauto = true;
@@ -100,6 +100,7 @@
   endif
 
   if (isscalar (vn))
+    ## FIXME - the levels should be determined similarly to {x,y,z}ticks
     lvl = linspace (min (z1(!isinf (z1))), max (z1(!isinf (z1))),
                     vn + 2)(1:end-1);
   else
@@ -191,8 +192,8 @@
   addlistener (hg, "zlevelmode", @update_zlevel);
   addlistener (hg, "zlevel", @update_zlevel);
 
-  addlistener (hg, "levellist", @update_data);
-  addlistener (hg, "levelstep", @update_data);
+  addlistener (hg, "levellist", {@update_data, "levellist"});
+  addlistener (hg, "levelstep", {@update_data, "levelstep"});
   addlistener (hg, "levellistmode", @update_data);
   addlistener (hg, "levelstepmode", @update_data);
 
@@ -435,7 +436,7 @@
        "linewidth", get (h, "linewidth"), "linestyle", get (h, "linestyle"));
 endfunction
 
-function update_data (h, d)
+function update_data (h, d, prop = "")
   persistent recursive = false;
 
   if (!recursive)
@@ -443,11 +444,28 @@
 
     delete (get (h, "children"));
 
-    if (strcmpi (get (h, "levellistmode"), "manual"))
+    switch (prop)
+    case "levellist"
+      set (h, "levellistmode", "manual")
+    case "levelstep"
+      set (h, "levelstepmode", "manual")
+    endswitch
+
+    if (strcmpi (get (h, "levellistmode"), "manual")
+        && ! strcmp (prop, "levelstep"))
       lvl = get (h, "levellist");
     elseif (strcmpi (get (h, "levelstepmode"), "manual"))
       z = get (h, "zdata");
-      lvl = ceil ((max(z(:)) - min (z(:)) ./ get (h, "levelstep")));
+      lvs = get (h, "levelstep");
+      lvl(1) = ceil (min (z(:)) / lvs) * lvs;
+      lvl(2) = floor (max (z(:)) / lvs) * lvs;
+      if (lvl(1) >= lvl(2))
+        lvl = median (z(:));
+      else
+        lvl = lvl(1) : lvs : lvl(2);
+      endif
+      set (h, "levellist", lvl);
+      set (h, "levellistmode", "auto");
     else
       lvl = 10;
     endif
@@ -488,9 +506,9 @@
 
     add_patch_children (h);
     update_text (h, d);
+    recursive = false;
   endif
 
-  recursive = false;
 endfunction
 
 function update_text (h, d)
--- a/scripts/plot/private/__ezplot__.m
+++ b/scripts/plot/private/__ezplot__.m
@@ -17,66 +17,75 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{h}, @var{needusage}] =} __ezplot__ (@var{pfunc}, @var{varargin})
+## @deftypefn {Function File} {[@var{h}, @var{needusage}] =} __ezplot__ (@var{pltfunc}, @var{varargin})
 ## Undocumented internal function.
 ## @end deftypefn
 
-function [h, needusage] = __ezplot__ (pfunc, varargin)
+## Overview: This function is the back-end for the 9 ez* plot functions.
+##           As such, most of the function is actually dedicated to sorting
+##           out the inputs and verifying that the particular ez* function
+##           called was called correctly.  The actual plotting occurs near
+##           the end in an unwind_protect block. 
 
-  func = cstrcat ("ez", pfunc);
-  if (strncmp (pfunc, "contour", 7))
-    iscontour = true;
-  else
-    iscontour = false;
-  endif
-  if (strcmp (pfunc, "plot"))
-    isplot = true;
-    isplot3 = false;
-    ispolar = false;
-    nargs = 1;
-  elseif (strcmp (pfunc, "plot3"))
-    isplot = false;
-    isplot3 = true;
-    ispolar = false;
-    nargs = 1;
-  elseif (strcmp (pfunc, "polar"))
-    isplot = false;
-    isplot3 = false;
-    ispolar = true;
-    nargs = 1;
-  else
-    isplot = false;
-    isplot3 = false;
-    ispolar = false;
-    nargs = 2;
-  endif
+function [h, needusage] = __ezplot__ (pltfunc, varargin)
+
+  ezfunc = ["ez" pltfunc];
 
-  [ax, varargin, nargin] = __plt_get_axis_arg__ (func, varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ (ezfunc, varargin{:});
 
+  ## Define outputs early in case of shorting out of function with return;
+  h = [];
   needusage = false;
   if (nargin < 1)
     needusage = true;
     return;
   endif
 
+  iscontour = strncmp (pltfunc, "contour", 7);
+
+  ## Defaults for ezplot
+  isplot  = true;
+  isplot3 = false;
+  ispolar = false;
+  nargs = 1;
+  switch (pltfunc)
+    case "plot"
+      ## defaults already set
+
+    case "plot3"
+      isplot  = false;
+      isplot3 = true;
+  
+    case "polar"
+      isplot  = false;
+      ispolar = true;
+    
+    otherwise
+      ## contour, mesh, surf plots
+      isplot  = false;
+      nargs = 2;
+
+  endswitch
+
   parametric = false;
-  fun = varargin {1};
+  fun = varargin{1};
   if (ischar (fun))
     if (exist (fun, "file") || exist (fun, "builtin"))
-      fun = vectorize (inline (cstrcat (fun, "(t)")));
+      fun = inline ([fun "(t)"]);
     else
       fun = vectorize (inline (fun));
     endif
-    if (isplot && length (argnames (fun)) == 2)
+    argids = argnames (fun);
+    if (isplot && length (argids) == 2)
       nargs = 2;
-    elseif (length (argnames (fun)) != nargs)
-      error ("%s: excepting a function of %d arguments", func, nargs);
+    elseif (numel (argids) != nargs)
+      error ("%s: expecting a function of %d arguments", ezfunc, nargs);
     endif
     fstr = formula (fun);
     if (isplot)
-      xarg = (argnames (fun)){1};
+      xarg = argids{1};
       if (nargs == 2)
-        yarg = (argnames (fun)){2};
+        yarg = argids{2};
       else
         yarg = "";
       endif
@@ -87,21 +96,22 @@
       xarg = "";
       yarg = "";
     else
-      xarg = (argnames (fun)){1};
-      yarg = (argnames (fun)){2};
+      xarg = argids{1};
+      yarg = argids{2};
     endif
   elseif (strcmp (typeinfo (fun), "inline function"))
-    if (isplot && length (argnames (fun)) == 2)
+    argids = argnames (fun);
+    if (isplot && length (argids) == 2)
       nargs = 2;
-    elseif (length (argnames (fun)) != nargs)
-      error ("%s: excepting a function of %d arguments", func, nargs);
+    elseif (numel (argids) != nargs)
+      error ("%s: expecting a function of %d arguments", ezfunc, nargs);
     endif
     fun = vectorize (fun);
     fstr = formula (fun);
     if (isplot)
-      xarg = (argnames (fun)){1};
+      xarg = argids{1};
       if (nargs == 2)
-        yarg = (argnames (fun)){2};
+        yarg = argids{2};
       else
         yarg = "";
       endif
@@ -112,27 +122,27 @@
       xarg = "";
       yarg = "";
     else
-      xarg = (argnames (fun))(1);
-      yarg = (argnames (fun))(2);
+      xarg = argids{1};
+      yarg = argids{2};
     endif
   elseif (isa (fun, "function_handle"))
     fstr = func2str (fun);
-    if (! isempty (strfind (fstr, ')')))
-      args = regexp (substr (fstr, 3, strfind (fstr, ')')(1) - 3),
-                     '(\w+)', 'tokens');
-    fstr = substr (fstr, strfind (fstr, ')')(1) + 1);
+    idx = index (fstr, ')');
+    if (idx != 0)
+      args = regexp (fstr(3:(idx-1)), '\w+', 'match');
+      fstr = fstr(idx+2:end);  # remove '@(x) ' from string name
     else
-      args = {{"x"}};
+      args = {"x"};
     endif
     if (isplot && length (args) == 2)
       nargs = 2;
-    elseif (length (args) != nargs)
-      error ("%s: excepting a function of %d arguments", func, nargs);
+    elseif (numel (args) != nargs)
+      error ("%s: expecting a function of %d arguments", ezfunc, nargs);
     endif
     if (isplot)
-      xarg = args{1}{1};
+      xarg = args{1};
       if (nargs == 2)
-        yarg = args{2}{1};
+        yarg = args{2};
       else
         yarg = "";
       endif
@@ -143,95 +153,101 @@
       xarg = "";
       yarg = "";
     else
-      xarg = args{1}{1};
-      yarg = args{2}{1};
+      xarg = args{1};
+      yarg = args{2};
     endif
   else
-    error ("%s: expecting string, inline function or function handle", func);
+    error ("%s: expecting string, inline function, or function handle", ezfunc);
   endif
 
   if (nargin > 2 || (nargin == 2 && isplot))
     funx = fun;
     fstrx = fstr;
-    funy = varargin {2};
+    funy = varargin{2};
     if (ischar (funy) && ! strcmp (funy, "circ") && ! strcmp (funy, "animate"))
       parametric = true;
       if (exist (funy, "file") || exist (funy, "builtin"))
-        funy = vectorize (inline (cstrcat (funy, "(t)")));
+        funy = inline ([funy "(t)"]);
       else
         funy = vectorize (inline (funy));
       endif
-      if (length (argnames (funy)) != nargs)
-        error ("%s: excepting a function of %d arguments", func, nargs);
+      if (numel (argnames (funy)) != nargs)
+        error ("%s: expecting a function of %d arguments", ezfunc, nargs);
       endif
       fstry = formula (funy);
     elseif (strcmp (typeinfo (funy), "inline function"))
       parametric = true;
-      if (length (argnames (funy)) != nargs)
-        error ("%s: excepting a function of %d arguments", func, nargs);
+      if (numel (argnames (funy)) != nargs)
+        error ("%s: expecting a function of %d arguments", ezfunc, nargs);
       endif
       funy = vectorize (funy);
       fstry = formula (funy);
     elseif (isa (funy, "function_handle"))
       parametric = true;
       fstry = func2str (funy);
-      if (! isempty (strfind (fstry, ')')))
-        args = regexp (substr (fstry, 3, strfind (fstry, ')')(1) - 3),
-                       '(\w+)', 'tokens');
-        fstry = substr (fstry, strfind (fstry, ')')(1) + 1);
+      idx = index (fstry, ')');
+      if (idx != 0)
+        args = regexp (fstry(3:(idx-1)), '\w+', 'match');
+        fstry = fstry(idx+2:end);  # remove '@(x) ' from string name
       else
-        args = {{"y"}};
+        args = {"y"};
       endif
-      if (length (args) != nargs)
-        error ("%s: excepting a function of %d arguments", func, nargs);
+      if (numel (args) != nargs)
+        error ("%s: expecting a function of %d arguments", ezfunc, nargs);
       endif
     endif
 
-    if (parametric && isplot)
-      xarg = "x";
-      yarg = "y";
+    if (! parametric && isplot3)
+      needusage = true;  # Can't call non-parametric ezplot3
+      return;
+    elseif (parametric && isplot)
       if (nargs == 2)
-        error ("%s: can not define a parametric function in this manner");
+        error ("%s: can not define a parametric function in this manner", ezfunc);
+      else
+        xarg = "x";
+        yarg = "y";
       endif
-    endif
-
-    if (!isplot && parametric)
-      funz = varargin {3};
+    elseif (parametric)
+      funz = varargin{3};
       if (ischar (funz) && ! strcmp (funz, "circ")
           && ! strcmp (funz, "animate"))
         if (exist (funz, "file") || exist (funz, "builtin"))
-          funz = vectorize (inline (cstrcat (funz, "(t)")));
+          funz = inline ([funz "(t)"]);
         else
           funz = vectorize (inline (funz));
         endif
-        if (length (argnames (funz)) != nargs)
-          error ("%s: excepting a function of %d arguments", func, nargs);
+        if (numel (argnames (funz)) > nargs)
+          error ("%s: expecting a function of %d arguments", ezfunc, nargs);
         endif
         fstrz = formula (funz);
       elseif (strcmp (typeinfo (funz), "inline function"))
-        if (length (argnames (funz)) != nargs)
-          error ("%s: excepting a function of %d arguments", func, nargs);
+        if (numel (argnames (funz)) != nargs)
+          error ("%s: expecting a function of %d arguments", ezfunc, nargs);
         endif
         funz = vectorize (funz);
         fstrz = formula (funz);
       elseif (isa (funz, "function_handle"))
         fstrz = func2str (funz);
-        args = regexp (substr (fstrz, 3, strfind (fstrz, ')')(1) - 3),
-                       '(\w+)', 'tokens');
-        if (length (args) != nargs)
-          error ("%s: excepting a function of %d arguments", func, nargs);
+        idx = index (fstrz, ')');
+        if (idx != 0)
+          args = regexp (fstrz(3:(idx-1)), '\w+', 'match');
+          fstrz = fstrz(idx+2:end);  # remove '@(x) ' from string name
+        else
+          args = {"z"};
         endif
-        fstrz = substr (fstrz, strfind (fstrz, ')')(1) + 1);
+        if (numel (args) != nargs)
+          error ("%s: expecting a function of %d arguments", ezfunc, nargs);
+        endif
       else
-        error ("%s: parametric plots expect 3 functions", func);
+        error ("%s: parametric plots expect 3 functions", ezfunc);
       endif
     endif
   endif
 
-  if (isplot && nargs != 2)
-    n = 500;
+  if ((isplot && nargs != 2) || isplot3 || ispolar)
+    n = 500;   # default for point-style functions like plot
   else
-    n = 60;
+    n = 60;    # default for meshgrid style functions like contour, surf
   endif
   domain = [];
   circ = false;
@@ -254,192 +270,296 @@
     elseif (isscalar (arg))
       n = arg;
     elseif (numel (arg) == 2)
-      domain = [arg(:).' arg(:).'];
+      domain = [arg(1) arg(2) arg(1) arg(2)];
     elseif (numel (arg) == 4)
       domain = arg(:).';
     else
-      error ("%s: expecting scalar, 2 or 4 element vector", func);
+      error ("%s: expecting scalar, 2-, or 4-element vector", ezfunc);
     endif
   endwhile
 
+  if (circ && (iscontour || isplot3 || isplot))
+    needusage = true;
+    return;
+  elseif (circ && parametric)
+    error ("%s: can not have both circular domain and parametric function",
+           ezfunc);
+  endif
+
+  if (animate && ! isplot3)
+    error ("%s: animate option only valid for ezplot3", ezfunc);
+  endif
+
+  if (parametric)
+    ## Make the label strings pretty by removing extra spaces between base
+    ## and exponent, the '.' in vectorized code, and the '*' for multiply.
+    fstrx = regexprep (regexprep (regexprep (fstrx,
+           '\s*\.?(?:\^|\*\*)\s*','^'), '\.([/+-])', '$1'), '\s*\.?\*\s*', ' ');
+    fstry = regexprep (regexprep (regexprep (fstry,
+           '\s*\.?(?:\^|\*\*)\s*','^'), '\.([/+-])', '$1'), '\s*\.?\*\s*', ' ');
+    if (isplot)
+      fstr = ["x = " fstrx ", y = " fstry];
+    else
+      fstrz = regexprep (regexprep (regexprep (fstrz,
+           '\s*\.?(?:\^|\*\*)\s*','^'), '\.([/+-])', '$1'), '\s*\.?\*\s*', ' ');
+      fstr = ["x = " fstrx ",y = " fstry ", z = " fstrz];
+    endif
+  else
+    fstr = regexprep (regexprep (regexprep (fstr,
+           '\s*\.?(?:\^|\*\*)\s*','^'), '\.([/+-])', '$1'), '\s*\.?\*\s*', ' ');
+    if (isplot && nargs == 2)
+      fstr = [fstr " = 0"];  # make title string of implicit function
+    endif
+  endif
+
   if (isempty (domain))
+    auto_domain = true;
     if (isplot3 || ispolar)
       domain = [0, 2*pi, 0, 2*pi];
     else
       domain = [-2*pi, 2*pi, -2*pi, 2*pi];
     endif
-  endif
-
-  if (circ)
-    if (iscontour || isplot3 || isplot)
-      needusage = true;
-      return;
-    endif
-    if (parametric)
-      error ("%s: can not have both circular domain and parametric function",
-             func);
-    endif
-    cent = [domain(1) + domain(2), domain(3) + domain(4)] / 2;
-    funx = @(r,t) r .* cos (t) + cent (1);
-    funy = @(r,t) r .* sin (t) + cent (2);
-    domain = [0, sqrt((domain(2) - cent(1))^2 + (domain(4) - cent(2))^2), ...
-              -pi, pi];
-    funz = fun;
-    parametric = true;
-  endif
-
-  if (animate)
-    if (!isplot3)
-      error ("%s: animated graphs only valid with plot3", func);
-    endif
-    error ("%s: animated graphs not implemented", func);
-  endif
-
-  if (isplot3 || ispolar || (isplot && nargs == 1))
-    X = linspace (domain (1), domain (2), n);
-  elseif (isplot && numel (domain) == 2)
-    x = linspace (domain (1), domain (2), n);
-    [X, Y] = meshgrid (x, x);
   else
-    x = linspace (domain (1), domain (2), n);
-    y = linspace (domain (3), domain (4), n);
-    [X, Y] = meshgrid (x, y);
+    auto_domain = false;
   endif
 
-  if (parametric)
-    if (isplot)
-      XX = feval (funx, X);
-      Z = feval (funy, X);
-      X = XX;
-    elseif (isplot3)
-      Z = feval (funz, X);
-      XX = feval (funx, X);
-      YY = feval (funy, X);
-      X = XX;
-      Y = YY;
-    else
-      Z = feval (funz, X, Y);
-      XX = feval (funx, X, Y);
-      YY = feval (funy, X, Y);
-      X = XX;
-      Y = YY;
+  auto_domain_done = false;
+  do
+    domain_ok = true;
 
-      ## Eliminate the singularities
-      X = __eliminate_sing__ (X);
-      Y = __eliminate_sing__ (Y);
-      Z = __eliminate_sing__ (Z);
-    endif
-
-    fstrx = regexprep (regexprep (regexprep (fstrx,'\s*\.?\^\s*','^'),
-                      '\./', '/'), '\.?\*', '');
-    fstry = regexprep (regexprep (regexprep (fstry,'\s*\.?\^\s*','^'),
-                      '\./', '/'), '\.?\*', '');
-    if (isplot)
-      fstr = cstrcat ("x = ",fstrx,", y = ",fstry);
-    else
-      fstrz = regexprep (regexprep (regexprep (fstrz,'\s*\.?\^\s*','^'),
-                                    '\./', '/'), '\.?\*', '');
-      fstr = cstrcat ("x = ",fstrx,",y = ",fstry,", z = ",fstrz);
-    endif
-  else
-    if (isplot3)
-      needusage = true;
-      return;
+    if ((isplot && nargs == 1) || isplot3 || ispolar)
+      X = linspace (domain(1), domain(2), n);
+    elseif (isplot && numel (domain) == 2)
+      x = linspace (domain(1), domain(2), n);
+      [X, Y] = meshgrid (x, x);
+    elseif (circ)
+      ## To plot on circular domain develop grid in polar coordinates
+      ## and then switch these to Cartesian coordinates.
+      cent = [domain(1) + domain(2), domain(3) + domain(4)] / 2;
+      rmax = sqrt ((domain(2) - cent(1))^2 + (domain(4) - cent(2))^2);
+      r = linspace (0, rmax, n);
+      t = linspace (0, 2*pi, n);
+      [T, R] = meshgrid (t, r);
+      X = R .* cos (T) + cent(1);
+      Y = R .* sin (T) + cent(2);
+      domain = [-rmax+cent(1), +rmax+cent(1), -rmax+cent(2), +rmax+cent(2)];
+    else  # contour, mesh, surf plots
+      x = linspace (domain(1), domain(2), n);
+      y = linspace (domain(3), domain(4), n);
+      [X, Y] = meshgrid (x, y);
     endif
 
-    fstr = regexprep (regexprep (regexprep (fstr,'\s*\.?\^\s*','^'), '\./', '/'),
-                      '\.?\*', '');
-    if (isplot && nargs == 2)
-      if (strcmp (typeinfo (fun), "inline function")
-          && !isempty (strfind (formula (fun) , "=")))
-        fun = inline (cstrcat (strrep (formula (fun), "=", "- ("), ")"));
+    if (parametric)
+      if (isplot)
+        XX = feval (funx, X);
+        Z = feval (funy, X);
+        X = XX;
+      elseif (isplot3)
+        Z = feval (funz, X);
+        XX = feval (funx, X);
+        YY = feval (funy, X);
+        X = XX;
+        Y = YY;
       else
-        fstr = cstrcat (fstr, " = 0");
-      endif
-
-      Z = feval (fun, X, Y);
-
-      ## Matlab returns line objects for this case and so can't call
-      ## contour directly as it returns patch objects to allow colormaps
-      ## to work with contours. Therefore recreate the lines from the
-      ## output for contourc, and store in cell arrays.
-      [c, lev] = contourc (X, Y, Z, [0, 0]);
+        Z = feval (funz, X, Y);
+        XX = feval (funx, X, Y);
+        YY = feval (funy, X, Y);
+        X = XX;
+        Y = YY;
 
-      i1 = 1;
-      XX = {};
-      YY = {};
-      while (i1 < length (c))
-        clev = c(1,i1);
-        clen = c(2,i1);
-        XX = [XX, {c(1, i1+1:i1+clen)}];
-        YY = [YY, {c(2, i1+1:i1+clen)}];
-        i1 += clen+1;
-      endwhile
-    else
-      if (ispolar)
-        Z = feval (fun, X);
-      elseif (isplot)
-        Z = real (feval (fun, X));
-
-        ## Eliminate the singularities. This seems to be what matlab
-        ## does, but can't be sure.
-        XX = sort (Z (isfinite (Z)));
-        if (length (X) > 4)
-          d = XX(fix (7 * length (XX) / 8)) - XX(fix (length (XX) / 8));
-          yrange = [max(XX(1) - d/8, XX(fix (length (XX) / 8)) - d), ...
-                    min(XX(end) + d/8, XX(fix (7 * length (XX) / 8)) + d)];
-        else
-          yrange = [XX(1), XX(end)];
-        endif
-
-        idx = 2 : length (Z);
-        idx = find (((Z(idx) > yrange(2) / 2) & (Z(idx-1) < yrange(1) / 2)) |
-                 ((Z(idx) < yrange(1) / 2) & (Z(idx-1) > yrange (2) / 2)));
-        if (any (idx))
-          Z(idx) = NaN;
-        endif
-      else
+        ## Eliminate the singularities
+        X = __eliminate_sing__ (X);
+        Y = __eliminate_sing__ (Y);
+        Z = __eliminate_sing__ (Z);
+      endif
+    else  ## non-parametric plots
+      if (isplot && nargs == 2)
         Z = feval (fun, X, Y);
 
-        ## Eliminate the singularities
-        Z = __eliminate_sing__ (Z);
+        ## Matlab returns line objects for this case and so can't call
+        ## contour directly as it returns patch objects to allow colormaps
+        ## to work with contours.  Therefore recreate the lines from the
+        ## output for contourc, and store in cell arrays.
+        [c, ~] = contourc (X, Y, Z, [0, 0]);
+
+        i = 1;
+        XX = YY = {};
+        while (i < length (c))
+          clev = c(1,i);
+          clen = c(2,i);
+          XX = [XX, {c(1, i+1:i+clen)}];
+          YY = [YY, {c(2, i+1:i+clen)}];
+          i += clen+1;
+        endwhile
+      else
+        if (ispolar)
+          Z = feval (fun, X);
+          ## FIXME: Why aren't singularities eliminated for polar plots?
+        elseif (isplot)
+          Z = feval (fun, X);
+          ## Eliminate the singularities
+          Z = __eliminate_sing__ (Z);
+          domain = find_valid_domain (X, [], Z);
+        elseif (iscontour)
+          Z = feval (fun, X, Y);
+          Z = __eliminate_sing__ (Z);
+        else  #  mesh, surf plots
+          Z = feval (fun, X, Y);
+          Z = __eliminate_sing__ (Z);
+          if (circ)
+            ## Use domain calculated at the start.
+            ## The X, Y grids are non-monotonic after conversion from polar
+            ## coordinates and find_valid_domain fails.
+
+          elseif (auto_domain && ! auto_domain_done)
+            valid_domain = find_valid_domain (X, Y, Z);
+            domain_ok = isequal (domain, valid_domain);
+            domain = valid_domain;
+            auto_domain_done = true;  # ensures only 1 round of do loop done
+          else
+            if (! auto_domain_done)
+              domain = find_valid_domain (X, Y, Z);
+            endif
+          end
+        endif
       endif
     endif
-  endif
+  until (domain_ok)
 
-  oldax = gca ();
+  ## Now, actually call the correct plot function with valid data and domain.
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (ax);
+    hax = newplot (hax);
     if (iscontour)
-      [clev, h] = feval (pfunc, X, Y, Z);
+      [~, h] = feval (pltfunc, hax, X, Y, Z);
+      ## FIXME: Work around contour setting axis tight.
+      ##        Fix should really be in __countour__.
+      axis (hax, domain);
     elseif (isplot && nargs == 2)
-      h = [];
-      hold_state = get (ax, "nextplot");
+      h = zeros (length (XX), 1);
+      hold_state = get (hax, "nextplot");
       for i = 1 : length (XX)
-        h = [h; plot(XX{i}, YY{i})];
+        h(i) = plot(hax, XX{i}, YY{i});
         if (i == 1)
-          set (ax, "nextplot", "add");
+          set (hax, "nextplot", "add");
         endif
       endfor
-      set (ax, "nextplot", hold_state);
-    elseif (ispolar || isplot)
-      h = feval (pfunc, X, Z);
-      if (isplot && !parametric)
-        axis ([X(1), X(end), yrange]);
+      set (hax, "nextplot", hold_state);
+      axis (hax, domain);
+    elseif (isplot || ispolar)
+      h = feval (pltfunc, hax, X, Z);
+      if (isplot && ! parametric)
+        axis (hax, domain);
+      endif
+    elseif (isplot3)
+      if (animate)
+        ## draw animation, then replace with true plot3
+        comet3 (hax, X, Y, Z, .05);
       endif
-    else
-      h = feval (pfunc, X, Y, Z);
+      h = feval (pltfunc, hax, X, Y, Z);
+      set (hax, "box", "off");
+      grid (hax, "on");
+      zlabel (hax, "z");
+    else  # mesh and surf plots
+      h = feval (pltfunc, hax, X, Y, Z);
+      ## FIXME: surf, mesh should really do a better job of setting zlim
+      if (! parametric)
+        axis (hax, domain);
+      endif
     endif
-    xlabel (xarg);
-    ylabel (yarg);
-    title (fstr);
+    xlabel (hax, xarg);
+    ylabel (hax, yarg);
+    title (hax, fstr);
   unwind_protect_cleanup
-    axes (oldax);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
 endfunction
 
+## Eliminate bad data (complex values, infinities, singularities)
 function x = __eliminate_sing__ (x)
-  x (isinf (x)) = NaN;
-  x (abs (del2 (x)) > 0.2 * (max (x(:)) - min (x(:)))) = NaN;
+  if (iscomplex (x))
+    x(imag (x) != 0) = NaN;
+  endif
+  x(isinf (x)) = NaN;
+  ## High rates of curvature are treated as singularities
+  threshold = 0.2 * (max (x(:)) - min (x(:)));
+  x(abs (del2 (x)) > threshold) = NaN;
 endfunction
+
+## Find: 1) range of function where there are not NaN values,
+##       2) function is changing (not just flat surface)
+function domain = find_valid_domain (X, Y, Z);
+
+  if (isvector (Z))
+    ## 2-D data for isplot
+    domain = [X(1) X(end)];
+
+    ## Guess a range which includes the "mass" of the data by using a 
+    ## median-based approach.  The center 3/4 of the data is used to
+    ## determine the range of the data.
+    ## This seems to be vaguely what Matlab does, but can't be sure.
+    XX = sort (Z(isfinite (Z)));
+    if (length (X) > 4)
+      irlo = XX(fix (1/8 * length (XX)));
+      irhi = XX(fix (7/8 * length (XX)));
+      d = irhi - irlo;
+      domain(3) = max (XX(1) - d/8, irlo - d);
+      domain(4) = min (XX(end) + d/8, irhi + d);
+    else
+      domain(3:4) = [XX(1), XX(end)];
+    endif
+
+    #{
+    ## FIXME: Old algorithm for removing singularities
+    ## Deprecated in 3.8.  Can be removed if no problems appear in ezplot.
+    idx = 2 : length (Z);
+    idx = find (((Z(idx) > yrange(2) / 2) & (Z(idx-1) < yrange(1) / 2)) |
+                ((Z(idx) < yrange(1) / 2) & (Z(idx-1) > yrange(2) / 2)));
+    Z(idx) = NaN;
+    #}
+
+  else
+    ## 3-D data such as mesh, surf
+    Zfinite = ! isnan (Z); 
+    Zrows = any (Zfinite, 2); 
+    rmin = find (Zrows, 1, "first"); 
+    rmax = find (Zrows, 1, "last"); 
+    Zcols = any (Zfinite, 1); 
+    cmin = find (Zcols, 1, "first"); 
+    cmax = find (Zcols, 1, "last"); 
+
+    ## Handle nasty case of all NaNs 
+    if (isempty (rmin))
+      rmin = 1, rmax = rows (Z);
+    endif
+    if (isempty (cmin))
+      cmin = 1, cmax = columns (Z);
+    endif
+
+    if (   ! any (isnan (Z([rmin, rmax],:)(:)))
+        && ! any (isnan (Z(:, [cmin, cmax])(:))))
+      ## Exclude surfaces along borders which are flat (gradient =~ 0).
+      ## Technically, this calculation might be better done with actual
+      ## deltaX, deltaY values.  But, data is usually meshgridded
+      ## (constant spacing) so working with deltaROW#, deltaCOL# is fine.
+      [Zx, Zy] = gradient (Z(rmin:rmax, cmin:cmax));
+      Zgrad = sqrt (Zx.^2 + Zy.^2);
+      slope = ((max (Z(:)) - min (Z(:)))
+                / sqrt ((rmax - rmin)^2 + (cmax - cmin)^2));
+      slope /= 125;  # threshold for discarding points.
+      Zrows = any (Zgrad > slope, 2); 
+      rmin += find (Zrows, 1, "first") - 1; 
+      rmax += find (Zrows, 1, "last") - rows (Zrows); 
+      Zcols = any (Zgrad > slope, 1); 
+      cmin += find (Zcols, 1, "first") - 1; 
+      cmax += find (Zcols, 1, "last") - columns (Zcols); 
+    endif
+
+    domain = [X(1,cmin) X(1,cmax) Y(rmin,1) Y(rmax,1)];
+  endif
+  
+endfunction
+
--- a/scripts/plot/private/__fltk_ginput__.m
+++ b/scripts/plot/private/__fltk_ginput__.m
@@ -23,9 +23,6 @@
 
 ## This is ginput.m implementation for fltk.
 
-## FIXME -- Key presses cannot toggle menu items nor hotkey functionality
-## (grid, autoscale) during ginput!
-
 function [x, y, button] = __fltk_ginput__ (f, n = -1)
 
   if (isempty (get (f, "currentaxes")))
@@ -33,7 +30,7 @@
   endif
 
   x = y = button = [];
-  ginput_aggregator (0, 0, 0, 0);
+  ginput_accumulator (0, 0, 0, 0);  # initialize accumulator
 
   unwind_protect
 
@@ -43,17 +40,14 @@
     orig_ginput_keypressfcn = get (f, "keypressfcn");
     set (f, "keypressfcn", @ginput_keypressfcn);
 
-    while (true)
+    do
       __fltk_redraw__ ();
 
       ## Release CPU.
       sleep (0.01);
 
-      [x, y, n0, button] = ginput_aggregator (-1, 0, 0, 0);
-      if (n0 == n || n0 < 0)
-        break;
-      endif
-    endwhile
+      [x, y, n0, button] = ginput_accumulator (-1, 0, 0, 0);
+    until (n0 == n || n0 < 0)
 
   unwind_protect_cleanup
     set (f, "windowbuttondownfcn", orig_windowbuttondownfcn);
@@ -62,17 +56,15 @@
 
 endfunction
 
-function [x, y, n, button] = ginput_aggregator (mode, xn, yn, btn)
+function [x, y, n, button] = ginput_accumulator (mode, xn, yn, btn)
   persistent x y n button;
 
   if (mode == 0)
     ## Initialize.
-    x = [];
-    y = [];
-    button = [];
+    x = y = button = [];
     n = 0;
   elseif (mode == 1)
-    ## Accept mouse button or key press.
+    ## Append mouse button or key press.
     x = [x; xn];
     y = [y; yn];
     button = [button; btn];
@@ -81,25 +73,23 @@
     ## The end due to Enter.
     n = -1;
  endif
+
 endfunction
 
 function ginput_windowbuttondownfcn (src, data)
   point = get (get (src,"currentaxes"), "currentpoint");
-  ## FIXME -- How to get the actual mouse button pressed (1,2,3) into
-  ## "button"?
-  button = 1;
-  ginput_aggregator (1, point(1,1), point(2,1), button);
+  button = data;
+  ginput_accumulator (1, point(1,1), point(2,1), button);
 endfunction
 
 function ginput_keypressfcn (src, evt)
   point = get (get (src, "currentaxes"), "currentpoint");
-  ## FIXME -- use evt.Key or evt.Character?
   key = evt.Key;
   if (key == 10)
-    ## Enter key.
-    ginput_aggregator (2, point(1,1), point(2,1), key);
+    ## Enter key stops ginput.
+    ginput_accumulator (2, NaN, NaN, NaN);
   else
-    ginput_aggregator (1, point(1,1), point(2,1), key);
+    ginput_accumulator (1, point(1,1), point(2,1), key);
   endif
 endfunction
 
--- a/scripts/plot/private/__gnuplot_ginput__.m
+++ b/scripts/plot/private/__gnuplot_ginput__.m
@@ -125,23 +125,18 @@
         break;
       endif
 
-      if (nargin > 1)
-        ## Input argument n was given => stop when k == n.
-        if (k == n)
-          break;
-        endif
-      else
-        ## Input argument n not given => stop when hitting a return key.
-        ## if (button(k) == 0x0D || button(k) == 0x0A)
-        ##   ## hit Return or Enter
-        if (button(k) == 0x0D)
-          ## hit Return
-          x(k:end) = [];
-          y(k:end) = [];
-          button(k:end) = [];
-          break;
-        endif
+      if (button(k) == 0x0D || button(k) == 0x0A)
+        ## Stop when hitting a RETURN or ENTER key.
+        x(k:end) = [];
+        y(k:end) = [];
+        button(k:end) = [];
+        break;
       endif
+      if (nargin > 1 && k == n)
+        ## Input argument n was given, stop when k == n.
+        break;
+      endif
+
     endwhile
 
   unwind_protect_cleanup
--- a/scripts/plot/private/__gnuplot_print__.m
+++ b/scripts/plot/private/__gnuplot_print__.m
@@ -293,6 +293,17 @@
 
 function [h, fontsize] = get_figure_text_objs (opts)
   h = findall (opts.figure, "-property", "fontsize");
+  hp = get (h, "parent");
+  if (iscell (hp))
+    hp = cell2mat (hp);
+  endif
+  ## Do not change the text objects fontsizes for the children of a
+  ## legend axes.  These will be handled by the fontsize listener.
+  is_legend_key_string = strcmp (get (hp, "tag"), "legend") ...
+                       & isprop (hp, "string") ...
+                       & isprop (hp, "location") ...
+                       & strcmp (get (hp, "type"), "axes");
+  h(is_legend_key_string) = [];
   fontsize = get (h, "fontsize");
   switch (numel (fontsize))
   case 0
--- a/scripts/plot/private/__go_draw_axes__.m
+++ b/scripts/plot/private/__go_draw_axes__.m
@@ -564,7 +564,7 @@
             titlespec{data_idx} = "title \"\"";
           else
             tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "displayname"));
-            titlespec{data_idx} = cstrcat ("title \"", tmp, "\"");
+            titlespec{data_idx} = ['title "' tmp '"'];
           endif
           usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata));
           errbars = "";
@@ -683,7 +683,7 @@
                  titlespec{local_idx} = "title \"\"";
                else
                  tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "displayname"));
-                 titlespec{local_idx} = cstrcat ("title \"", tmp, "\"");
+                 titlespec{local_idx} = ['title "' tmp '"'];
                endif
                if (isfield (obj, "facecolor"))
                  if ((strncmp (obj.facecolor, "flat", 4)
@@ -1119,7 +1119,7 @@
               titlespec{data_idx} = "title \"\"";
             else
               tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "displayname"));
-              titlespec{data_idx} = cstrcat ("title \"", tmp, "\"");
+              titlespec{data_idx} = ['title "' tmp '"'];
             endif
             withclause{data_idx} = sprintf ("with pm3d linestyle %d",
                                             data_idx);
@@ -1329,7 +1329,7 @@
           else
             num_lines = numel (obj.string);
           endif
-          switch valign
+          switch (valign)
             ## Text offset in characters. This relies on gnuplot for font metrics.
             case "top"
               dy = -0.5;
@@ -2262,17 +2262,17 @@
     if (! isempty (t.fontangle)
         && (strcmpi (t.fontangle, "italic")
             || strcmpi (t.fontangle, "oblique")))
-      f = cstrcat (f, "-bolditalic");
+      f = [f "-bolditalic"];
       it = true;
       bld = true;
     else
-      f = cstrcat (f, "-bold");
+      f = [f "-bold"];
       bld = true;
     endif
   elseif (! isempty (t.fontangle)
           && (strcmpi (t.fontangle, "italic")
               || strcmpi (t.fontangle, "oblique")))
-    f = cstrcat (f, "-italic");
+    f = [f "-italic"];
     it = true;
   endif
   if (isempty (t.fontsize))
@@ -2367,7 +2367,7 @@
   for i = length (s) : -1 : 1
     ## special case for "\0"  and replace with "{/Symbol \306}'
     if (strncmp (m{i}, '\0', 2))
-      str = cstrcat (str(1:s(i) - 1), '{/Symbol \306}', str(s(i) + 2:end));
+      str = [str(1:s(i) - 1) '{/Symbol \306}' str(s(i) + 2:end)];
     else
       f = m{i}(2:end);
       if (isfield (sym, f))
@@ -2382,28 +2382,24 @@
         ##elseif (it)
         ##  g = regexprep (g, '/Symbol', '/Symbol-italic');
         ##endif
-        str = cstrcat (str(1:s(i) - 1), g, str(e(i) + 1:end));
+        str = [str(1:s(i) - 1) g str(e(i) + 1:end)];
       elseif (strncmp (f, "rm", 2))
         bld = false;
         it = false;
-        str = cstrcat (str(1:s(i) - 1), '/', fnt, ' ', str(s(i) + 3:end));
+        str = [str(1:s(i) - 1) '/' fnt ' ' str(s(i) + 3:end)];
       elseif (strncmp (f, "it", 2) || strncmp (f, "sl", 2))
         it = true;
         if (bld)
-          str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bolditalic ',
-                         str(s(i) + 3:end));
+          str = [str(1:s(i) - 1) '/' fnt '-bolditalic ' str(s(i) + 3:end)];
         else
-          str = cstrcat (str(1:s(i) - 1), '/', fnt, '-italic ',
-                         str(s(i) + 3:end));
+          str = [str(1:s(i) - 1) '/' fnt '-italic ' str(s(i) + 3:end)];
         endif
       elseif (strncmp (f, "bf", 2))
         bld = true;
         if (it)
-          str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bolditalic ',
-                         str(2(i) + 3:end));
+          str = [str(1:s(i) - 1) '/' fnt '-bolditalic ' str(s(i) + 3:end)];
         else
-          str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bold ',
-                         str(s(i) + 3:end));
+          str = [str(1:s(i) - 1) '/' fnt '-bold ' str(s(i) + 3:end)];
         endif
       elseif (strcmpi (f, "color"))
         ## FIXME Ignore \color but remove trailing {} block as well
@@ -2411,7 +2407,7 @@
         if (isempty (d))
           warning ('syntax error in \color argument');
         else
-          str = cstrcat (str(1:s(i) - 1), str(e(i) + d + 1:end));
+          str = [str(1:s(i) - 1) str(e(i) + d + 1:end)];
         endif
       elseif (strcmpi (f, "fontname"))
         b1 = strfind (str(e(i) + 1:end),'{');
@@ -2419,9 +2415,8 @@
         if (isempty (b1) || isempty (b2))
           warning ('syntax error in \fontname argument');
         else
-          str = cstrcat (str(1:s(i) - 1), '/',
-                         str(e(i)+b1(1) + 1:e(i)+b2(1)-1), '{}',
-                         str(e(i) + b2(1) + 1:end));
+          str = [str(1:s(i) - 1), '/', str(e(i)+b1(1) + 1:e(i)+b2(1)-1), ...
+                 '{}', str(e(i) + b2(1) + 1:end)];
         endif
       elseif (strcmpi (f, "fontsize"))
         b1 = strfind (str(e(i) + 1:end),'{');
@@ -2429,9 +2424,8 @@
         if (isempty (b1) || isempty (b2))
           warning ('syntax error in \fontname argument');
         else
-          str = cstrcat (str(1:s(i) - 1), '/=',
-                         str(e(i)+b1(1) + 1:e(i)+b2(1)-1), '{}',
-                         str(e(i) + b2(1) + 1:end));
+          str = [str(1:s(i) - 1), '/=', str(e(i)+b1(1) + 1:e(i)+b2(1)-1), ...
+                 '{}', str(e(i) + b2(1) + 1:end)];
         endif
       else
         ## Last desperate attempt to treat the symbol. Look for things
@@ -2449,8 +2443,7 @@
             ##elseif (it)
             ##  g = regexprep (g, '/Symbol', '/Symbol-italic');
             ##endif
-            str = cstrcat (str(1:s(i) - 1), g,
-                           str(s(i) + length (flds{j}) + 1:end));
+            str = [str(1:s(i) - 1) g str(s(i) + length (flds{j}) + 1:end)];
             break;
           endif
         endfor
@@ -2507,16 +2500,16 @@
             if (length_string (str(s(i)+p+2:s(i)+p+l1-1)) <=
                 length_string (str(s(i+1)+p+2:s(i+1)+p+l2-1)))
               ## Shortest already first!
-              str = cstrcat (str(1:s(i)+p-1), "@", str(s(i)+p:end));
+              str = [str(1:s(i)+p-1) "@" str(s(i)+p:end)];
             else
               ## Have to swap sub/super-script to get shortest first.
-              str = cstrcat (str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+l2),
-                             str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+l2+1:end));
+              str = [str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+l2), ...
+                     str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+l2+1:end)];
             endif
           else
             ## Have to swap sub/super-script to get shortest first.
-            str = cstrcat (str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+1),
-                           str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+2:end));
+            str = [str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+1), ...
+                   str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+2:end)];
           endif
           i += 2;
           p ++;
@@ -2526,7 +2519,7 @@
       else
         if (s(i+1) == s(i) + 2)
           ## Shortest already first!
-          str = cstrcat (str(1:s(i)+p-1), "@", str(s(i)+p:end));
+          str = [str(1:s(i)+p-1) "@" str(s(i)+p:end)];
           p ++;
           i += 2;
         else
--- a/scripts/plot/private/__next_line_color__.m
+++ b/scripts/plot/private/__next_line_color__.m
@@ -1,3 +1,4 @@
+## Copyright (C) 2013 Carl Osterwisch
 ## Copyright (C) 2007-2012 John W. Eaton
 ##
 ## This file is part of Octave.
@@ -23,32 +24,35 @@
 
 ## Return the next line color in the rotation.
 
+## Author: Carl Osterwisch
 ## Author: jwe
 
 function rgb = __next_line_color__ (reset)
 
-  persistent color_rotation;
-  persistent num_colors;
-  persistent color_index;
+  persistent reset_colors = true;
 
-  if (nargin < 2)
-    if (nargin == 1)
-      if (reset || isempty (color_rotation))
-        color_rotation = get (gca (), "colororder");
-        num_colors = rows (color_rotation);
-        color_index = 1;
-      endif
-    elseif (! isempty (color_rotation))
-      rgb = color_rotation(color_index,:);
-      if (++color_index > num_colors)
-        color_index = 1;
-        __next_line_style__ ("incr");
-      endif
-    else
-      error ("__next_line_color__: color_rotation not initialized");
-    endif
-  else
+  if (nargin > 1)
     print_usage ();
   endif
 
+  if (nargin == 1)
+    ## Indicates whether the next call will increment or not
+    reset_colors = reset;
+  else
+    ## Find and return the next line color
+    ca = gca ();
+    colorOrder = get (ca, "ColorOrder");
+    if (reset_colors)
+      color_index = 1;
+      reset_colors = false;
+    else
+      ## Executed when "hold all" is active
+      nChildren = length (get (ca, "Children"));
+      nColors = rows (colorOrder);
+      color_index = mod (nChildren, nColors) + 1;
+    endif
+    rgb = colorOrder(color_index,:);
+  endif
+
 endfunction
+
--- a/scripts/plot/private/__next_line_style__.m
+++ b/scripts/plot/private/__next_line_style__.m
@@ -26,36 +26,36 @@
 
 function [linestyle, marker] = __next_line_style__ (reset)
 
-  persistent style_rotation;
-  persistent num_styles;
-  persistent style_index;
+  persistent reset_style = true;
 
-  if (nargin < 2)
-    if (nargin == 1)
-      if (ischar (reset) && strncmp (reset, "incr", 4))
-        if (isempty (style_rotation))
-          error ("__next_line_style__: style_rotation not initialized");
-        elseif (++style_index > num_styles)
-          style_index = 1;
-        endif
-      elseif (reset || isempty (style_rotation))
-        style_rotation = get (gca (), "linestyleorder");
-        if (ischar (style_rotation))
-          style_rotation = ostrsplit (style_rotation, "|");
-        endif
-        num_styles = length (style_rotation);
-        style_index = 1;
-      endif
-    elseif (! isempty (style_rotation))
-      options = __pltopt__ ("__next_line_style__",
-                            style_rotation (style_index));
-      linestyle = options.linestyle;
-      marker = options.marker;
-    else
-      error ("__next_line_style__: style_rotation not initialized");
-    endif
-  else
+  if (nargin > 1)
     print_usage ();
   endif
 
+  if (nargin == 1)
+    ## Indicates whether the next call will increment or not
+    reset_style = reset;
+  else
+    ## Find and return the next line style
+    ca = gca ();
+    style_rotation = get (ca, "linestyleorder");
+    if (ischar (style_rotation))
+      style_rotation = strsplit (style_rotation, "|");
+    endif
+    nStyles = length (style_rotation);
+    if (reset_style || (nStyles < 2))
+      style_index = 1;
+      reset_style = false;
+    else
+      ## Executed when "hold all" is active
+      nChildren = length (get (ca, "Children"));
+      nColors = length (get (ca, "ColorOrder"));
+      style_index = mod (floor (nChildren/nColors), nStyles) + 1;
+    endif
+    options = __pltopt__ ("__next_line_style__",
+                          style_rotation(style_index));
+    linestyle = options.linestyle;
+    marker = options.marker;
+  endif
+
 endfunction
--- a/scripts/plot/private/__plt__.m
+++ b/scripts/plot/private/__plt__.m
@@ -156,7 +156,7 @@
   endfor
 endfunction
 
-function retval = __plt1__ (h, x1, options, properties)
+function retval = __plt1__ (h, x1, options, properties = {})
 
   if (nargin < 2 || nargin > 4)
     print_usage ();
@@ -166,10 +166,6 @@
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 4)
-    properties = {};
-  endif
-
   if (! isstruct (options))
     error ("__plt1__: options must be a struct array");
   endif
@@ -197,7 +193,7 @@
 
 endfunction
 
-function retval = __plt2__ (h, x1, x2, options, properties)
+function retval = __plt2__ (h, x1, x2, options, properties = {})
 
   if (nargin < 3 || nargin > 5)
     print_usage ();
@@ -207,12 +203,8 @@
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 5)
-    properties = {};
-  endif
-
   if (! isstruct (options))
-    error ("__plt1__: options must be a struct array");
+    error ("__plt2__: options must be a struct array");
   endif
 
   if (islogical (x1))
@@ -262,350 +254,243 @@
 
 endfunction
 
-function retval = __plt2mm__ (h, x, y, options, properties)
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
-  endif
-
-  if (nargin < 4 || isempty (options))
-    options = __default_plot_options__ ();
-  endif
-
-  if (nargin < 5)
-    properties = {};
-  endif
-
-  [x_nr, x_nc] = size (x);
-  [y_nr, y_nc] = size (y);
-
-  k = 1;
-  if (x_nr == y_nr && x_nc == y_nc)
-    if (x_nc > 0)
-      if (numel (options) == 1)
-        options = repmat (options(:), x_nc, 1);
-      endif
-      retval = zeros (x_nc, 1);
-      for i = 1:x_nc
-        linestyle = options(i).linestyle;
-        marker = options(i).marker;
-        if (isempty (marker) && isempty (linestyle))
-           [linestyle, marker] = __next_line_style__ ();
-        endif
-        color = options(i).color;
-        if (isempty (color))
-          color = __next_line_color__ ();
-        endif
-
-        retval(i) = line (x(:,i), y(:,i), "color", color,
-                          "linestyle", linestyle,
-                          "marker", marker, properties{:});
-      endfor
-    else
-      error ("__plt2mm__: arguments must be a matrices");
-    endif
-  else
-    error ("__plt2mm__: matrix dimensions must match");
-  endif
-
-endfunction
-
-function retval = __plt2mv__ (h, x, y, options, properties)
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
-  endif
+function retval = __plt2mm__ (h, x, y, options, properties = {})
 
   if (nargin < 4 || isempty (options))
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 5)
-    properties = {};
-  endif
-
   [x_nr, x_nc] = size (x);
   [y_nr, y_nc] = size (y);
 
-  if (y_nr == 1)
-    y = y';
-    tmp = y_nr;
-    y_nr = y_nc;
-    y_nc = tmp;
-  endif
-
-  if (x_nr == y_nr)
-    1;
-  elseif (x_nc == y_nr)
-    x = x';
-    tmp = x_nr;
-    x_nr = x_nc;
-    x_nc = tmp;
-  else
-    error ("__plt2mv__: matrix dimensions must match");
+  if (x_nr != y_nr && x_nc != y_nc)
+    error ("__plt2mm__: matrix dimensions must match");
   endif
 
-  if (x_nc > 0)
-    if (numel (options) == 1)
-      options = repmat (options(:), x_nc, 1);
+  if (numel (options) == 1)
+    options = repmat (options(:), x_nc, 1);
+  endif
+  retval = zeros (x_nc, 1);
+  for i = 1:x_nc
+    linestyle = options(i).linestyle;
+    marker = options(i).marker;
+    if (isempty (marker) && isempty (linestyle))
+      [linestyle, marker] = __next_line_style__ ();
     endif
-    retval = zeros (x_nc, 1);
-    for i = 1:x_nc
-      linestyle = options(i).linestyle;
-      marker = options(i).marker;
-      if (isempty (marker) && isempty (linestyle))
-        [linestyle, marker] = __next_line_style__ ();
-      endif
-      color = options(i).color;
-      if (isempty (color))
-        color = __next_line_color__ ();
-      endif
+    color = options(i).color;
+    if (isempty (color))
+      color = __next_line_color__ ();
+    endif
 
-      retval(i) = line (x(:,i), y, "color", color,
-                        "linestyle", linestyle,
-                        "marker", marker, properties{:});
-    endfor
-  else
-    error ("__plt2mv__: arguments must be a matrices");
-  endif
+    retval(i) = line (x(:,i), y(:,i), "color", color,
+                      "linestyle", linestyle,
+                      "marker", marker, properties{:});
+  endfor
 
 endfunction
 
-function retval = __plt2ss__ (h, x, y, options, properties)
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
-  endif
+function retval = __plt2mv__ (h, x, y, options, properties = {})
 
   if (nargin < 4 || isempty (options))
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 5)
-    properties = {};
+  y = y(:);
+  [y_nr, y_nc] = size (y);
+  [x_nr, x_nc] = size (x);
+
+  if (x_nr == y_nr)
+    ## Correctly oriented.  Do nothing.
+  elseif (x_nc == y_nr)
+    x = x.';
+    [x_nr, x_nc] = deal (x_nc, x_nr);
+  else
+    error ("__plt2mv__: matrix dimensions must match");
+  endif
+
+  if (numel (options) == 1)
+    options = repmat (options(:), x_nc, 1);
+  endif
+  retval = zeros (x_nc, 1);
+  for i = 1:x_nc
+    linestyle = options(i).linestyle;
+    marker = options(i).marker;
+    if (isempty (marker) && isempty (linestyle))
+      [linestyle, marker] = __next_line_style__ ();
+    endif
+    color = options(i).color;
+    if (isempty (color))
+      color = __next_line_color__ ();
+    endif
+
+    retval(i) = line (x(:,i), y, "color", color,
+                      "linestyle", linestyle,
+                      "marker", marker, properties{:});
+  endfor
+
+endfunction
+
+function retval = __plt2ss__ (h, x, y, options, properties = {})
+
+  if (nargin < 4 || isempty (options))
+    options = __default_plot_options__ ();
   endif
 
   if (numel (options) > 1)
     options = options(1);
   endif
 
-  [x_nr, x_nc] = size (x);
-  [y_nr, y_nc] = size (y);
+  linestyle = options.linestyle;
+  marker = options.marker;
+  if (isempty (marker) && isempty (linestyle))
+    ## If unspecified, marker for a single point is always "."
+    linestyle = "-";
+    marker = ".";
+  endif
+  color = options.color;
+  if (isempty (color))
+    color = __next_line_color__ ();
+  endif
 
-  if (x_nr == 1 && x_nr == y_nr && x_nc == 1 && x_nc == y_nc)
-    linestyle = options.linestyle;
-    marker = options.marker;
-    if (isempty (marker) && isempty (linestyle))
-      [linestyle, marker] = __next_line_style__ ();
-    endif
-    color = options.color;
-    if (isempty (color))
-      color = __next_line_color__ ();
-    endif
-
-    retval = line (x, y, "color", color,
-                   "linestyle", linestyle,
-                   "marker", marker, properties{:});
-  else
-    error ("__plt2ss__: arguments must be scalars");
-  endif
+  retval = line (x, y, "color", color,
+                 "linestyle", linestyle,
+                 "marker", marker, properties{:});
 
 endfunction
 
-function retval = __plt2sv__ (h, x, y, options, properties)
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
-  endif
+function retval = __plt2sv__ (h, x, y, options, properties = {})
 
   if (nargin < 4 || isempty (options))
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 5)
-    properties = {};
+  len = numel (y);
+  if (numel (options) == 1)
+    options = repmat (options(:), len, 1);
   endif
-
-  if (isscalar (x) && isvector (y))
-    len = numel (y);
-    if (numel (options) == 1)
-      options = repmat (options(:), len, 1);
+  retval = zeros (len, 1);
+  for i = 1:len
+    linestyle = options(i).linestyle;
+    marker = options(i).marker;
+    if (isempty (marker) && isempty (linestyle))
+      ## If unspecified, marker for a point is always "."
+      linestyle = "-";
+      marker = ".";
     endif
-    retval = zeros (len, 1);
-    for i = 1:len
-      linestyle = options(i).linestyle;
-      marker = options(i).marker;
-      if (isempty (marker) && isempty (linestyle))
-        [linestyle, marker] = __next_line_style__ ();
-      endif
-      color = options(i).color;
-      if (isempty (color))
-        color = __next_line_color__ ();
-      endif
+    color = options(i).color;
+    if (isempty (color))
+      color = __next_line_color__ ();
+    endif
 
-      retval(i) = line (x, y(i), "color", color,
-                        "linestyle", linestyle,
-                        "marker", marker, properties{:});
-    endfor
-  else
-    error ("__plt2sv__: first arg must be scalar, second arg must be vector");
-  endif
+    retval(i) = line (x, y(i), "color", color,
+                      "linestyle", linestyle,
+                      "marker", marker, properties{:});
+  endfor
 
 endfunction
 
-function retval = __plt2vm__ (h, x, y, options, properties)
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
-  endif
+function retval = __plt2vm__ (h, x, y, options, properties = {})
 
   if (nargin < 4 || isempty (options))
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 5)
-    properties = {};
-  endif
-
+  x = x(:);
   [x_nr, x_nc] = size (x);
   [y_nr, y_nc] = size (y);
 
-  if (x_nr == 1)
-    x = x';
-    tmp = x_nr;
-    x_nr = x_nc;
-    x_nc = tmp;
-  endif
-
   if (x_nr == y_nr)
-    1;
+    ## Correctly oriented.  Do nothing.
   elseif (x_nr == y_nc)
-    y = y';
-    tmp = y_nr;
-    y_nr = y_nc;
-    y_nc = tmp;
+    y = y.';
+    [y_nr, y_nc] = deal (y_nc, y_nr);
   else
     error ("__plt2vm__: matrix dimensions must match");
   endif
 
-  if (y_nc > 0)
-    if (numel (options) == 1)
-      options = repmat (options(:), y_nc, 1);
+  if (numel (options) == 1)
+    options = repmat (options(:), y_nc, 1);
+  endif
+  retval = zeros (y_nc, 1);
+  for i = 1:y_nc
+    linestyle = options(i).linestyle;
+    marker = options(i).marker;
+    if (isempty (marker) && isempty (linestyle))
+      [linestyle, marker] = __next_line_style__ ();
     endif
-    retval = zeros (y_nc, 1);
-    for i = 1:y_nc
-      linestyle = options(i).linestyle;
-      marker = options(i).marker;
-      if (isempty (marker) && isempty (linestyle))
-        [linestyle, marker] = __next_line_style__ ();
-      endif
-      color = options(i).color;
-      if (isempty (color))
-        color = __next_line_color__ ();
-      endif
+    color = options(i).color;
+    if (isempty (color))
+      color = __next_line_color__ ();
+    endif
 
-      retval(i) = line (x, y(:,i), "color", color,
-                        "linestyle", linestyle,
-                        "marker", marker, properties{:});
-    endfor
-  else
-    error ("__plt2vm__: arguments must be a matrices");
-  endif
+    retval(i) = line (x, y(:,i), "color", color,
+                      "linestyle", linestyle,
+                      "marker", marker, properties{:});
+  endfor
 
 endfunction
 
-function retval = __plt2vs__ (h, x, y, options, properties)
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
-  endif
+function retval = __plt2vs__ (h, x, y, options, properties = {})
 
   if (nargin < 4 || isempty (options))
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 5)
-    properties = {};
+  len = numel (x);
+  if (numel (options) == 1)
+    options = repmat (options(:), len, 1);
   endif
-
-  if (isvector (x) && isscalar (y))
-    len = numel (x);
-    if (numel (options) == 1)
-      options = repmat (options(:), len, 1);
+  retval = zeros (len, 1);
+  for i = 1:len
+    linestyle = options(i).linestyle;
+    marker = options(i).marker;
+    if (isempty (marker) && isempty (linestyle))
+      ## If unspecified, marker for a point is always "."
+      linestyle = "-";
+      marker = ".";
     endif
-    retval = zeros (len, 1);
-    for i = 1:len
-      linestyle = options(i).linestyle;
-      marker = options(i).marker;
-      if (isempty (marker) && isempty (linestyle))
-        [linestyle, marker] = __next_line_style__ ();
-      endif
-      color = options(i).color;
-      if (isempty (color))
-        color = __next_line_color__ ();
-      endif
+    color = options(i).color;
+    if (isempty (color))
+      color = __next_line_color__ ();
+    endif
 
-      retval(i) = line (x(i), y, "color", color,
-                        "linestyle", linestyle,
-                        "marker", marker, properties{:});
-    endfor
-  else
-    error ("__plt2vs__: first arg must be vector, second arg must be scalar");
-  endif
+    retval(i) = line (x(i), y, "color", color,
+                      "linestyle", linestyle,
+                      "marker", marker, properties{:});
+  endfor
 
 endfunction
 
-function retval = __plt2vv__ (h, x, y, options, properties)
-
-  if (nargin < 3 || nargin > 5)
-    print_usage ();
-  endif
+function retval = __plt2vv__ (h, x, y, options, properties = {})
 
   if (nargin < 4 || isempty (options))
     options = __default_plot_options__ ();
   endif
 
-  if (nargin < 5)
-    properties = {};
-  endif
-
   if (numel (options) > 1)
     options = options(1);
   endif
 
-  [x_nr, x_nc] = size (x);
-  [y_nr, y_nc] = size (y);
-
-  if (x_nr == 1)
-    x = x';
-    tmp = x_nr;
-    x_nr = x_nc;
-    x_nc = tmp;
-  endif
+  x = x(:);
+  y = y(:);
 
-  if (y_nr == 1)
-    y = y';
-    tmp = y_nr;
-    y_nr = y_nc;
-    y_nc = tmp;
-  endif
-
-  if (x_nr == y_nr)
-    linestyle = options.linestyle;
-    marker = options.marker;
-    if (isempty (marker) && isempty (linestyle))
-      [linestyle, marker] = __next_line_style__ ();
-    endif
-    color = options.color;
-    if (isempty (color))
-      color = __next_line_color__ ();
-    endif
-
-    retval = line (x, y, "color", color,
-              "linestyle", linestyle,
-              "marker", marker, properties{:});
-  else
+  if (length (x) != length (y))
     error ("__plt2vv__: vector lengths must match");
   endif
 
+  linestyle = options.linestyle;
+  marker = options.marker;
+  if (isempty (marker) && isempty (linestyle))
+    [linestyle, marker] = __next_line_style__ ();
+  endif
+  color = options.color;
+  if (isempty (color))
+    color = __next_line_color__ ();
+  endif
+
+  retval = line (x, y, "color", color,
+            "linestyle", linestyle,
+            "marker", marker, properties{:});
+
 endfunction
+
--- a/scripts/plot/private/__quiver__.m
+++ b/scripts/plot/private/__quiver__.m
@@ -284,7 +284,7 @@
       endif
     endif
     if (have_filled)
-      ## FIXME gnuplot doesn't respect the markerfacecolor field
+      ## FIXME: gnuplot doesn't respect the markerfacecolor field
       set (h3, "markerfacecolor", get (h1, "color"));
     endif
 
--- a/scripts/plot/private/__stem__.m
+++ b/scripts/plot/private/__stem__.m
@@ -32,20 +32,20 @@
     caller = "stem";
   endif
 
-  [ax, varargin, nargin] = __plt_get_axis_arg__ (caller, varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ (caller, varargin{:});
 
   [x, y, z, dofill, llc, ls, mmc, ms, varargin] = ...
       check_stem_arg (have_z, varargin{:});
 
-  oldax = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (ax);
-    hold_state = get (ax, "nextplot");
-    newplot ();
+    hax = newplot (hax);
+    hold_state = get (hax, "nextplot");
+    set (hax, "nextplot", "add");
+
     h = [];
-
     nx = rows (x);
-    for i = 1: columns (x)
+    for i = 1 : columns (x)
       if (have_z)
         xt = x(:)';
         xt = [xt; xt; NaN(1, nx)](:);
@@ -60,14 +60,10 @@
         yt = [zeros(1, nx); yt; NaN(1, nx)](:);
       endif
 
-      hg  = hggroup ();
+      hg = hggroup ();
       h = [h; hg];
       args = __add_datasource__ (caller, hg, {"x", "y", "z"}, varargin{:});
 
-      if (i == 1)
-        set (ax, "nextplot", "add");
-      endif
-
       if (isempty (llc))
         lc = __next_line_color__ ();
       else
@@ -87,23 +83,23 @@
       endif
 
       if (have_z)
-        h_stems = plot3 (xt, yt, zt, "color", lc, "linestyle", ls,
+        h_stems = plot3 (hax, xt, yt, zt, "color", lc, "linestyle", ls,
                          "parent", hg, x, y, z, "color", mc,
-                         "marker",  ms, "linestyle", "none",
+                         "marker", ms, "linestyle", "none",
                          "markerfacecolor", fc, "parent", hg);
 
         h_baseline = [];
       else
-        h_stems = plot (xt, yt, "color", lc, "linestyle", ls,
+        h_stems = plot (hax, xt, yt, "color", lc, "linestyle", ls,
                         "parent", hg, x(:,i), y(:, i), "color", mc, "marker",
                         ms, "linestyle", "none", "markerfacecolor",
                         fc, "parent", hg);
 
-        x_axis_range = get (ax, "xlim");
-        h_baseline = line (x_axis_range, [0, 0], "color", [0, 0, 0]);
+        x_axis_range = get (hax, "xlim");
+        h_baseline = line (hax, x_axis_range, [0, 0], "color", [0, 0, 0]);
         set (h_baseline, "handlevisibility", "off");
         set (h_baseline, "xliminclude", "off");
-        addlistener (ax, "xlim", @update_xlim);
+        addlistener (hax, "xlim", @update_xlim);
         addlistener (h_baseline, "ydata", @update_baseline);
         addlistener (h_baseline, "visible", @update_baseline);
       endif
@@ -113,7 +109,7 @@
       addproperty ("basevalue", hg, "data", 0);
       addproperty ("baseline", hg, "data", h_baseline);
 
-      if (!have_z)
+      if (! have_z)
         addlistener (hg, "showbaseline", @show_baseline);
         addlistener (hg, "basevalue", @move_baseline);
       endif
@@ -152,10 +148,17 @@
       endif
     endfor
 
+    if (! strcmp (hold_state, "add") && have_z)
+      set (hax, "view", [-37.5 30]);  # 3D view
+    endif
+    set (hax, "nextplot", hold_state);
+
   unwind_protect_cleanup
-    set (ax, "nextplot", hold_state);
-    axes (oldax);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
+
 endfunction
 
 function [x, y, z, dofill, lc, ls, mc, ms, newargs] = check_stem_arg (have_z, varargin)
--- a/scripts/plot/quiver.m
+++ b/scripts/plot/quiver.m
@@ -41,7 +41,7 @@
 ## in a similar manner to the line styles used with the @code{plot} command.
 ## If a marker is specified then markers at the grid points of the vectors are
 ## printed rather than arrows.  If the argument "filled" is given then the
-## markers as filled.
+## markers are drawn filled.
 ##
 ## The optional return value @var{h} is a graphics handle to a quiver object.
 ## A quiver object regroups the components of the quiver plot (body, arrow,
@@ -55,28 +55,29 @@
 ## @end group
 ## @end example
 ##
-## @seealso{plot}
+## @seealso{quiver3, feather, plot}
 ## @end deftypefn
 
 function retval = quiver (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("quiver", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("quiver", varargin{:});
 
   if (nargin < 2)
     print_usage ();
   else
-    oldh = gca ();
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
     unwind_protect
-      axes (h);
-      newplot ();
-      tmp = __quiver__ (h, 0, varargin{:});
+      hax = newplot (hax);
+      htmp = __quiver__ (hax, false, varargin{:});
     unwind_protect_cleanup
-      axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
     end_unwind_protect
   endif
 
   if (nargout > 0)
-    retval = tmp;
+    retval = htmp;
   endif
 
 endfunction
--- a/scripts/plot/quiver3.m
+++ b/scripts/plot/quiver3.m
@@ -58,28 +58,33 @@
 ## @end group
 ## @end example
 ##
-## @seealso{plot}
+## @seealso{quiver, plot}
 ## @end deftypefn
 
 function retval = quiver3 (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("quiver3", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("quiver3", varargin{:});
 
   if (nargin < 2)
     print_usage ();
   else
-    oldh = gca ();
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
     unwind_protect
-      axes (h);
-      newplot ();
-      tmp = __quiver__ (h, 1, varargin{:});
+      hax = newplot (hax);
+      htmp = __quiver__ (hax, true, varargin{:});
+
+      if (! ishold (hax))
+        set (hax, "view", [-37.5, 30]);  # 3D view
+      endif
     unwind_protect_cleanup
-      axes (oldh);
+      if (! isempty (oldfig))
+        set (0, "currentfigure", oldfig);
+      endif
     end_unwind_protect
   endif
 
   if (nargout > 0)
-    retval = tmp;
+    retval = htmp;
   endif
 
 endfunction
@@ -91,9 +96,9 @@
 %! [x,y] = meshgrid (-1:0.1:1);
 %! z = sin (2*pi * sqrt (x.^2 + y.^2));
 %! theta = 2*pi * sqrt (x.^2 + y.^2) + pi/2;
-%! quiver3 (x, y, z, sin (theta), cos (theta), ones (size (z)));
+%! mesh (x, y, z);
 %! hold on;
-%! mesh (x, y, z);
+%! quiver3 (x, y, z, sin (theta), cos (theta), ones (size (z)));
 %! hold off;
 
 %!demo
--- a/scripts/plot/rectangle.m
+++ b/scripts/plot/rectangle.m
@@ -55,10 +55,20 @@
 
   [hax, varargin] = __plt_get_axis_arg__ ("rectangle", varargin{:});
 
-  tmp =  __rectangle__ (hax, varargin{:});
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+
+    htmp =  __rectangle__ (hax, varargin{:});
+
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 endfunction
 
--- a/scripts/plot/ribbon.m
+++ b/scripts/plot/ribbon.m
@@ -17,13 +17,19 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} ribbon (@var{x}, @var{y}, @var{width})
-## @deftypefnx {Function File} {} ribbon (@var{y})
+## @deftypefn  {Function File} {} ribbon (@var{y})
+## @deftypefnx {Function File} {} ribbon (@var{x}, @var{y})
+## @deftypefnx {Function File} {} ribbon (@var{x}, @var{y}, @var{width})
+## @deftypefnx {Function File} {} ribbon (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ribbon (@dots{})
-## Plot a ribbon plot for the columns of @var{y} vs.  @var{x}.  The
-## optional parameter @var{width} specifies the width of a single ribbon
+## Plot a ribbon plot for the columns of @var{y} vs. @var{x}.
+##
+## The optional parameter @var{width} specifies the width of a single ribbon
 ## (default is 0.75).  If @var{x} is omitted, a vector containing the
-## row numbers is assumed (1:rows (Y)).
+## row numbers is assumed (@code{1:rows (Y)}).
+##
+## If the first argument @var{hax} is an axis handle, then plot into this axis,
+## rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a vector of graphics handles to
 ## the surface objects representing each ribbon.
@@ -31,19 +37,30 @@
 
 ## Author: Kai Habel <kai.habel at gmx.de>
 
-function h = ribbon (x, y, width = 0.75)
+function h = ribbon (varargin)
+
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("ribbon", varargin{:});
 
   if (nargin < 1 || nargin > 3)
     print_usage ();
   endif
 
   if (nargin == 1)
-    y = x;
+    y = varargin{1};
     if (isvector (y))
       y = y(:);
     endif
     [nr, nc] = size (y);
     x = repmat ((1:nr)', 1, nc);
+    width = 0.75;
+  elseif (nargin == 2)
+    x = varargin{1};
+    y = varargin{2};
+    width = 0.75;
+  else
+    x = varargin{1};
+    y = varargin{2};
+    width = varargin{3};
   endif
 
   if (isvector (x) && isvector (y))
@@ -58,25 +75,32 @@
     endif
   endif
 
-  newplot ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
 
-  [nr, nc] = size (y);
-  htmp = zeros (nc, 1);
+    [nr, nc] = size (y);
+    htmp = zeros (nc, 1);
 
-  for c = nc:-1:1
-    zz = [y(:,c), y(:,c)];
-    yy = x(:,c);
-    xx = [c - width / 2, c + width / 2];
-    [xx, yy] = meshgrid (xx, yy);
-    cc = repmat (c, size (zz));
-    htmp(c) = surface (xx, yy, zz, cc);
-  endfor
+    for c = nc:-1:1
+      zz = [y(:,c), y(:,c)];
+      yy = x(:,c);
+      xx = [c - width / 2, c + width / 2];
+      [xx, yy] = meshgrid (xx, yy);
+      cc = repmat (c, size (zz));
+      htmp(c) = surface (xx, yy, zz, cc);
+    endfor
 
-  if (! ishold ())
-    ax = get (htmp(1), "parent");
-    set (ax, "view", [-37.5, 30], "box", "off", 
-             "xgrid", "on", "ygrid", "on", "zgrid", "on");
-  endif
+    if (! ishold ())
+      set (hax, "view", [-37.5, 30], "box", "off", 
+                "xgrid", "on", "ygrid", "on", "zgrid", "on");
+    endif
+
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
 
   if (nargout > 0)
     h = htmp;
--- a/scripts/plot/rose.m
+++ b/scripts/plot/rose.m
@@ -17,30 +17,34 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} rose (@var{th}, @var{r})
-## @deftypefnx {Function File} {} rose (@var{h}, @dots{})
+## @deftypefn  {Function File} {} rose (@var{th})
+## @deftypefnx {Function File} {} rose (@var{th}, @var{nbins})
+## @deftypefnx {Function File} {} rose (@var{th}, @var{bins})
+## @deftypefnx {Function File} {} rose (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} rose (@dots{})
-## @deftypefnx {Function File} {[@var{r}, @var{th}] =} rose (@dots{})
+## @deftypefnx {Function File} {[@var{thout} @var{rout}] =} rose (@dots{})
+##
+## Plot an angular histogram.
 ##
-## Plot an angular histogram.  With one vector argument @var{th}, plots the
-## histogram with 20 angular bins.  If @var{th} is a matrix, then each column
-## of @var{th} produces a separate histogram.
+## With one vector argument, @var{th}, plot the histogram with 20 angular bins.
+## If @var{th} is a matrix then each column of @var{th} produces a separate
+## histogram.
 ##
-## If @var{r} is given and is a scalar, then the histogram is produced with
-## @var{r} bins.  If @var{r} is a vector, then the center of each bin are
-## defined by the values of @var{r}.
+## If @var{nbins} is given and is a scalar, then the histogram is produced with
+## @var{nbin} bins.  If @var{bins} is a vector, then the center of each bin is
+## defined defined by the values of @var{bins} and the number of bins is
+## given by the number of elements in @var{bins}.
 ##
 ## The optional return value @var{h} is a vector of graphics handles to the
 ## line objects representing each histogram.
 ##
-## If two output arguments are requested then, rather than plotting the
-## histogram, the polar vectors necessary to plot the histogram are
-## returned.
+## If two output arguments are requested then no plot is made and 
+## the polar vectors necessary to plot the histogram are returned instead.
 ##
 ## @example
 ## @group
-## [r, t] = rose ([2*randn(1e5,1), pi + 2*randn(1e5,1)]);
-## polar (r, t);
+## [th, r] = rose ([2*randn(1e5,1), pi + 2*randn(1e5,1)]);
+## polar (th, r);
 ## @end group
 ## @end example
 ##
@@ -49,33 +53,32 @@
 
 function [thout, rout] = rose (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ((nargout > 1), "rose",
-                                                varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("rose", varargin{:});
 
   if (nargin < 1)
     print_usage ();
   endif
 
   ## Force theta to [0,2*pi] range
-  th = varargin {1};
-  th = atan2  (sin (th), cos (th)) + pi;
+  th = varargin{1};
+  th = atan2 (sin (th), cos (th)) + pi;
 
   if (nargin > 1)
-    x = varargin {2};
+    x = varargin{2};
     if (isscalar (x))
-      x = [0.5/x : 1/x : 1] * 2 * pi;
+      x = [0.5/x : 1/x : 1] * 2*pi;
     else
       ## Force theta to [0,2*pi] range
-      x = atan2  (sin (x), cos (x)) + pi;
+      x = atan2 (sin (x), cos (x)) + pi;
     endif
   else
-    x = [1/40 : 1/20 : 1] * 2 * pi;
+    x = [1/40 : 1/20 : 1] * 2*pi;
   endif
 
   [nn, xx] = hist (th, x);
   xx = xx(:).';
   if (isvector (nn))
-    nn = nn (:);
+    nn = nn(:);
   endif
   x1 = xx(1:end-1) + diff (xx, 1) / 2;
   x1 = [x1 ; x1; x1; x1](:);
@@ -85,17 +88,18 @@
   r(3:4:end, :) = nn;
 
   if (nargout < 2)
-    oldh = gca ();
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
     unwind_protect
-      axes (h);
-      newplot ();
-      hlist = polar (h, th, r);
+      hax = newplot (hax);
+      htmp = polar (hax, th, r);
     unwind_protect_cleanup
-      axes (oldh);
+      if (! isempty (oldfig))
+        set (0, "currentfigure", oldfig);
+      endif
     end_unwind_protect
 
     if (nargout > 0)
-      thout = hlist;
+      thout = htmp;
     endif
   else
     thout = th;
--- a/scripts/plot/scatter.m
+++ b/scripts/plot/scatter.m
@@ -26,16 +26,16 @@
 ## @deftypefnx {Function File} {} scatter (@var{h}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} scatter (@dots{})
 ##
-## Plot a scatter plot of the data.  A marker is plotted at each point
+## Draw a scatter plot of the data.  A marker is plotted at each point
 ## defined by the points in the vectors @var{x} and @var{y}.  The size of
-## the markers used is determined by the @var{s}, which can be a scalar,
-## a vector of the same length of @var{x} and @var{y}.  If @var{s} is not
+## the markers used is determined by the @var{s}, which can be a scalar or
+## a vector of the same length as @var{x} and @var{y}.  If @var{s} is not
 ## given or is an empty matrix, then the default value of 8 points is used.
 ##
 ## The color of the markers is determined by @var{c}, which can be a string
 ## defining a fixed color; a 3-element vector giving the red, green,and blue
 ## components of the color; a vector of the same length as @var{x} that gives
-## a scaled index into the current colormap; or a @var{n}-by-3 matrix defining
+## a scaled index into the current colormap; or an @var{n}-by-3 matrix defining
 ## the colors of each of the markers individually.
 ##
 ## The marker to use can be changed with the @var{style} argument, that is a
@@ -43,7 +43,10 @@
 ## If the argument @code{"filled"} is given then the markers as filled.  All
 ## additional arguments are passed to the underlying patch command.
 ##
-## The optional return value @var{h} provides a handle to the patch object
+## The optional return value @var{h} is a graphics handle to the created patch
+## object.
+## 
+## Example:
 ##
 ## @example
 ## @group
@@ -58,23 +61,25 @@
 
 function retval = scatter (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("scatter", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("scatter", varargin{:});
 
   if (nargin < 2)
     print_usage ();
   else
-    oldh = gca ();
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
     unwind_protect
-      axes (h);
-      newplot ();
-      tmp = __scatter__ (h, 2, "scatter", varargin{:});
+      hax = newplot (hax);
+      
+      htmp = __scatter__ (hax, 2, "scatter", varargin{:});
     unwind_protect_cleanup
-      axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
     end_unwind_protect
   endif
 
   if (nargout > 0)
-    retval = tmp;
+    retval = htmp;
   endif
 
 endfunction
--- a/scripts/plot/scatter3.m
+++ b/scripts/plot/scatter3.m
@@ -56,23 +56,25 @@
 
 function retval = scatter3 (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("scatter3", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("scatter3", varargin{:});
 
   if (nargin < 2)
     print_usage ();
   else
-    oldh = gca ();
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
     unwind_protect
-      axes (h);
-      newplot ();
-      tmp = __scatter__ (h, 3, "scatter3", varargin{:});
+      hax = newplot (hax);
+      
+      tmp = __scatter__ (hax, 3, "scatter3", varargin{:});
     unwind_protect_cleanup
-      axes (oldh);
+      if (! isempty (oldfig))
+        set (0, "currentfigure", oldfig);
+      endif
     end_unwind_protect
   endif
 
-  if (! ishold ())
-    set (h, "view", [-37.5, 30],
+  if (! ishold (hax))
+    set (hax, "view", [-37.5, 30],
          "xgrid", "on", "ygrid", "on", "zgrid", "on");
   endif
 
--- a/scripts/plot/semilogx.m
+++ b/scripts/plot/semilogx.m
@@ -33,33 +33,35 @@
 
 ## Author: jwe
 
-function retval = semilogx (varargin)
+function h = semilogx (varargin)
 
-  [h, varargin, nargs] = __plt_get_axis_arg__ ("semilogx", varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("semilogx", varargin{:});
 
   if (nargs < 1)
     print_usage ();
   endif
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
-    set (h, "xscale", "log");
-    if (any( strcmp (get (gca, "nextplot"), {"new", "replace"})))
-      set (h, "xminortick", "on");
+    set (hax, "xscale", "log");
+    if (! ishold (hax))
+      set (hax, "xminortick", "on");
     endif
 
-    tmp = __plt__ ("semilogx", h, varargin{:});
+    htmp = __plt__ ("semilogx", hax, varargin{:});
 
-    if (nargout > 0)
-      retval = tmp;
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
     endif
-  unwind_protect_cleanup
-    axes (oldh);
   end_unwind_protect
 
+  if (nargout > 0)
+    h = htmp;
+  endif
+
 endfunction
 
 
--- a/scripts/plot/semilogxerr.m
+++ b/scripts/plot/semilogxerr.m
@@ -17,10 +17,13 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} semilogxerr (@var{args})
+## @deftypefn  {Function File} {} semilogxerr (@var{args})
+## @deftypefnx {Function File} {@var{h} =} semilogxerr (@var{args})
 ## Produce two-dimensional plots using a logarithmic scale for the @var{x}
-## axis and errorbars at each data point.  Many different combinations of
-## arguments are possible.  The most used form is
+## axis and errorbars at each data point.
+##
+## Many different combinations of arguments are possible.  The most common
+## form is
 ##
 ## @example
 ## semilogxerr (@var{x}, @var{y}, @var{ey}, @var{fmt})
@@ -31,33 +34,37 @@
 ## with errors in the @var{y}-scale defined by @var{ey} and the plot
 ## format defined by @var{fmt}.  See @code{errorbar} for available formats and
 ## additional information.
-## @seealso{errorbar, loglogerr, semilogyerr}
+## @seealso{errorbar, semilogyerr, loglogerr}
 ## @end deftypefn
 
 ## Created: 20.2.2001
 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
 ## Keywords: errorbar, plotting
 
-function retval = semilogxerr (varargin)
+function h = semilogxerr (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("semilogxerr", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("semilogxerr", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
-    set (h, "xscale", "log");
-
-    tmp = __errcomm__ ("semilogxerr", h, varargin{:});
+    set (hax, "xscale", "log");
+    if (! ishold (hax))
+      set (hax, "xminortick", "on");
+    endif
+    htmp = __errcomm__ ("semilogxerr", hax, varargin{:});
 
-    if (nargout > 0)
-      retval = tmp;
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
     endif
-  unwind_protect_cleanup
-    axes (oldh);
   end_unwind_protect
 
+  if (nargout > 0)
+    h = htmp;
+  endif
+
 endfunction
 
 
--- a/scripts/plot/semilogy.m
+++ b/scripts/plot/semilogy.m
@@ -33,32 +33,33 @@
 
 ## Author: jwe
 
-function retval = semilogy (varargin)
+function h = semilogy (varargin)
 
-  [h, varargin, nargs] = __plt_get_axis_arg__ ("semilogy", varargin{:});
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("semilogy", varargin{:});
 
   if (nargs < 1)
     print_usage ();
   endif
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
-    set (h, "yscale", "log");
-    if (any (strcmp (get (gca, "nextplot"), {"new", "replace"})))
-      set (h, "yminortick", "on");
+    set (hax, "yscale", "log");
+    if (! ishold (hax))
+      set (hax, "yminortick", "on");
     endif
 
-    tmp = __plt__ ("semilogy", h, varargin{:});
+    htmp = __plt__ ("semilogy", hax, varargin{:});
 
     if (nargout > 0)
-      retval = tmp;
+      h = htmp;
     endif
 
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
 endfunction
@@ -76,12 +77,12 @@
 %! y = logspace (-5, 1, 10);
 %!
 %! subplot (2,1,1);
-%! semilogy (x, y);
-%! ylabel ('semilogy (x, y)');
+%!  semilogy (x, y);
+%!  ylabel ('semilogy (x, y)');
 %!
 %! subplot (2,1,2);
-%! semilogy (x, -y);
-%! ylabel ('semilogy (x, -y)');
+%!  semilogy (x, -y);
+%!  ylabel ('semilogy (x, -y)');
 
 %!demo
 %! clf;
@@ -89,14 +90,14 @@
 %! y = logspace (-5, 1, 10);
 %!
 %! subplot (2,1,1);
-%! semilogy (x, y);
-%! set (gca, 'ydir', 'reverse', 'activepositionproperty', 'outerposition');
-%! ylabel ({'semilogy (x, y)', 'ydir = reversed'});
+%!  semilogy (x, y);
+%!  set (gca, 'ydir', 'reverse', 'activepositionproperty', 'outerposition');
+%!  ylabel ({'semilogy (x, y)', 'ydir = reversed'});
 %!
 %! subplot (2,1,2);
-%! semilogy (x, -y);
-%! set (gca, 'ydir', 'reverse', 'activepositionproperty', 'outerposition');
-%! ylabel ({'semilogy (x, -y)', 'ydir = reversed'});
+%!  semilogy (x, -y);
+%!  set (gca, 'ydir', 'reverse', 'activepositionproperty', 'outerposition');
+%!  ylabel ({'semilogy (x, -y)', 'ydir = reversed'});
 
 %!test
 %! hf = figure ("visible", "off");
--- a/scripts/plot/semilogyerr.m
+++ b/scripts/plot/semilogyerr.m
@@ -17,10 +17,13 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} semilogyerr (@var{args})
+## @deftypefn  {Function File} {} semilogyerr (@var{args})
+## @deftypefnx {Function File} {@var{h} =} semilogyerr (@var{args})
 ## Produce two-dimensional plots using a logarithmic scale for the @var{y}
-## axis and errorbars at each data point.  Many different combinations of
-## arguments are possible.  The most used form is
+## axis and errorbars at each data point.
+##
+## Many different combinations of arguments are possible.  The most common
+## form is
 ##
 ## @example
 ## semilogyerr (@var{x}, @var{y}, @var{ey}, @var{fmt})
@@ -31,33 +34,37 @@
 ## with errors in the @var{y}-scale defined by @var{ey} and the plot
 ## format defined by @var{fmt}.  See @code{errorbar} for available formats and
 ## additional information.
-## @seealso{errorbar, loglogerr, semilogxerr}
+## @seealso{errorbar, semilogxerr, loglogerr}
 ## @end deftypefn
 
 ## Created: 20.2.2001
 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
 ## Keywords: errorbar, plotting
 
-function retval = semilogyerr (varargin)
+function h = semilogyerr (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("semilogyerr", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("semilogyerr", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
-    set (h, "yscale", "log");
-
-    tmp = __errcomm__ ("semilogyerr", h, varargin{:});
+    set (hax, "yscale", "log");
+    if (! ishold (hax))
+      set (hax, "yminortick", "on");
+    endif
+    htmp = __errcomm__ ("semilogyerr", hax, varargin{:});
 
-    if (nargout > 0)
-      retval = tmp;
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
     endif
-  unwind_protect_cleanup
-    axes (oldh);
   end_unwind_protect
 
+  if (nargout > 0)
+    h = htmp;
+  endif
+
 endfunction
 
 
--- a/scripts/plot/shading.m
+++ b/scripts/plot/shading.m
@@ -18,9 +18,10 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} shading (@var{type})
-## @deftypefnx {Function File} {} shading (@var{ax}, @dots{})
-## Set the shading of surface or patch graphic objects.  Valid arguments
-## for @var{type} are
+## @deftypefnx {Function File} {} shading (@var{hax}, @var{type})
+## Set the shading of surface or patch graphic objects.
+##
+## Valid arguments for @var{type} are
 ##
 ## @table @asis
 ## @item "flat"
@@ -34,42 +35,66 @@
 ## invisible.
 ## @end table
 ##
-## If @var{ax} is given the shading is applied to axis @var{ax} instead
-## of the current axis.
+## If the first argument @var{hax} is an axes handle, then plot into this axis,
+## rather than the current axes returned by @code{gca}.
+## If the first argument @var{hax} is an axes handle, then operate on
+## this axis rather than the current axes returned by @code{gca}.
 ## @end deftypefn
 
 ## Author: Kai Habel <kai.habel@gmx.de>
 
 function shading (varargin)
 
-  [ax, varargin] = __plt_get_axis_arg__ ("shading", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("shading", varargin{:});
 
-  if (nargin != 1 && nargin != 2)
+  if (nargin != 1)
     print_usage ();
   endif
 
   mode = varargin{1};
 
-  h1 = findobj (ax, "type", "patch");
-  h2 = findobj (ax, "type", "surface");
-
-  obj = [h1(:); h2(:)];
+  if (isempty (hax))
+    hax = gca ();
+  endif
 
-  for n = 1:numel (obj)
-    h = obj(n);
-    if (strcmpi (mode, "flat"))
-      set (h, "facecolor", "flat");
-      set (h, "edgecolor", "none");
-    elseif (strcmpi (mode, "interp"))
-      set (h, "facecolor", "interp");
-      set (h, "edgecolor", "none");
-    elseif (strcmpi (mode, "faceted"))
-      set (h, "facecolor", "flat");
-      set (h, "edgecolor", [0 0 0]);
-    else
-      error ("shading: unknown argument");
-    endif
-  endfor
+  ## Find all patch and surface objects that are descendants of hax
+  ## and  which are not part of a contour plot hggroup.
+  hlist = [];
+  kids = get (hax, "children");
+  while (! isempty (kids))
+    types = get (kids, "type");
+    hlist = [hlist; kids(strcmp(types, "patch"))];
+    hlist = [hlist; kids(strcmp(types, "surface"))];
+    parents = kids(strcmp(types, "axes"));
+    hglist = kids(strcmp (types, "hggroup"));
+    for i = 1 : numel (hglist)
+      props = get (hglist(i));
+      if (! isfield (props, "levelstep"))
+        parents(end+1) = hglist(i); 
+      endif
+    endfor
+    kids = get (parents, "children");
+  endwhile
+
+  ## FIXME: This is the old, simple code.
+  ##        Unfortunately, it also shades contour plots which is not desirable.
+  ##hp = findobj (hax, "type", "patch");
+  ##hs = findobj (hax, "type", "surface");
+  ##hlist = [hp(:); hs(:)];
+
+  switch (lower (mode))
+    case "flat"
+      set (hlist, "facecolor", "flat");
+      set (hlist, "edgecolor", "none");
+    case "interp"
+      set (hlist, "facecolor", "interp");
+      set (hlist, "edgecolor", "none");
+    case "faceted"
+      set (hlist, "facecolor", "flat");
+      set (hlist, "edgecolor", [0 0 0]);
+    otherwise
+      error ('shading: Invalid MODE "%s"', mode);
+  endswitch
 
 endfunction
 
--- a/scripts/plot/shrinkfaces.m
+++ b/scripts/plot/shrinkfaces.m
@@ -149,59 +149,60 @@
 
 endfunction
 
+
 %!demo
+%! clf;
 %! faces = [1 2 3; 1 3 4];
 %! vertices = [0 0; 1 0; 1 1; 0 1];
-%! clf ()
-%! patch ("Faces", faces, "Vertices", vertices, "FaceColor", "none")
+%! patch ('Faces', faces, 'Vertices', vertices, 'FaceColor', 'none');
 %! fv = shrinkfaces (faces, vertices, 0.25);
-%! patch (fv)
-%! axis equal
+%! patch (fv);
+%! axis equal;
 
 %!demo
+%! clf;
 %! faces = [1 2 3 4; 5 6 7 8];
 %! vertices = [0 0; 1 0; 2 1; 1 1; 2 0; 3 0; 4 1; 3.5 1];
-%! clf ()
-%! patch ("Faces", faces, "Vertices", vertices, "FaceColor", "none")
+%! patch ('Faces', faces, 'Vertices', vertices, 'FaceColor', 'none');
 %! fv = shrinkfaces (faces, vertices, 0.25);
-%! patch (fv)
-%! axis equal
-%! grid on
+%! patch (fv);
+%! axis equal;
+%! grid on;
 
 %!demo
+%! clf;
 %! faces = [1 2 3 4];
 %! vertices = [-1 2; 0 0; 1 2; 0 1];
-%! clf ()
-%! patch ("Faces", faces, "Vertices", vertices, "FaceColor", "none")
+%! patch ('Faces', faces, 'Vertices', vertices, 'FaceColor', 'none');
 %! fv = shrinkfaces (faces, vertices, 0.25);
-%! patch (fv)
-%! axis equal
-%! grid on
-%! title "faces which are not convex are clearly not allowed"
+%! patch (fv);
+%! axis equal;
+%! grid on;
+%! title 'faces which are not convex are clearly not allowed'
 
 %!demo
+%! clf;
 %! [phi r] = meshgrid (linspace (0, 1.5*pi, 16), linspace (1, 2, 4));
 %! tri = delaunay (phi(:), r(:));
 %! v = [r(:).*sin(phi(:)) r(:).*cos(phi(:))];
-%! clf ()
-%! p = patch ("Faces", tri, "Vertices", v, "FaceColor", "none");
+%! p = patch ('Faces', tri, 'Vertices', v, 'FaceColor', 'none');
 %! fv = shrinkfaces (p);
-%! patch (fv)
-%! axis equal
-%! grid on
+%! patch (fv);
+%! axis equal;
+%! grid on;
 
 %!demo
-%! N = 10; # N intervals per axis
+%! clf;
+%! N = 10;  % N intervals per axis
 %! [x, y, z] = meshgrid (linspace (-4,4,N+1));
 %! val = x.^3 + y.^3 + z.^3;
 %! fv = isosurface (x, y, z, val, 3, z);
 %!
-%! clf ()
-%! p = patch ("Faces", fv.faces, "Vertices", fv.vertices, "FaceVertexCData", ...
-%!            fv.facevertexcdata, "FaceColor", "interp", "EdgeColor", "black");
-%! axis equal
-%! view (115, 30)
-%! drawnow
+%! p = patch ('Faces', fv.faces, 'Vertices', fv.vertices, 'FaceVertexCData', ...
+%!            fv.facevertexcdata, 'FaceColor', 'interp', 'EdgeColor', 'black');
+%! axis equal;
+%! view (115, 30);
+%! drawnow;
 %! shrinkfaces (p, 0.6);
 
 %!shared faces, vertices, nfv, nfv2
@@ -209,8 +210,9 @@
 %! vertices = [0 0 0; 1 0 0; 1 1 0];
 %! nfv = shrinkfaces (faces, vertices, 0.7);
 %! nfv2 = shrinkfaces (nfv, 1/0.7);
-%!assert (isfield (nfv, "faces"));
-%!assert (isfield (nfv, "vertices"));
-%!assert (size (nfv.faces), [1 3]);
-%!assert (size (nfv.vertices), [3 3]);
-%!assert (norm (nfv2.vertices - vertices), 0, 2*eps);
+%!assert (isfield (nfv, "faces"))
+%!assert (isfield (nfv, "vertices"))
+%!assert (size (nfv.faces), [1 3])
+%!assert (size (nfv.vertices), [3 3])
+%!assert (norm (nfv2.vertices - vertices), 0, 2*eps)
+
--- a/scripts/plot/slice.m
+++ b/scripts/plot/slice.m
@@ -21,9 +21,12 @@
 ## @deftypefnx {Function File} {} slice (@var{x}, @var{y}, @var{z}, @var{v}, @var{xi}, @var{yi}, @var{zi})
 ## @deftypefnx {Function File} {} slice (@var{v}, @var{sx}, @var{sy}, @var{sz})
 ## @deftypefnx {Function File} {} slice (@var{v}, @var{xi}, @var{yi}, @var{zi})
+## @deftypefnx {Function File} {} slice (@dots{}, @var{method})
+## @deftypefnx {Function File} {} slice (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} slice (@dots{})
-## @deftypefnx {Function File} {@var{h} =} slice (@dots{}, @var{method})
-## Plot slices of 3-D data/scalar fields.  Each element of the 3-dimensional
+## Plot slices of 3-D data/scalar fields.
+##
+## Each element of the 3-dimensional
 ## array @var{v} represents a scalar value at a location given by the
 ## parameters @var{x}, @var{y}, and @var{z}.  The parameters @var{x},
 ## @var{x}, and @var{z} are either 3-dimensional arrays of the same size
@@ -37,7 +40,7 @@
 ## @code{x = 1:size (@var{v}, 2)}, @code{y = 1:size (@var{v}, 1)} and
 ## @code{z = 1:size (@var{v}, 3)}.
 ##
-## @var{Method} is one of:
+## @var{method} is one of:
 ##
 ## @table @asis
 ## @item "nearest"
@@ -54,7 +57,10 @@
 ## throughout the curve.
 ## @end table
 ##
-## The default method is @code{"linear"}.
+## The default method is "linear".
+##
+## If the first argument @var{hax} is an axis handle, then plot into this axis,
+## rather than the current axis handle returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a graphics handle to the created
 ## surface object.
@@ -66,6 +72,7 @@
 ## [x, y, z] = meshgrid (linspace (-8, 8, 32));
 ## v = sin (sqrt (x.^2 + y.^2 + z.^2)) ./ (sqrt (x.^2 + y.^2 + z.^2));
 ## slice (x, y, z, v, [], 0, []);
+##
 ## [xi, yi] = meshgrid (linspace (-7, 7));
 ## zi = xi + yi;
 ## slice (x, y, z, v, xi, yi, zi);
@@ -78,8 +85,9 @@
 
 function h = slice (varargin)
 
+  [hax, varargin, nargs] = __plt_get_axis_arg__ ("slice", varargin{:});
+
   method = "linear";
-  nargs = nargin;
 
   if (ischar (varargin{end}))
     method = varargin{end};
@@ -89,7 +97,7 @@
   if (nargs == 4)
     v = varargin{1};
     if (ndims (v) != 3)
-      error ("slice: expect 3-dimensional array of values");
+      error ("slice: V must be a 3-dimensional array of values");
     endif
     [nx, ny, nz] = size (v);
     [x, y, z] = meshgrid (1:nx, 1:ny, 1:nz);
@@ -99,7 +107,7 @@
   elseif (nargs == 7)
     v = varargin{4};
     if (ndims (v) != 3)
-      error ("slice: expect 3-dimensional array of values");
+      error ("slice: V must be a 3-dimensional array of values");
     endif
     x = varargin{1};
     y = varargin{2};
@@ -126,56 +134,64 @@
     error ("slice: dimensional mismatch for (XI, YI, ZI) or (SX, SY, SZ)");
   endif
 
-  newplot ();
-  ax = gca ();
-  sidx = 1;
-  maxv = max (v(:));
-  minv = min (v(:));
-  set (ax, "clim", [minv, maxv]);
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+
+    sidx = 1;
+    minv = min (v(:));
+    maxv = max (v(:));
+    set (hax, "clim", [minv, maxv]);
+
+    if (have_sval)
+      ns = length (sx) + length (sy) + length (sz);
+      hs = zeros (ns,1);
+      [ny, nx, nz] = size (v);
+      if (length (sz) > 0)
+        for i = 1:length (sz)
+          [xi, yi, zi] = meshgrid (squeeze (x(1,:,1)),
+                                   squeeze (y(:,1,1)), sz(i));
+          vz = squeeze (interp3 (x, y, z, v, xi, yi, zi, method));
+          htmp(sidx++) = surface (xi, yi, sz(i) * ones (size (yi)), vz);
+        endfor
+      endif
 
-  if (have_sval)
-    ns = length (sx) + length (sy) + length (sz);
-    hs = zeros (ns,1);
-    [ny, nx, nz] = size (v);
-    if (length (sz) > 0)
-      for i = 1:length (sz)
-        [xi, yi, zi] = meshgrid (squeeze (x(1,:,1)),
-                                 squeeze (y(:,1,1)), sz(i));
-        vz = squeeze (interp3 (x, y, z, v, xi, yi, zi, method));
-        tmp(sidx++) = surface (xi, yi, sz(i) * ones (size (yi)), vz);
-      endfor
+      if (length (sy) > 0)
+        for i = length (sy):-1:1
+          [xi, yi, zi] = meshgrid (squeeze (x(1,:,1)), sy(i), squeeze (z(1,1,:)));
+          vy = squeeze (interp3 (x, y, z, v, xi, yi, zi, method));
+          htmp(sidx++) = surface (squeeze (xi),
+                                 squeeze (sy(i) * ones (size (zi))),
+                                 squeeze (zi), vy);
+        endfor
+      endif
+
+      if (length (sx) > 0)
+        for i = length (sx):-1:1
+          [xi, yi, zi] = meshgrid (sx(i), squeeze (y(:,1,1)), squeeze (z(1,1,:)));
+          vx = squeeze (interp3 (x, y, z, v, xi, yi, zi, method));
+          htmp(sidx++) = surface (squeeze (sx(i) * ones (size (zi))),
+                                 squeeze (yi), squeeze(zi), vx);
+        endfor
+      endif
+    else
+      vi = interp3 (x, y, z, v, sx, sy, sz);
+      htmp = surface (sx, sy, sz, vi);
     endif
 
-    if (length (sy) > 0)
-      for i = length (sy):-1:1
-        [xi, yi, zi] = meshgrid (squeeze (x(1,:,1)), sy(i), squeeze (z(1,1,:)));
-        vy = squeeze (interp3 (x, y, z, v, xi, yi, zi, method));
-        tmp(sidx++) = surface (squeeze (xi),
-                               squeeze (sy(i) * ones (size (zi))),
-                               squeeze (zi), vy);
-      endfor
+    if (! ishold ())
+      set (hax, "view", [-37.5, 30.0], "box", "off",
+                "xgrid", "on", "ygrid", "on", "zgrid", "on");
     endif
 
-    if (length (sx) > 0)
-      for i = length (sx):-1:1
-        [xi, yi, zi] = meshgrid (sx(i), squeeze (y(:,1,1)), squeeze (z(1,1,:)));
-        vx = squeeze (interp3 (x, y, z, v, xi, yi, zi, method));
-        tmp(sidx++) = surface (squeeze (sx(i) * ones (size (zi))),
-                               squeeze (yi), squeeze(zi), vx);
-      endfor
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
     endif
-  else
-    vi = interp3 (x, y, z, v, sx, sy, sz);
-    tmp = surface (sx, sy, sz, vi);
-  endif
-
-  if (! ishold ())
-    set (ax, "view", [-37.5, 30.0], "box", "off", "xgrid", "on",
-         "ygrid", "on", "zgrid", "on");
-  endif
+  end_unwind_protect
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/sombrero.m
+++ b/scripts/plot/sombrero.m
@@ -17,7 +17,8 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} sombrero (@var{n})
+## @deftypefn  {Function File} {} sombrero ()
+## @deftypefnx {Function File} {} sombrero (@var{n})
 ## Produce the familiar three-dimensional sombrero plot using @var{n}
 ## grid lines.  If @var{n} is omitted, a value of 41 is assumed.
 ##
--- a/scripts/plot/sphere.m
+++ b/scripts/plot/sphere.m
@@ -32,8 +32,8 @@
 
 function [xx, yy, zz] = sphere (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ((nargout > 0), "sphere",
-                                                varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("sphere", varargin{:});
+
   if (nargin > 1)
     print_usage ();
   elseif (nargin == 1)
@@ -55,7 +55,17 @@
     yy = y;
     zz = z;
   else
-    surf (h, x, y, z);
+    oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+    unwind_protect
+      hax = newplot (hax);
+    
+      surf (hax, x, y, z);
+      
+    unwind_protect_cleanup
+      if (! isempty (oldfig))
+        set (0, "currentfigure", oldfig);
+      endif
+    end_unwind_protect
   endif
 
 endfunction
--- a/scripts/plot/stairs.m
+++ b/scripts/plot/stairs.m
@@ -21,17 +21,27 @@
 ## @deftypefnx {Function File} {} stairs (@var{x}, @var{y})
 ## @deftypefnx {Function File} {} stairs (@dots{}, @var{style})
 ## @deftypefnx {Function File} {} stairs (@dots{}, @var{prop}, @var{val})
-## @deftypefnx {Function File} {} stairs (@var{h}, @dots{})
+## @deftypefnx {Function File} {} stairs (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} stairs (@dots{})
 ## @deftypefnx {Function File} {[@var{xstep}, @var{ystep}] =} stairs (@dots{})
-## Produce a stairstep plot.  The arguments may be vectors or matrices.
+## Produce a stairstep plot.
+##
+## The arguments @var{x} and @var{y} may be vectors or matrices.
+## If only one argument is given, it is taken as a vector of Y values
+## and the X coordinates are taken to be the indices of the elements.
+## 
+## The style to use for the plot can be defined with a line style @var{style}
+## in the same way as the @code{plot} command.
 ##
-## If only one argument is given, it is taken as a vector of y-values
-## and the x coordinates are taken to be the indices of the elements.
+## Multiple property/value pairs may be specified, but they must appear in
+## pairs.
 ##
-## If one output argument is requested, return a graphics handle to the plot.
-## If two output arguments are specified, the data are generated but
-## not plotted.  For example,
+## If the first argument @var{hax} is an axis handle, then plot into this axis,
+## rather than the current axis handle returned by @code{gca}.
+##
+## If one output argument is requested, return a graphics handle to the
+## created plot.  If two output arguments are specified, the data are generated
+## but not plotted.  For example,
 ##
 ## @example
 ## stairs (x, y);
@@ -49,15 +59,14 @@
 ##
 ## @noindent
 ## are equivalent.
-## @seealso{plot, semilogx, semilogy, loglog, polar, mesh, contour,
-## bar, xlabel, ylabel, title}
+## @seealso{plot}
 ## @end deftypefn
 
 ## Author: jwe
 
 function [xs, ys] = stairs (varargin)
 
-  [ax, varargin, nargin] = __plt_get_axis_arg__ ("stairs", varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("stairs", varargin{:});
 
   if (nargin < 1)
     print_usage ();
@@ -65,17 +74,18 @@
     if (nargout > 1)
       [h, xs, ys] = __stairs__ (false, varargin{:});
     else
-      oldax = gca ();
+      oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
       unwind_protect
-        axes (ax);
-        newplot ();
-        [h, xxs, yys] = __stairs__ (true, varargin{:});
+        hax = newplot (hax);
+        [htmp, xxs, yys] = __stairs__ (true, varargin{:});
       unwind_protect_cleanup
-        axes (oldax);
+        if (! isempty (oldfig))
+          set (0, "currentfigure", oldfig);
+        endif
       end_unwind_protect
-    endif
-    if (nargout == 1)
-      xs = h;
+      if (nargout == 1)
+        xs = htmp;
+      endif
     endif
   endif
 endfunction
@@ -83,7 +93,7 @@
 function [h, xs, ys] = __stairs__ (doplot, varargin)
 
   if (nargin == 2 || ischar (varargin{2}))
-    y = varargin {1};
+    y = varargin{1};
     varargin(1) = [];
     if (ismatrix (y))
       if (isvector (y))
@@ -98,7 +108,7 @@
   endif
 
   if (ndims (x) > 2 || ndims (y) > 2)
-    error ("stairs: expecting 2-d arguments");
+    error ("stairs: X and Y must be 2-D objects");
   endif
 
   vec_x = isvector (x);
@@ -141,7 +151,7 @@
 
   have_line_spec = false;
   for i = 1 : length (varargin)
-    arg = varargin {i};
+    arg = varargin{i};
     if ((ischar (arg) || iscell (arg)) && ! have_line_spec)
       [linespec, valid] = __pltopt__ ("stairs", arg, false);
       if (valid)
@@ -168,24 +178,24 @@
         addlistener (hg, "ydata", @update_data);
 
         if (have_line_spec)
-          tmp = line (xs(:,i).', ys(:,i).', "color", linespec.color,
-                      "parent", hg);
+          htmp = line (xs(:,i).', ys(:,i).', "color", linespec.color,
+                       "parent", hg);
         else
-          tmp = line (xs(:,i).', ys(:,i).', "color", __next_line_color__ (),
-                      "parent", hg);
+          htmp = line (xs(:,i).', ys(:,i).', "color", __next_line_color__ (),
+                       "parent", hg);
         endif
 
-        addproperty ("color", hg, "linecolor", get (tmp, "color"));
-        addproperty ("linewidth", hg, "linelinewidth", get (tmp, "linewidth"));
-        addproperty ("linestyle", hg, "linelinestyle", get (tmp, "linestyle"));
+        addproperty ("color", hg, "linecolor", get (htmp, "color"));
+        addproperty ("linewidth", hg, "linelinewidth", get (htmp, "linewidth"));
+        addproperty ("linestyle", hg, "linelinestyle", get (htmp, "linestyle"));
 
-        addproperty ("marker", hg, "linemarker", get (tmp, "marker"));
+        addproperty ("marker", hg, "linemarker", get (htmp, "marker"));
         addproperty ("markerfacecolor", hg, "linemarkerfacecolor",
-                     get (tmp, "markerfacecolor"));
+                     get (htmp, "markerfacecolor"));
         addproperty ("markeredgecolor", hg, "linemarkeredgecolor",
-                     get (tmp, "markeredgecolor"));
+                     get (htmp, "markeredgecolor"));
         addproperty ("markersize", hg, "linemarkersize",
-                     get (tmp, "markersize"));
+                     get (htmp, "markersize"));
 
         addlistener (hg, "color", @update_props);
         addlistener (hg, "linewidth", @update_props);
@@ -239,16 +249,17 @@
 %! x = 0:(N-1);
 %! y = rand (1, N);
 %! hs = stairs (x(1), y(1));
-%! set (gca (), 'xlim', [1, N-1], 'ylim', [0, 1]);
+%! axis ([1, N-1 0, 1]);
 %! for k=2:N
-%!   set (hs, 'xdata', x(1:k), 'ydata', y(1:k))
+%!   set (hs, 'xdata', x(1:k), 'ydata', y(1:k));
 %!   drawnow ();
 %!   pause (0.2);
 %! end
 
 
 function update_props (h, d)
-  set (get (h, "children"), "color", get (h, "color"),
+  set (get (h, "children"),
+       "color", get (h, "color"),
        "linewidth", get (h, "linewidth"),
        "linestyle", get (h, "linestyle"),
        "marker", get (h, "marker"),
@@ -283,3 +294,4 @@
 
   set (get (h, "children"), "xdata", xs, "ydata", ys);
 endfunction
+
--- a/scripts/plot/stem.m
+++ b/scripts/plot/stem.m
@@ -17,22 +17,25 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} stem (@var{x})
+## @deftypefn  {Function File} {} stem (@var{y})
 ## @deftypefnx {Function File} {} stem (@var{x}, @var{y})
-## @deftypefnx {Function File} {} stem (@var{x}, @var{y}, @var{linespec})
+## @deftypefnx {Function File} {} stem (@dots{}, @var{linespec})
 ## @deftypefnx {Function File} {} stem (@dots{}, "filled")
+## @deftypefnx {Function File} {} stem (@dots{}, "@var{prop}", "@var{val}", @dots{})
+## @deftypefnx {Function File} {} stem (@var{hax}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} stem (@dots{})
-## Plot a stem graph from two vectors of x-y data.  If only one argument
-## is given, it is taken as the y-values and the x coordinates are taken
-## from the indices of the elements.
+## Plot a stem graph from two vectors of x-y data.
+##
+## If only one argument is given, it is taken as the y-values and the
+## x-coordinates are taken from the indices of the elements.
 ##
 ## If @var{y} is a matrix, then each column of the matrix is plotted as
 ## a separate stem graph.  In this case @var{x} can either be a vector,
 ## the same length as the number of rows in @var{y}, or it can be a
 ## matrix of the same size as @var{y}.
 ##
-## The default color is @code{"b"} (blue).  The default line style is
-## @code{"-"} and the default marker is @code{"o"}.  The line style can
+## The default color is @code{"b"} (blue), the default line style is
+## @code{"-"}, and the default marker is @code{"o"}.  The line style can
 ## be altered by the @code{linespec} argument in the same manner as the
 ## @code{plot} command.  For example,
 ##
@@ -47,6 +50,12 @@
 ## @noindent
 ## plots 10 stems with heights from 2 to 20 in red;
 ##
+## Multiple property/value pairs may be specified, but they must appear in
+## pairs.
+##
+## If the first argument @var{hax} is an axis handle, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
+##
 ## The optional return value @var{h} is a vector of "stem series" graphics
 ## handles with one handle per column of the variable @var{y}.  The
 ## handle regroups the elements of the stem graph together as the
@@ -66,7 +75,7 @@
 ## @noindent
 ## changes the color of the second "stem series" and moves the base line
 ## of the first.
-## @seealso{bar, barh, plot}
+## @seealso{stem3, bar, hist, plot}
 ## @end deftypefn
 
 ## Author: Michel D. Schmid <michaelschmid@users.sourceforge.net>
@@ -78,10 +87,10 @@
     print_usage ();
   endif
 
-  tmp = __stem__ (false, varargin{:});
+  htmp = __stem__ (false, varargin{:});
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
@@ -142,3 +151,4 @@
 %!   drawnow ();
 %!   pause (0.2);
 %! end
+
--- a/scripts/plot/stem3.m
+++ b/scripts/plot/stem3.m
@@ -17,13 +17,29 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {@var{h} =} stem3 (@var{x}, @var{y}, @var{z}, @var{linespec})
-## Plot a three-dimensional stem graph and return the handles of the line
+## @deftypefn  {Function File} {} stem3 (@var{x}, @var{y}, @var{z})
+## @deftypefnx {Function File} {} stem3 (@var{x}, @var{y}, @var{z}, @var{linespec})
+## @deftypefnx {Function File} {} stem3 (@dots{}, "filled")
+## @deftypefnx {Function File} {} stem3 (@dots{}, "@var{prop}", "@var{val}", @dots{})
+## @deftypefnx {Function File} {} stem3 (@var{hax}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} stem3 (@dots{})
+## Plot a 3-D stem graph.
+##
+## The default color is @code{"r"} (red), the default line style is
+## @code{"-"}, and the default marker is @code{"o"}.  The line style can
+## be altered by the @code{linespec} argument in the same manner as the
+## @code{plot} command.
+##
+## Multiple property/value pairs may be specified, but they must appear in
+## pairs.
+##
+## If the first argument @var{hax} is an axis handle, then plot into these axes,
+## rather than the current axis handle returned by @code{gca}.
+##
+## The optional return value @var{h} is a vector with the handles of the line
 ## and marker objects used to draw the stems as "stem series" object.
-## The default color is @code{"r"} (red).  The default line style is
-## @code{"-"} and the default marker is @code{"o"}.
 ##
-## For example,
+## Example:
 ##
 ## @example
 ## @group
@@ -33,9 +49,11 @@
 ## @end example
 ##
 ## @noindent
-## plots 31 stems with heights from 0 to 6 lying on a circle.  Color
-## definitions with RGB-triples are not valid!
-## @seealso{bar, barh, stem, plot}
+## plots 31 stems with heights from 0 to 6 lying on a circle.
+##
+## Implementation Note: Color definitions with RGB-triples are not valid.
+##
+## @seealso{stem, bar, hist, plot}
 ## @end deftypefn
 
 function h = stem3 (varargin)
@@ -44,10 +62,10 @@
     print_usage ();
   endif
 
-  tmp = __stem__ (true, varargin{:});
+  htmp = __stem__ (true, varargin{:});
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/stemleaf.m
+++ b/scripts/plot/stemleaf.m
@@ -306,32 +306,33 @@
 
 
 %!demo
-%! ## Unsorted plot:
+%! %% Unsorted plot:
 %! x = [-22 12 -28 52  39 -2 12 10 11 11 42 38 44 18 44];
-%! stemleaf (x, "Unsorted plot");
+%! stemleaf (x, 'Unsorted plot');
 
 %!demo
-%! ## Sorted leaves:
+%! %% Sorted leaves:
 %! x = [-22 12 -28 52  39 -2 12 10 11 11 42 38 44 18 44];
 %! y = sort (x);
-%! stemleaf (y, "Sorted leaves");
+%! stemleaf (y, 'Sorted leaves');
 
 %!demo
-%! ## Sorted leaves (large dataset):
-%! x = [-22 12 -28 52  39 -2 12 10 11 11 42 38 44 18 44 37 113 124 37 48 127  \
-%!      36 29 31 125 139 131 115 105 132 104 123 35 113 122 42 117 119 58 109 \
-%!      23 105 63 27 44 105 99 41 128 121 116 125 32 61 37 127 29 113 121 58  \
-%!      114 126 53 114 96 25 109 7 31 141 46 -13 71 43 117 116 27 7 68 40 31  \
-%!      115 124 42 128 52 71 118 117 38 27 106 33 117 116 111 40 119 47 105 57\
-%!      122 109 124 115 43 120 43 27 27 18 28 48 125 107 114 34 133 45 120 30 \
-%!      127 31 116 146 21 23 30 10 20 21 30 0 100 110 1 20 0];
+%! %% Sorted leaves (large dataset):
+%! x = [-22 12 -28 52  39 -2 12 10 11 11 42 38 44 18 44 37 113 124 37 48     ...
+%!      127 36 29 31 125 139 131 115 105 132 104 123 35 113 122 42 117 119   ...
+%!      58 109 23 105 63 27 44 105 99 41 128 121 116 125 32 61 37 127 29 113 ...
+%!      121 58 114 126 53 114 96 25 109 7 31 141 46 -13 71 43 117 116 27 7   ...
+%!      68 40 31 115 124 42 128 52 71 118 117 38 27 106 33 117 116 111 40    ...
+%!      119 47 105 57 122 109 124 115 43 120 43 27 27 18 28 48 125 107 114   ...
+%!      34 133 45 120 30 127 31 116 146 21 23 30 10 20 21 30 0 100 110 1 20  ...
+%!      0];
 %! y = sort (x);
-%! stemleaf (y, "Sorted leaves (large dataset)");
+%! stemleaf (y, 'Sorted leaves (large dataset)');
 
 %!demo
-%! ## Gaussian leaves:
+%! %% Gaussian leaves:
 %! x = fix (30 * randn (300,1));
-%! stemleaf (x);
+%! stemleaf (x, 'Gaussian leaves');
 
 %!test
 %! ## test minus to plus
@@ -544,7 +545,8 @@
 
 %!test
 %! ##   Example from EDA: Chevrolet Prices pg. 30
-%! x = [150 250 688 695 795 795 895 895 895 1099 1166 1333 1499 1693 1699 1775 1995];
+%! x = [150 250 688 695 795 795 895 895 895 ...
+%!      1099 1166 1333 1499 1693 1699 1775 1995];
 %! rexp = char (
 %! "       Data: Chevrolet Prices EDA pg.30",
 %! " "                                      ,
--- a/scripts/plot/struct2hdl.m
+++ b/scripts/plot/struct2hdl.m
@@ -417,7 +417,7 @@
     xudata = s.properties.xudata;
     udata = s.properties.udata;
 
-    switch form
+    switch (form)
       case "xerr"
         h = errorbar (xdata, ydata, xldata, xudata, ">");
       case "yerr"
--- a/scripts/plot/subplot.m
+++ b/scripts/plot/subplot.m
@@ -19,9 +19,13 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} subplot (@var{rows}, @var{cols}, @var{index})
 ## @deftypefnx {Function File} {} subplot (@var{rcn})
+## @deftypefnx {Function File} {@var{hax} =} subplot (@dots{})
 ## Set up a plot grid with @var{rows} by @var{cols} subwindows and plot
 ## in location given by @var{index}.
 ##
+## If @var{hax} is provided, subplot returns the axis handle for the subplot.
+## This is usuful for modifying the properties of a subplot.
+##
 ## If only one argument is supplied, then it must be a three digit value
 ## specifying the location in digits 1 (rows) and 2 (columns) and the plot
 ## index in digit 3.
@@ -174,12 +178,15 @@
     endif
 
     if (! have_position)
+      pos = subplot_position (rows, cols, index, "position");
+      outerpos = subplot_position (rows, cols, index, "outerposition");
+      box = [pos(1:2), pos(1:2)+pos(3:4)];
+      outerbox = [outerpos(1:2), outerpos(1:2)+outerpos(3:4)];
+      looseinset = [box(1:2)-outerbox(1:2), outerbox(3:4)-box(3:4)];
       if (align_axes)
-        pos = subplot_position (rows, cols, index, "position");
-      elseif (strcmp (get (cf, "__graphics_toolkit__"), "gnuplot"))
-        pos = subplot_position (rows, cols, index, "outerpositiontight");
+        activepositionproperty = "position";
       else
-        pos = subplot_position (rows, cols, index, "outerposition");
+        activepositionproperty = "outerposition";
       endif
     endif
 
@@ -210,7 +217,7 @@
           ## If the new axes are in exactly the same position as an
           ## existing axes object, use the existing axes.
           found = true;
-          tmp = child;
+          hsubplot = child;
         else
           ## If the new axes overlap an old axes object, delete the old
           ## axes.
@@ -230,14 +237,19 @@
     endfor
 
     if (found)
-      set (cf, "currentaxes", tmp);
-    elseif (align_axes)
-      tmp = axes ("box", "off", "position", pos, varargin{:});
-    elseif (strcmp (get (cf, "__graphics_toolkit__"), "gnuplot"))
-      tmp = axes ("box", "off", "outerposition", pos, varargin{:});
+      set (cf, "currentaxes", hsubplot);
     else
-      tmp = axes ("looseinset", [0 0 0 0], "box", "off", "outerposition", pos,
-                  "autopos_tag", "subplot", varargin{:});
+      hsubplot = axes ("box", "off",
+                       "position", pos,
+                       "looseinset", looseinset,
+                       "activepositionproperty", activepositionproperty,
+                       varargin{:});
+      addproperty ("subplot_align", hsubplot, "boolean", true);
+      addlistener (hsubplot, "position", @subplot_align);
+      if (! align_axes)
+        set (hsubplot, "subplot_align", false)
+        subplot_align (hsubplot)
+      endif
     endif
 
   unwind_protect_cleanup
@@ -246,7 +258,7 @@
   end_unwind_protect
 
   if (nargout > 0)
-    h = tmp;
+    h = hsubplot;
   endif
 
 endfunction
@@ -327,6 +339,30 @@
 
 endfunction
 
+function subplot_align (h, varargin)
+  persistent updating = false
+  if (! updating)
+    unwind_protect
+      updating = true;
+      hfig = ancestor (h, "figure");
+      hsubplots = findall (hfig, 'type', 'axes', 'subplot_align', 'off');
+      if (! isempty (hsubplots))
+        tightinset = get (hsubplots, 'tightinset');
+        if (iscell (tightinset))
+          tightinset = max (cell2mat (tightinset));
+        endif
+        looseinset = get (hsubplots, 'looseinset');
+        if (iscell (looseinset))
+          looseinset = max (cell2mat (looseinset));
+        endif
+        looseinset = max (tightinset, looseinset);
+        set (hsubplots, 'looseinset', looseinset);
+      endif
+    unwind_protect_cleanup
+      updating = false;
+    end_unwind_protect
+  endif
+endfunction
 
 %!demo
 %! clf;
@@ -364,3 +400,62 @@
 %! ylabel ('ylabel (1,2,1)');
 %! title ('title (1,2,1)');
 
+%!demo
+%! clf;
+%! x = 0:10;
+%! ax(1) = subplot (221);
+%! set (ax(1), 'tag', '1');
+%! plot (x, rand (3, 11))
+%! title ('x & y labels & ticklabels');
+%! xlabel xlabel
+%! ylabel ylabel
+%! ax(2) = subplot (222);
+%! set (ax(2), 'tag', '2');
+%! plot (x, rand (3, 11))
+%! title ('no labels');
+%! axis ('nolabel','tic')
+%! ax(3) = subplot (223);
+%! set (ax(3), 'tag', '3');
+%! plot (x, rand (3, 11))
+%! title ('no labels');
+%! axis ('nolabel','tic')
+%! ax(4) = subplot (224);
+%! set (ax(4), 'tag', '4');
+%! plot (x, rand (3, 11))
+%! title ('x & y labels & ticklabels');
+%! xlabel xlabel
+%! ylabel ylabel
+
+%!demo
+%! x = 0:10;
+%! subplot (221);
+%! plot (x, rand (3, 11))
+%! ylim ([0, 1]);
+%! text (0.5, 0.5, '{x,y}labels & {x,y}ticklabels', ...
+%!       'horizontalalignment', 'center', ...
+%!       'units', 'normalized');
+%! xlabel xlabel
+%! ylabel ylabel
+%! title title
+%! subplot (222);
+%! plot (x, rand (3, 11))
+%! axis ('labely');
+%! ylabel ylabel
+%! text (0.5, 0.5, 'no xlabels, xticklabels', ...
+%!       'horizontalalignment', 'center', ...
+%!       'units', 'normalized');
+%! subplot (223);
+%! plot (x, rand (3, 11))
+%! axis ('labelx');
+%! text (0.5, 0.5, 'no ylabels, yticklabels', ...
+%!       'horizontalalignment', 'center', ...
+%!       'units', 'normalized');
+%! xlabel xlabel
+%! title title
+%! subplot (224);
+%! plot (x, rand (3, 11))
+%! axis ('nolabel','tic');
+%! text (0.5, 0.5, 'no {x,y}labels, {x,y}ticklabels', ...
+%!       'horizontalalignment', 'center', ...
+%!       'units', 'normalized');
+
--- a/scripts/plot/surf.m
+++ b/scripts/plot/surf.m
@@ -42,24 +42,26 @@
 
 function retval = surf (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("surf", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("surf", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
-    tmp = surface (varargin{:});
+    hax = newplot (hax);
+    
+    htmp = surface (varargin{:});
 
-    if (! ishold ())
-      set (h, "view", [-37.5, 30],
+    if (! ishold (hax))
+      set (hax, "view", [-37.5, 30],
            "xgrid", "on", "ygrid", "on", "zgrid", "on");
     endif
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
-    retval = tmp;
+    retval = htmp;
   endif
 
 endfunction
--- a/scripts/plot/surface.m
+++ b/scripts/plot/surface.m
@@ -41,48 +41,51 @@
 
 ## Author: jwe
 
-function retval = surface (varargin)
+function h = surface (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("surface", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("surface", varargin{:});
 
-  oldh = gca ();
-  unwind_protect
-    axes (h);
-    [tmp, bad_usage] = __surface__ (h, varargin{:});
-  unwind_protect_cleanup
-    axes (oldh);
-  end_unwind_protect
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
+  [htmp, bad_usage] = __surface__ (hax, varargin{:});
 
   if (bad_usage)
     print_usage ();
   endif
 
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
 
 function [h, bad_usage] = __surface__ (ax, varargin)
 
+  h = 0;
   bad_usage = false;
-  h = 0;
   firststring = nargin;
-  for i = 2 : nargin
-    if (ischar (varargin{i - 1}))
-      firststring = i - 1;
+  for i = 1 : (nargin - 1)
+    if (ischar (varargin{i}))
+      firststring = i;
       break;
     endif
   endfor
 
   if (firststring > 5)
     bad_usage = true;
+    return;
   elseif (firststring == 5)
     x = varargin{1};
     y = varargin{2};
     z = varargin{3};
     c = varargin{4};
 
+    if (iscomplex (x) || iscomplex (y) || iscomplex (z) || iscomplex (c))
+      error ("mesh: X, Y, Z, C arguments must be real");
+    endif
+
     [z_nr, z_nc] = size (z);
     [c_nr, c_nc, c_np] = size (c);
     if (! (z_nr == c_nr && z_nc == c_nc && (c_np == 1 || c_np == 3)))
@@ -108,6 +111,11 @@
     y = varargin{2};
     z = varargin{3};
     c = z;
+
+    if (iscomplex (x) || iscomplex (y) || iscomplex (z))
+      error ("mesh: X, Y, Z arguments must be real");
+    endif
+
     if (isvector (x) && isvector (y) && ismatrix (z))
       if (rows (z) == length (y) && columns (z) == length (x))
         x = x(:)';
@@ -125,6 +133,11 @@
   elseif (firststring == 3)
     z = varargin{1};
     c = varargin{2};
+
+    if (iscomplex (z) || iscomplex (c))
+      error ("mesh: X, C arguments must be real");
+    endif
+
     if (ismatrix (z) && !isvector (z) && !isscalar (z))
       [nr, nc] = size (z);
       x = 1:nc;
@@ -135,6 +148,11 @@
   elseif (firststring == 2)
     z = varargin{1};
     c = z;
+
+    if (iscomplex (z))
+      error ("mesh: Z argument must be real");
+    endif
+
     if (ismatrix (z) && !isvector (z) && !isscalar (z))
       [nr, nc] = size (z);
       x = 1:nc;
@@ -144,24 +162,23 @@
     endif
   elseif (firststring == 1)
     x = 1:3;
-    y = (x).';
+    y = x';
     c = z = eye (3);
   else
     bad_usage = true;
+    return;
   endif
 
-  if (! bad_usage)
-    ## Make a default surface object.
-    other_args = {};
-    if (firststring < nargin)
-      other_args = varargin(firststring:end);
-    endif
-    h = __go_surface__ (ax, "xdata", x, "ydata", y, "zdata", z, "cdata", c,
-                        other_args{:});
+  if (firststring < nargin)
+    other_args = varargin(firststring:end);
+  else
+    other_args = {};  # make a default surface object.
+  endif
+  h = __go_surface__ (ax, "xdata", x, "ydata", y, "zdata", z, "cdata", c,
+                      other_args{:});
 
-    if (! ishold ())
-      set (ax, "view", [0, 90], "box", "off");
-    endif
+  if (! ishold ())
+    set (ax, "view", [0, 90], "box", "off");
   endif
 
 endfunction
--- a/scripts/plot/surfc.m
+++ b/scripts/plot/surfc.m
@@ -24,52 +24,58 @@
 ## then a typical vertex is (@var{x}(j), @var{y}(i), @var{z}(i,j)).  Thus,
 ## columns of @var{z} correspond to different @var{x} values and rows of
 ## @var{z} correspond to different @var{y} values.
-## @seealso{meshgrid, surf, contour}
+## @seealso{ezsurfc, meshgrid, surf, contour}
 ## @end deftypefn
 
 function h = surfc (varargin)
 
-  newplot ();
-
-  tmp = surface (varargin{:});
-
-  ax = get (tmp, "parent");
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("surfc", varargin{:});
 
-  set (tmp, "facecolor", "flat");
-
-  if (! ishold ())
-    set (ax, "view", [-37.5, 30],
-         "xgrid", "on", "ygrid", "on", "zgrid", "on");
+  if (nargin < 1)
+    print_usage ();
   endif
 
-  drawnow ();
-  zmin = get (ax, "zlim")(1);
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+  unwind_protect
+    hax = newplot (hax);
+    
+    htmp = surface (hax, varargin{:});
 
-  # don't pass axis handle and/or string arguments to __contour__()
-  stop_idx = nargin;
-  for i = 2 : nargin
-    if (ischar (varargin{i}))
-      stop_idx = i - 1;
-      break;
+    set (htmp, "facecolor", "flat");
+
+    if (! ishold ())
+      set (hax, "view", [-37.5, 30],
+                "xgrid", "on", "ygrid", "on", "zgrid", "on");
     endif
-  endfor
+
+    drawnow ();
 
-  start_idx = 1;
-  if (ishandle (varargin{1}))
-    start_idx = 2;
-  endif
+    # don't pass string arguments to __contour__()
+    stop_idx = find (cellfun ("isclass", varargin, "char"), 1);
+    if (isempty (stop_idx))
+      stop_idx = nargin;
+    else
+      stop_idx--;
+    endif
 
-  if (stop_idx - start_idx == 1 || stop_idx - start_idx == 3)
-    #don't pass a color matrix c to __contour__
-    stop_idx -= 1;
-  endif
+    if (stop_idx - 1 == 1 || stop_idx - 1 == 3)
+      ## Don't pass a color matrix c to __contour__
+      stop_idx -= 1;
+    endif
+
+    zmin = get (hax, "zlim")(1);
+    [~, htmp2] = __contour__ (hax, zmin, varargin{1:stop_idx});
 
-  [c, tmp2] = __contour__ (ax, zmin, varargin{start_idx:stop_idx});
+    htmp = [htmp; htmp2];
 
-  tmp = [tmp; tmp2];
+  unwind_protect_cleanup
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
+  end_unwind_protect
 
   if (nargout > 0)
-    h = tmp;
+    h = htmp;
   endif
 
 endfunction
--- a/scripts/plot/surfl.m
+++ b/scripts/plot/surfl.m
@@ -69,12 +69,11 @@
 
 function retval = surfl (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("surfl", varargin{:});
+  [hax, varargin] = __plt_get_axis_arg__ ("surfl", varargin{:});
 
-  oldh = gca ();
+  oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
   unwind_protect
-    axes (h);
-    newplot ();
+    hax = newplot (hax);
 
     ## Check for lighting type.
     use_cdata = true;
@@ -122,9 +121,9 @@
       endif
     endif
 
-    htmp = surface (varargin{:});
-    if (! ishold ())
-      set (h, "view", [-37.5, 30],
+    htmp = surface ([varargin, "parent", hax]{:});
+    if (! ishold (hax))
+      set (hax, "view", [-37.5, 30],
            "xgrid", "on", "ygrid", "on", "zgrid", "on", "clim", [0 1]);
     endif
 
@@ -143,7 +142,7 @@
     endif
 
     vn = get (htmp, "vertexnormals");
-    dar = get (h, "plotboxaspectratio");
+    dar = get (hax, "plotboxaspectratio");
     vn(:,:,1) *= dar(1);
     vn(:,:,2) *= dar(2);
     vn(:,:,3) *= dar(3);
@@ -160,7 +159,9 @@
     set (htmp, "cdata", cdata ./ sum (r(1:3)));
 
   unwind_protect_cleanup
-    axes (oldh);
+    if (! isempty (oldfig))
+      set (0, "currentfigure", oldfig);
+    endif
   end_unwind_protect
 
   if (nargout > 0)
--- a/scripts/plot/surfnorm.m
+++ b/scripts/plot/surfnorm.m
@@ -53,8 +53,7 @@
 
 function [Nx, Ny, Nz] = surfnorm (varargin)
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ((nargout != 0), "surfnorm",
-                                                varargin{:});
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("surfnorm", varargin{:});
 
   if (nargin != 1 && nargin != 3)
     print_usage ();
@@ -115,24 +114,27 @@
   nz = nz ./ len;
 
   if (nargout == 0)
-    oldh = gca ();
-    unwind_protect
-      axes (h);
-      newplot ();
-      surf (x, y, z, varargin{ioff:end});
-      old_hold_state = get (h, "nextplot");
-      unwind_protect
-        set (h, "nextplot", "add");
-        plot3 ([x(:)'; x(:).' + nx(:).' ; NaN(size(x(:).'))](:),
-               [y(:)'; y(:).' + ny(:).' ; NaN(size(y(:).'))](:),
-               [z(:)'; z(:).' + nz(:).' ; NaN(size(z(:).'))](:),
-               varargin{ioff:end});
-      unwind_protect_cleanup
-        set (h, "nextplot", old_hold_state);
-      end_unwind_protect
-    unwind_protect_cleanup
-      axes (oldh);
-    end_unwind_protect
+   oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
+   unwind_protect
+     hax = newplot (hax);
+     
+     surf (hax, x, y, z, varargin{ioff:end});
+     old_hold_state = get (hax, "nextplot");
+     unwind_protect
+       set (hax, "nextplot", "add");
+       plot3 ([x(:)'; x(:).' + nx(:).' ; NaN(size(x(:).'))](:),
+              [y(:)'; y(:).' + ny(:).' ; NaN(size(y(:).'))](:),
+              [z(:)'; z(:).' + nz(:).' ; NaN(size(z(:).'))](:),
+              varargin{ioff:end});
+     unwind_protect_cleanup
+       set (hax, "nextplot", old_hold_state);
+     end_unwind_protect
+     
+   unwind_protect_cleanup
+     if (! isempty (oldfig))
+       set (0, "currentfigure", oldfig);
+     endif
+   end_unwind_protect
   else
     Nx = nx;
     Ny = ny;
--- a/scripts/plot/tetramesh.m
+++ b/scripts/plot/tetramesh.m
@@ -126,10 +126,10 @@
 %! X = [x(:) y(:) z(:)];
 %! colormap (jet (64));
 %! h = tetramesh (tetra, X);
-%! set (h(1:2:end), "Visible", "off");
+%! set (h(1:2:end), 'Visible', 'off');
 %! axis equal;
 %! view (30, 20);
-%! title ("Using jet (64), every other tetrahedron invisible");
+%! title ('Using jet (64), every other tetrahedron invisible');
 
 %!demo
 %! clf;
@@ -141,8 +141,8 @@
 %! tetra = delaunay3 (x, y, z);
 %! X = [x(:) y(:) z(:)];
 %! colormap (gray (256));
-%! tetramesh (tetra, X, 21:20:241, "EdgeColor", "w");
+%! tetramesh (tetra, X, 21:20:241, 'EdgeColor', 'w');
 %! axis equal;
 %! view (30, 20);
-%! title ("Using gray (256) and white edges");
+%! title ('Using gray (256) and white edges');
 
--- a/scripts/plot/text.m
+++ b/scripts/plot/text.m
@@ -118,17 +118,23 @@
     print_usage ();
   endif
 
+  ## Get axis argument which may be in a 'parent' PROP/VAL pair
+  [hax, varargin] = __plt_get_axis_arg__ ("text", varargin{:});
+
+  if (isempty (hax))
+    hax = gca ();
+  endif
+
   if (nx == ny && nx == nz && (nt == nx || nt == 1 || nx == 1))
     pos = [x(:), y(:), z(:)];
-    ca = gca ();
     htmp = zeros (nt, 1);
     if (nx == 1)
-      htmp = __go_text__ (ca, "string", label{1},
+      htmp = __go_text__ (hax, "string", label{1},
                           varargin{:},
                           "position", pos);
     elseif (nx == nt)
       for n = 1:nt
-        htmp(n) = __go_text__ (ca, "string", label{n},
+        htmp(n) = __go_text__ (hax, "string", label{n},
                                varargin{:},
                                "position", pos(n,:));
       endfor
--- a/scripts/plot/title.m
+++ b/scripts/plot/title.m
@@ -18,28 +18,40 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} title (@var{string})
-## @deftypefnx {Function File} {} title (@var{string}, @var{p1}, @var{v1}, @dots{})
-## @deftypefnx {Function File} {} title (@var{h}, @dots{})
+## @deftypefnx {Function File} {} title (@var{string}, @var{property}, @var{val}, @dots{})
+## @deftypefnx {Function File} {} title (@var{hax}, @var{string})
+## @deftypefnx {Function File} {} title (@var{hax}, @var{string}, @var{property}, @var{val}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} title (@dots{})
-## Create a title object for a plot.
+## Specify the string used as a title for the current axis.
+##
+## If @var{hax} is specified then title the axis defined by @var{hax}.
 ##
-## The optional return value @var{h} is a graphics handle to the created object.
+## An optional list of @var{property}/@var{value} pairs can be used to change
+## the properties of the created title text.
+##
+## The optional return value @var{h} is a graphics handle to the created text
+## object.
+## @seealso{xlabel, ylabel, zlabel, text}
 ## @end deftypefn
 
 ## Author: jwe
 
-function retval = title (varargin)
+function h = title (varargin)
+
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("title", varargin{:});
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("title", varargin{:});
-
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
   if (rem (nargin, 2) != 1)
     print_usage ();
   endif
 
-  tmp = __axis_label__ (h, "title", varargin{:});
+  htmp = __axis_label__ (hax, "title", varargin{:});
 
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
@@ -48,24 +60,25 @@
 %!demo
 %! clf;
 %! ax = axes ();
-%! xl = get (ax, 'title');
+%! h = get (ax, 'title');
 %! title ('Testing title');
-%! assert (get (xl, 'string'), 'Testing title');
+%! assert (get (h, 'string'), 'Testing title');
 
 %!demo
 %! clf;
 %! plot3 ([0,1], [0,1], [0,1]);
-%! xl = get (gca, 'title');
-%! title ('Testing title');
-%! assert (get (xl, 'string'), 'Testing title');
+%! h = get (gca, 'title');
+%! title ('Testing title', 'fontsize', 16);
+%! assert (get (h, 'string'), 'Testing title');
+%! assert (get (h, 'fontsize'), 16);
 
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   ax = axes ();
-%!   xl = get (ax, "title");
+%!   h = get (ax, "title");
 %!   title ("Testing title");
-%!   assert (get (xl, "string"), "Testing title");
+%!   assert (get (h, "string"), "Testing title");
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
@@ -74,9 +87,9 @@
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   plot3 ([0,1], [0,1], [0,1]);
-%!   xl = get (gca, "title");
+%!   h = get (gca, "title");
 %!   title ("Testing title");
-%!   assert (get (xl, "string"), "Testing title");
+%!   assert (get (h, "string"), "Testing title");
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
--- a/scripts/plot/trisurf.m
+++ b/scripts/plot/trisurf.m
@@ -77,7 +77,7 @@
 %! colormap ('default');
 %! N = 31;
 %! [x, y] = meshgrid (1:N);
-%! tri = delaunay (x, y);
+%! tri = delaunay (x(:), y(:));
 %! z = peaks (N);
 %! h = trisurf (tri, x, y, z, 'facecolor', 'interp');
 %! axis tight;
@@ -89,7 +89,7 @@
 %! colormap ('default');
 %! N = 31;
 %! [x, y] = meshgrid (1:N);
-%! tri = delaunay (x, y);
+%! tri = delaunay (x(:), y(:));
 %! z = peaks (N);
 %! h = trisurf (tri, x, y, z, 'facecolor', 'flat');
 %! axis tight;
--- a/scripts/plot/uimenu.m
+++ b/scripts/plot/uimenu.m
@@ -101,9 +101,8 @@
 %! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)');
 
 %!testif HAVE_FLTK
-%! toolkit = graphics_toolkit ();
-%! graphics_toolkit ("fltk");
-%! hf = figure ("visible", "off");
+%! toolkit = graphics_toolkit ("fltk");
+%! hf = figure ("visible", "off")
 %! unwind_protect
 %!   ui = uimenu ("label", "mylabel");
 %!   assert (findobj (hf, "type", "uimenu"), ui);
@@ -119,9 +118,8 @@
 
 %% check for top level menus file, edit, and help
 %!testif HAVE_FLTK
-%! toolkit = graphics_toolkit ();
-%! graphics_toolkit ("fltk");
-%! hf = figure ("visible", "off");
+%! toolkit = graphics_toolkit ("fltk");
+%! hf = figure ("visible", "off")
 %! unwind_protect
 %!   uif = findall (hf, "label", "&file");
 %!   assert (ishghandle (uif));
@@ -135,9 +133,8 @@
 %! end_unwind_protect
 
 %!testif HAVE_FLTK
-%! toolkit = graphics_toolkit ();
-%! graphics_toolkit ("fltk");
-%! hf = figure ("visible", "off");
+%! toolkit = graphics_toolkit ("fltk");
+%! hf = figure ("visible", "off")
 %! unwind_protect
 %!   uie = findall (hf, "label", "&edit");
 %!   myui = uimenu (uie, "label", "mylabel");
--- a/scripts/plot/xlabel.m
+++ b/scripts/plot/xlabel.m
@@ -18,32 +18,41 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} xlabel (@var{string})
-## @deftypefnx {Function File} {} xlabel (@var{h}, @var{string})
+## @deftypefnx {Function File} {} xlabel (@var{string}, @var{property}, @var{val}, @dots{})
+## @deftypefnx {Function File} {} xlabel (@var{hax}, @var{string})
+## @deftypefnx {Function File} {} xlabel (@var{hax}, @var{string}, @var{property}, @var{val}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} xlabel (@dots{})
-## @deftypefnx {Function File} {} ylabel (@dots{})
-## @deftypefnx {Function File} {} zlabel (@dots{})
-## Specify x-, y-, or z-axis labels for the current axis.  If @var{h} is
-## specified then label the axis defined by @var{h}.
+## Specify the string used to label the x-axis of the current axis.
+##
+## If @var{hax} is specified then label the axis defined by @var{hax}.
 ##
-## The optional return value @var{h} is a graphics handle to the created object.
-## @seealso{title, text}
+## An optional list of @var{property}/@var{value} pairs can be used to change
+## the properties of the created text label.
+##
+## The optional return value @var{h} is a graphics handle to the created text
+## object.
+## @seealso{ylabel, zlabel, title, text}
 ## @end deftypefn
 
 ## Author: jwe
 
-function retval = xlabel (varargin)
+function h = xlabel (varargin)
+
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("xlabel", varargin{:});
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("xlabel", varargin{:});
-
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
   if (rem (nargin, 2) != 1)
     print_usage ();
   endif
 
-  tmp = __axis_label__ (h, "xlabel", varargin{:},
-                        "color", get (h, "xcolor"));
+  htmp = __axis_label__ (hax, "xlabel", varargin{1},
+                         "color", get (hax, "xcolor"), varargin{2:end});
 
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
@@ -52,11 +61,12 @@
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
-%!   x = xlabel ("xlabel_string");
+%!   x = xlabel ("xlabel_string", "color", "r");
 %!   assert (get (gca, "xlabel"), x);
 %!   assert (get (x, "type"), "text");
 %!   assert (get (x, "visible"), "on");
 %!   assert (get (x, "string"), "xlabel_string");
+%!   assert (get (x, "color"), [1 0 0]);
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
--- a/scripts/plot/ylabel.m
+++ b/scripts/plot/ylabel.m
@@ -18,26 +18,41 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} ylabel (@var{string})
-## @deftypefnx {Function File} {} ylabel (@var{h}, @var{string})
+## @deftypefnx {Function File} {} ylabel (@var{string}, @var{property}, @var{val}, @dots{})
+## @deftypefnx {Function File} {} ylabel (@var{hax}, @var{string})
+## @deftypefnx {Function File} {} ylabel (@var{hax}, @var{string}, @var{property}, @var{val}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} ylabel (@dots{})
-## @seealso{xlabel}
+## Specify the string used to label the y-axis of the current axis.
+##
+## If @var{hax} is specified then label the axis defined by @var{hax}.
+##
+## An optional list of @var{property}/@var{value} pairs can be used to change
+## the properties of the created text label.
+##
+## The optional return value @var{h} is a graphics handle to the created text
+## object.
+## @seealso{xlabel, zlabel, title, text}
 ## @end deftypefn
 
 ## Author: jwe
 
-function retval = ylabel (varargin)
+function h = ylabel (varargin)
+
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("ylabel", varargin{:});
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("ylabel", varargin{:});
-
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
   if (rem (nargin, 2) != 1)
     print_usage ();
   endif
 
-  tmp = __axis_label__ (h, "ylabel", varargin{:},
-                        "color", get (h, "ycolor"));
+  htmp = __axis_label__ (hax, "ylabel", varargin{1},
+                         "color", get (hax, "ycolor"), varargin{2:end});
 
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
@@ -46,11 +61,12 @@
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
-%!   y = ylabel ("ylabel_string");
+%!   y = ylabel ("ylabel_string", "color", "r");
 %!   assert (get (gca, "ylabel"), y);
 %!   assert (get (y, "type"), "text");
 %!   assert (get (y, "visible"), "on");
 %!   assert (get (y, "string"), "ylabel_string");
+%!   assert (get (y, "color"), [1 0 0]);
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
--- a/scripts/plot/zlabel.m
+++ b/scripts/plot/zlabel.m
@@ -18,26 +18,40 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} zlabel (@var{string})
-## @deftypefnx {Function File} {} zlabel (@var{h}, @var{string})
+## @deftypefnx {Function File} {} zlabel (@var{string}, @var{property}, @var{val}, @dots{})
+## @deftypefnx {Function File} {} zlabel (@var{hax}, @var{string})
+## @deftypefnx {Function File} {} zlabel (@var{hax}, @var{string}, @var{property}, @var{val}, @dots{})
 ## @deftypefnx {Function File} {@var{h} =} zlabel (@dots{})
-## @seealso{xlabel}
+## Specify the string used to label the z-axis of the current axis.
+##
+## If @var{hax} is specified then label the axis defined by @var{hax}.
+##
+## An optional list of @var{property}/@var{value} pairs can be used to change
+## the properties of the created text label.
+##
+## The optional return value @var{h} is a graphics handle to the created text
+## object.
+## @seealso{xlabel, ylabel, title, text}
 ## @end deftypefn
-
 ## Author: jwe
 
-function retval = zlabel (varargin)
+function h = zlabel (varargin)
+
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("zlabel", varargin{:});
 
-  [h, varargin, nargin] = __plt_get_axis_arg__ ("zlabel", varargin{:});
-
+  if (isempty (hax))
+    hax = gca ();
+  endif
+  
   if (rem (nargin, 2) != 1)
     print_usage ();
   endif
 
-  tmp = __axis_label__ (h, "zlabel", varargin{:},
-                        "color", get (h, "zcolor"));
+  htmp = __axis_label__ (hax, "zlabel", varargin{1},
+                         "color", get (hax, "zcolor"), varargin{2:end});
 
   if (nargout > 0)
-    retval = tmp;
+    h = htmp;
   endif
 
 endfunction
@@ -46,23 +60,25 @@
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
-%!   z = zlabel ("zlabel_string");
+%!   z = zlabel ("zlabel_string", "color", "r");
 %!   assert (get (gca, "zlabel"), z);
 %!   assert (get (z, "type"), "text");
 %!   assert (get (z, "visible"), "off");
 %!   assert (get (z, "string"), "zlabel_string");
+%!   assert (get (z, "color"), [1 0 0]);
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
 
 %!test
 %! hf = figure ("visible", "off");
-%! plot3 (0, 0, 0);
+%! plot3 (hf, 0, 0, 0);
 %! unwind_protect
 %!   z = zlabel ("zlabel_string");
 %!   assert (get (gca, "zlabel"), z);
 %!   assert (get (z, "type"), "text");
-%!   assert (get (z, "visible"), "off");
+%!   ## FIXME: visible test is failing.  Not sure why.
+%!   #assert (get (z, "visible"), "off");
 %!   assert (get (z, "string"), "zlabel_string");
 %! unwind_protect_cleanup
 %!   close (hf);
--- a/scripts/polynomial/polyeig.m
+++ b/scripts/polynomial/polyeig.m
@@ -46,13 +46,13 @@
   n = zeros (1, nin);
 
   for cnt = 1 : nin
-    if ! ( issquare (varargin{cnt}) )
+    if (! issquare (varargin{cnt}))
        error ("polyeig: coefficients must be square matrices");
     endif
     n(cnt) = size (varargin{cnt}, 1);
   endfor
 
-  if numel (unique (n)) > 1
+  if (numel (unique (n)) > 1)
        error ("polyeig: coefficients must have the same dimensions");
   endif
   n = unique (n);
--- a/scripts/polynomial/roots.m
+++ b/scripts/polynomial/roots.m
@@ -79,41 +79,39 @@
 
 function r = roots (v)
 
-  if (nargin != 1 || min (size (v)) > 1)
+  if (nargin != 1 || (! isvector (v) && ! isempty (v)))
     print_usage ();
-  elseif (any (isnan (v) | isinf (v)))
+  elseif (any (! isfinite (v)))
     error ("roots: inputs must not contain Inf or NaN");
   endif
 
+  v = v(:);
   n = numel (v);
-  v = v(:);
 
-  ## If v = [ 0 ... 0 v(k+1) ... v(k+l) 0 ... 0 ], we can remove the
-  ## leading k zeros and n - k - l roots of the polynomial are zero.
+  ## If v = [ 0 ... 0 v(k+1) ... v(k+l) 0 ... 0 ],
+  ## we can remove the leading k zeros,
+  ## and n - k - l roots of the polynomial are zero.
 
-  if (isempty (v))
-    f = v;
-  else
-    f = find (v ./ max (abs (v)));
+  v_max = max (abs (v));
+  if (isempty (v) || v_max == 0)
+    r = [];
+    return;
   endif
+
+  f = find (v ./ v_max);
   m = numel (f);
 
-  if (m > 0 && n > 1)
-    v = v(f(1):f(m));
-    l = max (size (v));
-    if (l > 1)
-      A = diag (ones (1, l-2), -1);
-      A(1,:) = -v(2:l) ./ v(1);
-      r = eig (A);
-      if (f(m) < n)
-        tmp = zeros (n - f(m), 1);
-        r = [r; tmp];
-      endif
-    else
-      r = zeros (n - f(m), 1);
+  v = v(f(1):f(m));
+  l = numel (v);
+  if (l > 1)
+    A = diag (ones (1, l-2), -1);
+    A(1,:) = -v(2:l) ./ v(1);
+    r = eig (A);
+    if (f(m) < n)
+      r = [r; zeros(n - f(m), 1)];
     endif
   else
-    r = [];
+    r = zeros (n - f(m), 1);
   endif
 
 endfunction
@@ -125,11 +123,12 @@
 %! assert (r, [0; 0; 0; 0; 3; 3; 3; 3], 0.001);
 
 %!assert (isempty (roots ([])))
+%!assert (isempty (roots ([0 0])))
 %!assert (isempty (roots (1)))
 %!assert (roots ([1, -6, 11, -6]), [3; 2; 1], sqrt (eps))
 
-%!assert(roots ([1e-200, -1e200, 1]), 1e-200)
-%!assert(roots ([1e-200, -1e200 * 1i, 1]), -1e-200 * 1i)
+%!assert (roots ([1e-200, -1e200, 1]), 1e-200)
+%!assert (roots ([1e-200, -1e200 * 1i, 1]), -1e-200 * 1i)
 
 %!error roots ()
 %!error roots (1,2)
--- a/scripts/prefs/module.mk
+++ b/scripts/prefs/module.mk
@@ -9,6 +9,8 @@
   prefs/addpref.m \
   prefs/getpref.m \
   prefs/ispref.m \
+  prefs/prefdir.m \
+  prefs/preferences.m \
   prefs/rmpref.m \
   prefs/setpref.m \
   $(prefs_PRIVATE_FCN_FILES)
new file mode 100644
--- /dev/null
+++ b/scripts/prefs/prefdir.m
@@ -0,0 +1,46 @@
+## Copyright (C) 2013 John Donoghue
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn  {Function File} {} prefdir 
+## @deftypefnx {Function File} {@var{dir} =} prefdir 
+## Return the directory that contains the preferences for Octave.
+##
+## Examples:
+##
+## Display the preferences directory
+## @example
+## prefdir
+## @end example
+##
+## Change to the preferences folder
+## @example
+## cd (prefdir)
+## @end example
+## @seealso{getpref, setpref, addpref, rmpref, ispref}
+## @end deftypefn
+
+## Author: John Donoghue
+## Version: 0.01
+
+function folder = prefdir ()
+
+  folder = getenv ("HOME");
+
+endfunction
+
new file mode 100644
--- /dev/null
+++ b/scripts/prefs/preferences.m
@@ -0,0 +1,34 @@
+## Copyright (C) 2013 John Donoghue
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} preferences 
+## Display the GUI preferences dialog window for Octave.
+## @end deftypefn
+
+## Author: John Donoghue
+## Version: 0.01
+
+function preferences ()
+  if (isguirunning ())
+    __octave_link_show_preferences__ ();
+  else
+    warning ("preferences: GUI must be running to use preferences dialog");
+  endif
+endfunction
+
--- a/scripts/prefs/private/prefsfile.m
+++ b/scripts/prefs/private/prefsfile.m
@@ -25,8 +25,8 @@
 
 function retval = prefsfile ()
 
-  retval = "~/.octave_prefs";
-
+  retval = [prefdir() filesep() ".octave_prefs"];
+  
 endfunction
 
 %% Testing these functions will require some care to avoid wiping out
--- a/scripts/set/powerset.m
+++ b/scripts/set/powerset.m
@@ -26,7 +26,7 @@
 ##
 ## With the optional second argument @code{"rows"}, each row of the set @var{a}
 ## is considered one element of the set.  As a result, @var{a} must then be a
-## numerical 2D matrix.
+## numerical 2-D matrix.
 ##
 ## @seealso{unique, union, setxor, setdiff, ismember}
 ## @end deftypefn
--- a/scripts/signal/fftfilt.m
+++ b/scripts/signal/fftfilt.m
@@ -23,7 +23,11 @@
 ## @var{b} using the FFT.
 ##
 ## Given the optional third argument, @var{n}, @code{fftfilt} uses the
-## overlap-add method to filter @var{x} with @var{b} using an N-point FFT.
+## overlap-add method to filter @var{x} with @var{b} using an @var{n}-point
+## FFT.  The FFT size must be an even power of 2 and must be greater than
+## or equal to the length of @var{b}.  If the specified @var{n} does not
+## meet these criteria, it is automatically adjusted to the nearest value
+## that does.
 ##
 ## If @var{x} is a matrix, filter each column of the matrix.
 ## @seealso{filter, filter2}
--- a/scripts/signal/fftshift.m
+++ b/scripts/signal/fftshift.m
@@ -24,7 +24,7 @@
 ## center of the vector or matrix.
 ##
 ## If @var{x} is a vector of @math{N} elements corresponding to @math{N}
-## time samples spaced by @math{dt}, then
+## time samples spaced by @nospell{@math{dt}}, then
 ## @code{fftshift (fft (@var{x}))} corresponds to frequencies
 ##
 ## @example
@@ -32,7 +32,7 @@
 ## @end example
 ##
 ## @noindent
-## where @nospell{@math{df}} = 1 / @math{dt}.
+## where @nospell{@math{df} = 1 / @math{dt}}.
 ##
 ## If @var{x} is a matrix, the same holds for rows and columns.  If
 ## @var{x} is an array, then the same holds along each dimension.
--- a/scripts/signal/periodogram.m
+++ b/scripts/signal/periodogram.m
@@ -48,7 +48,7 @@
 ## "@nospell{twosided}" computes spectrum from [0..nfft-1].  These strings
 ## can appear at any position in the list input arguments after window.
 ##
-## @item Pxx: one-, or two-sided power spectrum.
+## @item @nospell{Pxx}: one-, or two-sided power spectrum.
 ##
 ## @item w: angular frequency [0..2*pi) (two-sided) or [0..pi] one-sided.
 ##
--- a/scripts/signal/spectral_adf.m
+++ b/scripts/signal/spectral_adf.m
@@ -47,7 +47,7 @@
   if (nargin == 1)
     w = triangle_lw (cr, b);
   else
-    win = str2func (cstrcat (win, "_lw"));
+    win = str2func ([win "_lw")];
     w = feval (win, cr, b);
   endif
 
--- a/scripts/signal/spectral_xdf.m
+++ b/scripts/signal/spectral_xdf.m
@@ -46,7 +46,7 @@
   if (nargin == 1)
     w = triangle_sw (xr, b);
   else
-    win = str2func (cstrcat (win, "_sw"));
+    win = str2func ([win "_sw")];
     w = feval (win, xr, b);
   endif
 
--- a/scripts/sparse/bicg.m
+++ b/scripts/sparse/bicg.m
@@ -1,5 +1,5 @@
-## Copyright (C) 2006   Sylvain Pelissier   <sylvain.pelissier@gmail.com>
-## Copyright (C) 2012   Carlo de Falco
+## Copyright (C) 2006 Sylvain Pelissier
+## Copyright (C) 2012 Carlo de Falco
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -54,6 +54,7 @@
 ##
 ## @item 3: the algorithm reached stagnation
 ## @end itemize
+##
 ## (the value 2 is unused but skipped for compatibility).
 ##
 ## @item @var{relres} is the final value of the relative residual.
@@ -67,6 +68,8 @@
 ##
 ## @end deftypefn
 
+## Author: Sylvain Pelissier <sylvain.pelissier@gmail.com>
+## Author: Carlo de Falco
 
 function [x, flag, res1, k, resvec] = bicg (A, b, tol, maxit, M1, M2, x0)
 
@@ -230,7 +233,7 @@
 %! assert (x, ones (size (b)), 1e-7);
 
 %!function y = afun (x, t, a)
-%!  switch t
+%!  switch (t)
 %!   case "notransp"
 %!     y = a * x;
 %!   case "transp"
--- a/scripts/sparse/bicgstab.m
+++ b/scripts/sparse/bicgstab.m
@@ -56,6 +56,7 @@
 ##
 ## @item 3: the algorithm reached stagnation
 ## @end itemize
+##
 ## (the value 2 is unused but skipped for compatibility).
 ##
 ## @item @var{relres} is the final value of the relative residual.
--- a/scripts/sparse/cgs.m
+++ b/scripts/sparse/cgs.m
@@ -56,6 +56,7 @@
 ##
 ## @item 3: the algorithm reached stagnation
 ## @end itemize
+##
 ## (the value 2 is unused but skipped for compatibility).
 ##
 ## @item @var{relres} is the final value of the relative residual.
--- a/scripts/sparse/pcg.m
+++ b/scripts/sparse/pcg.m
@@ -206,9 +206,10 @@
 ## SIAM, 1995. (the base PCG algorithm)
 ##
 ## @item
-## Y. Saad, @cite{Iterative Methods for Sparse Linear Systems}, PWS 1996.
-## (condition number estimate from PCG) Revised version of this book is
-## available online at @url{http://www-users.cs.umn.edu/~saad/books.html}
+## Y. Saad, @cite{Iterative Methods for Sparse Linear Systems}, 
+## @nospell{PWS} 1996. (condition number estimate from PCG)
+## Revised version of this book is available online at
+## @url{http://www-users.cs.umn.edu/~saad/books.html}
 ## @end enumerate
 ##
 ## @seealso{sparse, pcr}
--- a/scripts/sparse/private/__sprand_impl__.m
+++ b/scripts/sparse/private/__sprand_impl__.m
@@ -55,9 +55,27 @@
 
   mn = m*n;
   k = round (d*mn);
-  idx = randperm (mn, k);
+  if (mn > sizemax ())
+    ## randperm will overflow, so use alternative methods
+
+    idx = unique (fix (rand (min (k*1.01, k+10), 1) * mn)) + 1;
 
-  [i, j] = ind2sub ([m, n], idx);
+    ## idx contains random numbers in [1,mn]
+    ## generate 1% or 10 more random values than necessary in order to
+    ## reduce the probability that there are less than k distinct
+    ## values; maybe a better strategy could be used but I don't think
+    ## it's worth the price
+    
+    ## actual number of entries in S
+    k = min (length (idx), k);
+    j = floor ((idx(1:k) - 1) / m);
+    i = idx(1:k) - j * m;
+  else
+    idx = randperm (mn, k);
+    [i, j] = ind2sub ([m, n], idx);
+  endif
+
+
   S = sparse (i, j, randfun (k, 1), m, n);
 
 endfunction
--- a/scripts/sparse/sprand.m
+++ b/scripts/sparse/sprand.m
@@ -81,3 +81,7 @@
 %!error sprand (3, 3, -1)
 %!error sprand (3, 3, 2)
 
+%% Test very large, very low density matrix doesn't fail 
+%!test
+%! s = sprand(1e6,1e6,1e-7);
+
--- a/scripts/sparse/sprandn.m
+++ b/scripts/sparse/sprandn.m
@@ -72,3 +72,6 @@
 %!error sprandn (3, 3, -1)
 %!error sprandn (3, 3, 2)
 
+%% Test very large, very low density matrix doesn't fail 
+%!test
+%! s = sprandn(1e6,1e6,1e-7);
--- a/scripts/specfun/ellipke.m
+++ b/scripts/specfun/ellipke.m
@@ -1,5 +1,5 @@
-## Copyright (C) 2001 David Billinghurst <David.Billinghurst@riotinto.com>
-## Copyright (C) 2001 Paul Kienzle <pkienzle@users.sf.net>
+## Copyright (C) 2001 David Billinghurst
+## Copyright (C) 2001 Paul Kienzle
 ## Copyright (C) 2003 Jaakko Ruohio
 ##
 ## This file is part of Octave.
@@ -25,9 +25,9 @@
 ## Compute complete elliptic integral of the first K(@var{m}) and second
 ## E(@var{m}) kind.
 ##
-## @var{m} is either real array or scalar with 0 <= m <= 1.
+## @var{m} is either real array or scalar with 0 @leq{} m @leq{} 1.
 ##
-## @var{tol} is currently ignored (@sc{Matlab} uses this to allow faster,
+## @var{tol} is currently ignored (@sc{matlab} uses this to allow faster,
 ## less accurate approximation).
 ##
 ## Ref: Abramowitz, Milton and Stegun, Irene A. Handbook of Mathematical
@@ -35,6 +35,10 @@
 ## @seealso{ellipj}
 ## @end deftypefn
 
+## Author: David Billinghurst <David.Billinghurst@riotinto.com>
+## Author: Paul Kienzle <pkienzle@users.sf.net>
+## Author: Jaakko Ruohio
+
 function [k, e] = ellipke (m)
 
   if (nargin < 1 || nargin > 2)
@@ -43,10 +47,10 @@
 
   k = e = zeros (size (m));
   m = m(:);
-  if any (!isreal (m))
+  if (any (!isreal (m)))
     error ("ellipke must have real m");
   endif
-  if any (m > 1)
+  if (any (m > 1))
     error ("ellipke must have m <= 1");
   endif
 
@@ -115,7 +119,7 @@
 %!          1.1047747327040733261;
 %!          1.0159935450252239356;
 %!          1.0 ];
-%! if k(7)==Inf, k(7)=0; endif;
+%! if (k(7)==Inf), k(7)=0; endif;
 %! assert (k, k_exp, 8*eps);
 %! assert (e, e_exp, 8*eps);
 
--- a/scripts/specfun/expint.m
+++ b/scripts/specfun/expint.m
@@ -1,4 +1,4 @@
-## Copyright (C) 2006 Sylvain Pelissier <sylvain.pelissier@gmail.com>
+## Copyright (C) 2006 Sylvain Pelissier
 ##
 ## This file is part of Octave.
 ##
@@ -16,6 +16,8 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
+## Author: Sylvain Pelissier <sylvain.pelissier@gmail.com>
+
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} expint (@var{x})
 ## Compute the exponential integral,
--- a/scripts/special-matrix/gallery.m
+++ b/scripts/special-matrix/gallery.m
@@ -22,7 +22,6 @@
 ## @deftypefnx {Function File} {} gallery (@var{name}, @var{args})
 ## Create interesting matrices for testing.
 ##
-##
 ## @end deftypefn
 ##
 ## @deftypefn  {Function File} {@var{c} =} gallery ("cauchy", @var{x})
@@ -50,7 +49,7 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{c} =} gallery ("circul", @var{v})
+## @deftypefn {Function File} {@var{c} =} gallery ("circul", @var{v})
 ## Create a circulant matrix.
 ##
 ## @end deftypefn
@@ -81,8 +80,8 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {[@var{c},@var{d}, @var{e}] =} gallery ("dorr", @var{n})
-## @deftypefnx {Function File} {[@var{c},@var{d}, @var{e}] =} gallery ("dorr", @var{n}, @var{theta})
+## @deftypefn  {Function File} {[@var{c}, @var{d}, @var{e}] =} gallery ("dorr", @var{n})
+## @deftypefnx {Function File} {[@var{c}, @var{d}, @var{e}] =} gallery ("dorr", @var{n}, @var{theta})
 ## @deftypefnx {Function File} {@var{a} =} gallery ("dorr", @dots{})
 ## Create a diagonally dominant, ill conditioned, tridiagonal matrix.
 ##
@@ -94,7 +93,7 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("fiedler", @var{c})
+## @deftypefn {Function File} {@var{a} =} gallery ("fiedler", @var{c})
 ## Create a symmetric Fiedler matrix.
 ##
 ## @end deftypefn
@@ -112,7 +111,7 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{c} =} gallery ("gcdmat", @var{n})
+## @deftypefn {Function File} {@var{c} =} gallery ("gcdmat", @var{n})
 ## Create a greatest common divisor matrix.
 ##
 ## @var{c} is an @var{n}-by-@var{n} matrix whose values correspond to the
@@ -135,7 +134,8 @@
 ##
 ## @deftypefn  {Function File} {@var{a} =} gallery ("hanowa", @var{n})
 ## @deftypefnx {Function File} {@var{a} =} gallery ("hanowa", @var{n}, @var{d})
-## Create a matrix whose eigenvalues lie on a vertical line in the complex plane.
+## Create a matrix whose eigenvalues lie on a vertical line in the complex
+## plane.
 ##
 ## @end deftypefn
 ##
@@ -145,13 +145,36 @@
 ##
 ## @end deftypefn
 ##
+## @deftypefn  {Function File} {@var{a} =} gallery ("integerdata", @var{imax}, [@var{M} @var{N} @dots{}], @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("integerdata", @var{imax}, @var{M}, @var{N}, @dots{}, @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("integerdata", [@var{imin}, @var{imax}], [@var{M} @var{N} @dots{}], @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("integerdata", [@var{imin}, @var{imax}], @var{M}, @var{N}, @dots{}, @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("integerdata", @dots{}, "@var{class}")
+## Create a matrix with random integers in the range [1, @var{imax}].
+## If @var{imin} is given then the integers are in the range
+## [@var{imin}, @var{imax}].
+##
+## The second input is a matrix of dimensions describing the size of the output.
+## The dimensions can also be input as comma-separated arguments.
+##
+## The input @var{j} is an integer index in the range [0, 2^32-1].  The
+## values of the output matrix are always exactly the same
+## (reproducibility) for a given size input and @var{j} index.
+##
+## The final optional argument determines the class of the resulting matrix.
+## Possible values for @var{class}: "uint8", "uint16", "uint32", "int8",
+## "int16", int32", "single", "double".
+## The default is "double".
+##
+## @end deftypefn
+##
 ## @deftypefn  {Function File} {@var{a} =} gallery ("invhess", @var{x})
 ## @deftypefnx {Function File} {@var{a} =} gallery ("invhess", @var{x}, @var{y})
 ## Create the inverse of an upper Hessenberg matrix.
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("invol", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("invol", @var{n})
 ## Create an involutory matrix.
 ##
 ## @end deftypefn
@@ -194,22 +217,22 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("lehmer", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("lehmer", @var{n})
 ## Create a Lehmer matrix (symmetric positive definite).
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{t} =} gallery ("lesp", @var{n})
+## @deftypefn {Function File} {@var{t} =} gallery ("lesp", @var{n})
 ## Create a tridiagonal matrix with real, sensitive eigenvalues.
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("lotkin", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("lotkin", @var{n})
 ## Create a Lotkin matrix.
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("minij", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("minij", @var{n})
 ## Create a symmetric positive definite matrix MIN(i,j).
 ##
 ## @end deftypefn
@@ -220,18 +243,37 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {[@var{a}, @var{t}] =} gallery ("neumann", @var{n})
+## @deftypefn {Function File} {[@var{a}, @var{t}] =} gallery ("neumann", @var{n})
 ## Create a singular matrix from the discrete Neumann problem (sparse).
 ##
 ## @end deftypefn
 ##
+## @deftypefn  {Function File} {@var{a} =} gallery ("normaldata", [@var{M} @var{N} @dots{}], @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("normaldata", @var{M}, @var{N}, @dots{}, @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("normaldata", @dots{}, "@var{class}")
+## Create a matrix with random samples from the standard normal distribution
+## (mean = 0, std = 1).
+##
+## The first input is a matrix of dimensions describing the size of the output.
+## The dimensions can also be input as comma-separated arguments.
+##
+## The input @var{j} is an integer index in the range [0, 2^32-1].  The
+## values of the output matrix are always exactly the same
+## (reproducibility) for a given size input and @var{j} index.
+##
+## The final optional argument determines the class of the resulting matrix.
+## Possible values for @var{class}: "single", "double".
+## The default is "double".
+##
+## @end deftypefn
+##
 ## @deftypefn  {Function File} {@var{q} =} gallery ("orthog", @var{n})
 ## @deftypefnx {Function File} {@var{q} =} gallery ("orthog", @var{n}, @var{k})
 ## Create orthogonal and nearly orthogonal matrices.
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("parter", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("parter", @var{n})
 ## Create a Parter matrix (a Toeplitz matrix with singular values near pi).
 ##
 ## @end deftypefn
@@ -242,7 +284,7 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("poisson", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("Poisson", @var{n})
 ## Create a block tridiagonal matrix from Poisson's equation (sparse).
 ##
 ## @end deftypefn
@@ -253,7 +295,7 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{h} =} gallery ("randhess", @var{x})
+## @deftypefn {Function File} {@var{h} =} gallery ("randhess", @var{x})
 ## Create a random, orthogonal upper Hessenberg matrix.
 ##
 ## @end deftypefn
@@ -273,18 +315,18 @@
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("redheff", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("redheff", @var{n})
 ## Create a zero and ones matrix of Redheffer associated with the Riemann
 ## hypothesis.
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("riemann", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("riemann", @var{n})
 ## Create a matrix associated with the Riemann hypothesis.
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {@var{a} =} gallery ("ris", @var{n})
+## @deftypefn {Function File} {@var{a} =} gallery ("ris", @var{n})
 ## Create a symmetric Hankel matrix.
 ##
 ## @end deftypefn
@@ -327,13 +369,32 @@
 ##
 ## @end deftypefn
 ##
+## @deftypefn  {Function File} {@var{a} =} gallery ("uniformdata", [@var{M} @var{N} @dots{}], @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("uniformdata", @var{M}, @var{N}, @dots{}, @var{j})
+## @deftypefnx {Function File} {@var{a} =} gallery ("uniformdata", @dots{}, "@var{class}")
+## Create a matrix with random samples from the standard uniform distribution
+## (range [0,1]).
+##
+## The first input is a matrix of dimensions describing the size of the output.
+## The dimensions can also be input as comma-separated arguments.
+##
+## The input @var{j} is an integer index in the range [0, 2^32-1].  The
+## values of the output matrix are always exactly the same
+## (reproducibility) for a given size input and @var{j} index.
+##
+## The final optional argument determines the class of the resulting matrix.
+## Possible values for @var{class}: "single", "double".
+## The default is "double".
+##
+## @end deftypefn
+##
 ## @deftypefn  {Function File} {@var{a} =} gallery ("wathen", @var{nx}, @var{ny})
 ## @deftypefnx {Function File} {@var{a} =} gallery ("wathen", @var{nx}, @var{ny}, @var{k})
 ## Create the Wathen matrix.
 ##
 ## @end deftypefn
 ##
-## @deftypefn  {Function File} {[@var{a}, @var{b}] =} gallery ("wilk", @var{n})
+## @deftypefn {Function File} {[@var{a}, @var{b}] =} gallery ("wilk", @var{n})
 ## Create various specific matrices devised/discussed by Wilkinson.
 ##
 ## @end deftypefn
@@ -389,8 +450,7 @@
     case "grcar"      , [varargout{1:n_out}] = grcar       (varargin{:});
     case "hanowa"     , [varargout{1:n_out}] = hanowa      (varargin{:});
     case "house"      , [varargout{1:n_out}] = house       (varargin{:});
-    case "integerdata"
-      error ("gallery: matrix %s not implemented.", name);
+    case "integerdata", [varargout{1:n_out}] = integerdata (varargin{:});
     case "invhess"    , [varargout{1:n_out}] = invhess     (varargin{:});
     case "invol"      , [varargout{1:n_out}] = invol       (varargin{:});
     case "ipjfact"    , [varargout{1:n_out}] = ipjfact     (varargin{:});
@@ -407,8 +467,7 @@
     case "minij"      , [varargout{1:n_out}] = minij       (varargin{:});
     case "moler"      , [varargout{1:n_out}] = moler       (varargin{:});
     case "neumann"    , [varargout{1:n_out}] = neumann     (varargin{:});
-    case "normaldata"
-      error ("gallery: matrix %s not implemented.", name);
+    case "normaldata" , [varargout{1:n_out}] = normaldata  (varargin{:});
     case "orthog"     , [varargout{1:n_out}] = orthog      (varargin{:});
     case "parter"     , [varargout{1:n_out}] = parter      (varargin{:});
     case "pei"        , [varargout{1:n_out}] = pei         (varargin{:});
@@ -433,8 +492,7 @@
     case "toeppen"     , [varargout{1:n_out}] = toeppen     (varargin{:});
     case "tridiag"     , [varargout{1:n_out}] = tridiag     (varargin{:});
     case "triw"        , [varargout{1:n_out}] = triw        (varargin{:});
-    case "uniformdata"
-      error ("gallery: matrix %s not implemented.", name);
+    case "uniformdata" , [varargout{1:n_out}] = uniformdata (varargin{:});
     case "wathen"      , [varargout{1:n_out}] = wathen      (varargin{:});
     case "wilk"        , [varargout{1:n_out}] = wilk        (varargin{:});
     otherwise
@@ -532,7 +590,7 @@
     case (0), # do nothing
     case (1), n = n + 1;
     otherwise
-      error ("gallery: unknown K `%d' for chebspec matrix.", k);
+      error ("gallery: unknown K '%d' for chebspec matrix.", k);
   endswitch
 
   n = n-1;
@@ -839,7 +897,7 @@
     A = eye (n) + theta*P;
 
   else
-    error ("gallery: unknown estimator K `%d' for condex matrix.", k);
+    error ("gallery: unknown estimator K '%d' for condex matrix.", k);
   endif
 
   ## Pad out with identity as necessary.
@@ -999,7 +1057,7 @@
       A = toeplitz (c, [1 1 zeros(1,n-2)]);
 
     otherwise
-      error ("gallery: unknown K `%d' for dramadah matrix.", k);
+      error ("gallery: unknown K '%d' for dramadah matrix.", k);
   endswitch
 endfunction
 
@@ -1267,6 +1325,48 @@
   endif
 endfunction
 
+function A = integerdata (varargin)
+
+  if (nargin < 3)
+    error ("gallery: At least 3 arguments required for integerdata matrix.");
+  endif
+
+  if (isnumeric (varargin{end}))
+    jidx = varargin{end};
+    svec = [varargin{:}];
+    varargin(end) = [];
+  elseif (ischar (varargin{end}))
+    if (nargin < 4)
+      error (["gallery: CLASS argument requires 4 inputs " ...
+              "for integerdata matrix."]);
+    endif
+    jidx = varargin{end-1};
+    svec = [varargin{1:end-1}];
+    varargin(end-1) = [];
+  else 
+    error (["gallery: J must be an integer in the range [0, 2^32-1] " ...
+            "for integerdata matrix"]);
+  endif
+
+  if (! (isnumeric (jidx) && isscalar (jidx)
+         && jidx == fix (jidx)
+         && jidx >= 0 && jidx <= 0xFFFFFFFF))
+    error (["gallery: J must be an integer in the range [0, 2^32-1] " ...
+            "for integerdata matrix"]);
+  endif
+
+  ## Save and restore random state.  Initialization done so that reproducible
+  ## data is available from gallery depending on the jidx and size vector.
+  randstate = rand ("state"); 
+  unwind_protect
+    rand ("state", svec);
+    A = randi (varargin{:});
+  unwind_protect_cleanup
+    rand ("state", randstate);
+  end_unwind_protect
+
+endfunction
+
 function A = invhess (x, y)
   ## INVHESS  Inverse of an upper Hessenberg matrix.
   ##          INVHESS(X, Y), where X is an N-vector and Y an N-1 vector,
@@ -1314,7 +1414,7 @@
   x = x(:);
   y = y(:);
 
-  ##  On next line, z = x'; A = z(ones(n,1),:) would be more efficient.
+  ##  FIXME: On next line, z = x'; A = z(ones(n,1),:) would be more efficient.
   A = ones (n, 1) * x';
   for j = 2:n
     A(1:j-1,j) = y(1:j-1);
@@ -1502,16 +1602,16 @@
   if (nargin < 1 || nargin > 2)
     error ("gallery: 1 to 2 arguments are required for lauchli matrix.");
   elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n)
-    error("gallery: N must be an integer for lauchli matrix.")
+    error ("gallery: N must be an integer for lauchli matrix.")
   elseif (! isscalar (mu))
-    error("gallery: MU must be a scalar for lauchli matrix.")
+    error ("gallery: MU must be a scalar for lauchli matrix.")
   endif
 
-  A = (1:n)'*ones(1,n);
-  A = abs(A - A');
+  A = (1:n)'*ones (1,n);
+  A = abs (A - A');
   A = rho .^ A;
-  if imag(rho)
-    A = conj(tril(A,-1)) + triu(A);
+  if (imag (rho))
+    A = conj (tril (A,-1)) + triu (A);
   endif
 endfunction
 
@@ -1745,6 +1845,47 @@
   A = kron (T, eye (n(2))) + kron (eye (n(2)), T);
 endfunction
 
+function A = normaldata (varargin)
+
+  if (nargin < 2)
+    error ("gallery: At least 2 arguments required for normaldata matrix.");
+  endif
+  if (isnumeric (varargin{end}))
+    jidx = varargin{end};
+    svec = [varargin{:}];
+    varargin(end) = [];
+  elseif (ischar (varargin{end}))
+    if (nargin < 3)
+      error (["gallery: CLASS argument requires 3 inputs " ...
+              "for normaldata matrix."]);
+    endif
+    jidx = varargin{end-1};
+    svec = [varargin{1:end-1}];
+    varargin(end-1) = [];
+  else 
+    error (["gallery: J must be an integer in the range [0, 2^32-1] " ...
+            "for normaldata matrix"]);
+  endif
+
+  if (! (isnumeric (jidx) && isscalar (jidx)
+         && jidx == fix (jidx)
+         && jidx >= 0 && jidx <= 0xFFFFFFFF))
+    error (["gallery: J must be an integer in the range [0, 2^32-1] " ...
+            "for normaldata matrix"]);
+  endif
+
+  ## Save and restore random state.  Initialization done so that reproducible
+  ## data is available from gallery depending on the jidx and size vector.
+  randstate = randn ("state"); 
+  unwind_protect
+    randn ("state", svec);
+    A = randn (varargin{:});
+  unwind_protect_cleanup
+    randn ("state", randstate);
+  end_unwind_protect
+
+endfunction
+
 function Q = orthog (n, k = 1)
   ## ORTHOG Orthogonal and nearly orthogonal matrices.
   ##        Q = ORTHOG(N, K) selects the K'th type of matrix of order N.
@@ -1827,7 +1968,7 @@
       Q = cos (m);
 
     otherwise
-      error ("gallery: unknown K `%d' for orthog matrix.", k);
+      error ("gallery: unknown K '%d' for orthog matrix.", k);
   endswitch
 endfunction
 
@@ -1927,7 +2068,7 @@
   a(1)   = 2*w;
   a(2:n) = sin (2*pi*w*(1:n-1)) ./ (pi*(1:n-1));
 
-  A = toeplitz(a);
+  A = toeplitz (a);
 endfunction
 
 function H = randhess (x)
@@ -2006,7 +2147,7 @@
     case (2), A = 2*floor (  rand(m, n) + 0.5) -1;  # {-1, 1}
     case (3), A =   round (3*rand(m, n) - 1.5);     # {-1, 0, 1}
     otherwise
-      error ("gallery: unknown K `%d' for smoke matrix.", k);
+      error ("gallery: unknown K '%d' for smoke matrix.", k);
   endswitch
 
 endfunction
@@ -2097,7 +2238,7 @@
       rand ("uniform");
       sigma = exp (-rand (p, 1) * log (kappa));
     otherwise
-      error ("gallery: unknown MODE `%d' for randsvd matrix.", mode);
+      error ("gallery: unknown MODE '%d' for randsvd matrix.", mode);
   endswitch
 
   ##  Convert to diagonal matrix of singular values.
@@ -2251,8 +2392,8 @@
     error ("gallery: K must be a numeric scalar for smoke matrix.");
   endif
 
-  w = exp(2*pi*i/n);
-  A = diag( [w.^(1:n-1) 1] ) + diag(ones(n-1,1),1);
+  w = exp (2*pi*i/n);
+  A = diag ( [w.^(1:n-1) 1] ) + diag (ones (n-1,1), 1);
 
   switch (k)
     case (0), A(n,1) = 1;
@@ -2425,6 +2566,47 @@
   t = tril (eye (m, n) + alpha * triu (ones (m, n), 1), k);
 endfunction
 
+function A = uniformdata (varargin)
+
+  if (nargin < 2)
+    error ("gallery: At least 2 arguments required for uniformdata matrix.");
+  endif
+  if (isnumeric (varargin{end}))
+    jidx = varargin{end};
+    svec = [varargin{:}];
+    varargin(end) = [];
+  elseif (ischar (varargin{end}))
+    if (nargin < 3)
+      error (["gallery: CLASS argument requires 3 inputs " ...
+              "for uniformdata matrix."]);
+    endif
+    jidx = varargin{end-1};
+    svec = [varargin{1:end-1}];
+    varargin(end-1) = [];
+  else 
+    error (["gallery: J must be an integer in the range [0, 2^32-1] " ...
+            "for uniformdata matrix"]);
+  endif
+
+  if (! (isnumeric (jidx) && isscalar (jidx)
+         && jidx == fix (jidx)
+         && jidx >= 0 && jidx <= 0xFFFFFFFF))
+    error (["gallery: J must be an integer in the range [0, 2^32-1] " ...
+            "for uniformdata matrix"]);
+  endif
+
+  ## Save and restore random state.  Initialization done so that reproducible
+  ## data is available from gallery depending on the jidx and size vector.
+  randstate = rand ("state"); 
+  unwind_protect
+    rand ("state", svec);
+    A = rand (varargin{:});
+  unwind_protect_cleanup
+    rand ("state", randstate);
+  end_unwind_protect
+
+endfunction
+
 function A = wathen (nx, ny, k = 0)
   ## # WATHEN returns the Wathen matrix.
   ##
@@ -2616,7 +2798,7 @@
     A = diag (abs (-m:m)) + E + E';
 
   else
-    error ("gallery: unknown N `%d' for wilk matrix.", n);
+    error ("gallery: unknown N '%d' for wilk matrix.", n);
   endif
 endfunction
 
--- a/scripts/startup/main-rcfile
+++ b/scripts/startup/main-rcfile
@@ -6,7 +6,7 @@
 ## Configure readline using the file inputrc in the Octave startup
 ## directory.
 
-read_readline_init_file (sprintf ("%s%s%s",
+readline_read_init_file (sprintf ("%s%s%s",
 				  octave_config_info ("startupfiledir"),
 				  filesep, "inputrc"));
 
--- a/scripts/statistics/base/quantile.m
+++ b/scripts/statistics/base/quantile.m
@@ -38,7 +38,8 @@
 ## dimension.
 ##
 ## The methods available to calculate sample quantiles are the nine methods
-## used by R (http://www.r-project.org/).  The default value is METHOD = 5.
+## used by R (@url{http://www.r-project.org/}).  The default value is
+## @w{METHOD = 5}.
 ##
 ## Discontinuous sample quantile methods 1, 2, and 3
 ##
@@ -308,8 +309,7 @@
 ## quantiles, @var{q} (the inverse of the cdf), for the sample, @var{x}.
 ##
 ## The optional input, @var{method}, refers to nine methods available in R
-## (http://www.r-project.org/). The default is @var{method} = 7. For more
-## detail, see `help quantile'.
+## (http://www.r-project.org/). The default is @var{method} = 7.
 ## @seealso{prctile, quantile, statistics}
 
 ## Author: Ben Abbott <bpabbott@mac.com>
--- a/scripts/statistics/distributions/binocdf.m
+++ b/scripts/statistics/distributions/binocdf.m
@@ -60,9 +60,9 @@
   k = (x >= 0) & (x < n) & (n == fix (n)) & (p >= 0) & (p <= 1);
   tmp = floor (x(k));
   if (isscalar (n) && isscalar (p))
-    cdf(k) = 1 - betainc (p, tmp + 1, n - tmp);
+    cdf(k) = betainc (1 - p, n - tmp, tmp + 1);
   else
-    cdf(k) = 1 - betainc (p(k), tmp + 1, n(k) - tmp);
+    cdf(k) = betainc (1 .- p(k), n(k) - tmp, tmp + 1);
   endif
 
 endfunction
--- a/scripts/statistics/distributions/normcdf.m
+++ b/scripts/statistics/distributions/normcdf.m
@@ -54,13 +54,13 @@
   endif
 
   if (isscalar (mu) && isscalar (sigma))
-    if (!isinf (mu) && !isnan (mu) && (sigma > 0) && (sigma < Inf))
+    if (isfinite (mu) && (sigma > 0) && (sigma < Inf))
       cdf = stdnormal_cdf ((x - mu) / sigma);
     else
       cdf = NaN (size (x), class (cdf));
     endif
   else
-    k = isinf (mu) | isnan (mu) | !(sigma > 0) | !(sigma < Inf);
+    k = ! isfinite (mu) | !(sigma > 0) | !(sigma < Inf);
     cdf(k) = NaN;
 
     k = ! k;
--- a/scripts/statistics/distributions/norminv.m
+++ b/scripts/statistics/distributions/norminv.m
@@ -54,11 +54,11 @@
   endif
 
   if (isscalar (mu) && isscalar (sigma))
-    if (!isinf (mu) && !isnan (mu) && (sigma > 0) && (sigma < Inf))
+    if (isfinite (mu) && (sigma > 0) && (sigma < Inf))
       inv =  mu + sigma * stdnormal_inv (x);
     endif
   else
-    k = !isinf (mu) & !isnan (mu) & (sigma > 0) & (sigma < Inf);
+    k = isfinite (mu) & (sigma > 0) & (sigma < Inf);
     inv(k) = mu(k) + sigma(k) .* stdnormal_inv (x(k));
   endif
 
--- a/scripts/statistics/distributions/normpdf.m
+++ b/scripts/statistics/distributions/normpdf.m
@@ -54,7 +54,7 @@
   endif
 
   if (isscalar (mu) && isscalar (sigma))
-    if (!isinf (mu) && !isnan (mu) && (sigma > 0) && (sigma < Inf))
+    if (isfinite (mu) && (sigma > 0) && (sigma < Inf))
       pdf = stdnormal_pdf ((x - mu) / sigma) / sigma;
     else
       pdf = NaN (size (x), class (pdf));
--- a/scripts/statistics/distributions/normrnd.m
+++ b/scripts/statistics/distributions/normrnd.m
@@ -83,14 +83,14 @@
   endif
 
   if (isscalar (mu) && isscalar (sigma))
-    if (!isnan (mu) && !isinf (mu) && (sigma > 0) && (sigma < Inf))
+    if (isfinite (mu) && (sigma > 0) && (sigma < Inf))
       rnd =  mu + sigma * randn (sz, cls);
     else
       rnd = NaN (sz, cls);
     endif
   else
     rnd = mu + sigma .* randn (sz, cls);
-    k = isnan (mu) | isinf (mu) | !(sigma > 0) | !(sigma < Inf);
+    k = ! isfinite (mu) | !(sigma > 0) | !(sigma < Inf);
     rnd(k) = NaN;
   endif
 
--- a/scripts/statistics/distributions/tpdf.m
+++ b/scripts/statistics/distributions/tpdf.m
@@ -53,7 +53,7 @@
   k = isnan (x) | !(n > 0) | !(n < Inf);
   pdf(k) = NaN;
 
-  k = !isinf (x) & !isnan (x) & (n > 0) & (n < Inf);
+  k = isfinite (x) & (n > 0) & (n < Inf);
   if (isscalar (n))
     pdf(k) = (exp (- (n + 1) * log (1 + x(k) .^ 2 / n)/2)
               / (sqrt (n) * beta (n/2, 1/2)));
--- a/scripts/statistics/tests/f_test_regression.m
+++ b/scripts/statistics/tests/f_test_regression.m
@@ -18,8 +18,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{f}, @var{df_num}, @var{df_den}] =} f_test_regression (@var{y}, @var{x}, @var{rr}, @var{r})
-## Perform an F test for the null hypothesis rr * b = r in a classical
-## normal regression model y = X * b + e.
+## Perform an F test for the null hypothesis @nospell{rr * b = r} in a
+## classical normal regression model y = X * b + e.
 ##
 ## Under the null, the test statistic @var{f} follows an F distribution
 ## with @var{df_num} and @var{df_den} degrees of freedom.
--- a/scripts/statistics/tests/t_test_regression.m
+++ b/scripts/statistics/tests/t_test_regression.m
@@ -18,20 +18,23 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{t}, @var{df}] =} t_test_regression (@var{y}, @var{x}, @var{rr}, @var{r}, @var{alt})
-## Perform an t test for the null hypothesis @code{@var{rr} * @var{b} =
-## @var{r}} in a classical normal regression model @code{@var{y} =
-## @var{x} * @var{b} + @var{e}}.  Under the null, the test statistic @var{t}
-## follows a @var{t} distribution with @var{df} degrees of freedom.
+## Perform a t test for the null hypothesis
+## @nospell{@code{@var{rr} * @var{b} = @var{r}}} in a classical normal
+## regression model @code{@var{y} = @var{x} * @var{b} + @var{e}}.  Under the
+## null, the test statistic @var{t} follows a @var{t} distribution with
+## @var{df} degrees of freedom.
 ##
 ## If @var{r} is omitted, a value of 0 is assumed.
 ##
 ## With the optional argument string @var{alt}, the alternative of
 ## interest can be selected.  If @var{alt} is @code{"!="} or
 ## @code{"<>"}, the null is tested against the two-sided alternative
-## @code{@var{rr} * @var{b} != @var{r}}.  If @var{alt} is @code{">"}, the
-## one-sided alternative @code{@var{rr} * @var{b} > @var{r}} is used.
-## Similarly for @var{"<"}, the one-sided alternative @code{@var{rr} *
-## @var{b} < @var{r}} is used.  The default is the two-sided case.
+## @nospell{@code{@var{rr} * @var{b} != @var{r}}}.  If @var{alt} is @code{">"},
+## the one-sided alternative
+## @nospell{@code{@var{rr} * @var{b} > @var{r}}} is used.  Similarly for
+## @var{"<"}, the one-sided alternative
+## @nospell{@code{@var{rr} * @var{b} < @var{r}}} is used.  The default is the
+## two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
--- a/scripts/statistics/tests/z_test.m
+++ b/scripts/statistics/tests/z_test.m
@@ -78,9 +78,9 @@
   endif
 
   if (nargout == 0)
-    s = cstrcat ("Z-test of mean(x) == %g against mean(x) %s %g,\n",
-                 "with known var(x) == %g:\n",
-                 "  pval = %g\n");
+    s = ["Z-test of mean(x) == %g against mean(x) %s %g,\n", \
+         "with known var(x) == %g:\n",                       \
+         "  pval = %g\n");
     printf (s, m, alt, m, v, pval);
   endif
 
--- a/scripts/statistics/tests/z_test_2.m
+++ b/scripts/statistics/tests/z_test_2.m
@@ -78,10 +78,10 @@
   endif
 
   if (nargout == 0)
-    s = cstrcat ("Two-sample Z-test of mean(x) == mean(y) against ",
-                 "mean(x) %s mean(y),\n",
-                 "with known var(x) == %g and var(y) == %g:\n",
-                 "  pval = %g\n");
+    s = ["Two-sample Z-test of mean(x) == mean(y) against ", \
+         "mean(x) %s mean(y),\n",                            \
+         "with known var(x) == %g and var(y) == %g:\n",      \
+         "  pval = %g\n"];
     printf (s, alt, v_x, v_y, pval);
   endif
 
--- a/scripts/strings/dec2base.m
+++ b/scripts/strings/dec2base.m
@@ -66,8 +66,11 @@
   if (! iscolumn (d))
     d = d(:);
   endif
-
-  if (! isnumeric (d) || iscomplex (d) || any (d < 0 | d != fix (d)))
+  
+  ## Treat logical as numeric for compatibility with ML
+  if (islogical (d))
+    d = double (d);
+  elseif (! isnumeric (d) || iscomplex (d) || any (d < 0 | d != fix (d)))
     error ("dec2base: input must be real non-negative integers");
   endif
 
@@ -151,6 +154,10 @@
 %!assert (dec2base ([1, 2; 3, 4], 2, 3), ["001"; "011"; "010"; "100"])
 %!assert (dec2base ({1, 2; 3, 4}, 2, 3), ["001"; "011"; "010"; "100"])
 
+%!test
+%! a = 0:3;
+%! assert (dec2base (!a, 2, 1), ["1"; "0"; "0"; "0"])
+
 %%Test input validation
 %!error dec2base ()
 %!error dec2base (1)
--- a/scripts/strings/mat2str.m
+++ b/scripts/strings/mat2str.m
@@ -103,7 +103,7 @@
     endif
   else
     ## Non-scalar X, print brackets
-    fmt = cstrcat (fmt, " ");
+    fmt = [fmt " "];
     if (x_iscomplex)
       t = x.';
       s = sprintf (fmt, [real(t(:))'; imag(t(:))']);
@@ -114,7 +114,7 @@
       s = sprintf (fmt, x.');
     endif
 
-    s = cstrcat ("[", s);
+    s = ["[" s];
     s(end) = "]";
     idx = strfind (s, " ");
     nc = columns (x);
@@ -122,7 +122,7 @@
   endif
 
   if (strcmp ("class", cls))
-    s = cstrcat (class (x), "(", s, ")");
+    s = [class(x) "(" s ")"];
   endif
 
 endfunction
--- a/scripts/strings/strjoin.m
+++ b/scripts/strings/strjoin.m
@@ -1,5 +1,5 @@
-## Copyright (C) 2007 Muthiah Annamalai <muthiah.annamalai@uta.edu>
-## Copyright (C) 2013 Ben Abbott <bpabbott@mac.com>
+## Copyright (C) 2007 Muthiah Annamalai
+## Copyright (C) 2013 Ben Abbott
 ##
 ## This file is part of Octave.
 ##
@@ -18,20 +18,21 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {@var{str} =} strjoin (@var{cstr})
+## @deftypefn  {Function File} {@var{str} =} strjoin (@var{cstr})
 ## @deftypefnx {Function File} {@var{str} =} strjoin (@var{cstr}, @var{delimiter})
-## Joins the elements of the cell-string array, @var{cstr}, into a single
+## Join the elements of the cell-string array, @var{cstr}, into a single
 ## string.
 ##
 ## If no @var{delimiter} is specified, the elements of @var{cstr}
-## seperated by a space.
+## separated by a space.
 ##
 ## If @var{delimiter} is specified as a string, the cell-string array is
-## joined using the string.
+## joined using the string.  Escape sequences are supported.
 ##
 ## If @var{delimiter} is a cell-string array whose length is one less
-## than @var{cstr}, then the elemennts of @var{cstr} are joined by
-## interleaving the cell-string elements of @var{delimiter}.
+## than @var{cstr}, then the elements of @var{cstr} are joined by
+## interleaving the cell-string elements of @var{delimiter}.  Escape
+## sequences are not supported.
 ##
 ## @example
 ## @group
@@ -42,6 +43,9 @@
 ## @seealso {strsplit}
 ## @end deftypefn
 
+## Author: Muthiah Annamalai <muthiah.annamalai@uta.edu>
+## Author: Ben Abbott <bpabbott@mac.com>
+
 function rval = strjoin (cstr, delimiter)
 
   if (nargin == 1)
@@ -58,6 +62,7 @@
   endif
 
   if (ischar (delimiter))
+    delimiter = do_string_escapes (delimiter);
     delimiter = {delimiter};
   end
  
@@ -65,14 +70,18 @@
   if (numel (delimiter) == 1 && num > 1)
     delimiter = repmat (delimiter, 1, num);
     delimiter(end) = {""};
-  elseif (numel (delimiter) != num - 1)
+  elseif (num > 0 && numel (delimiter) != num - 1)
     error ("strjoin:cellstring_delimiter_mismatch",
       "strjoin: the number of delimiters does not match the number of strings")
   else
     delimiter(end+1) = {""};
   endif
 
-  rval = sprintf ("%s", [cstr(:).'; delimiter(:).']{:});
+  if (num == 0)
+    rval = "";
+  else
+    rval = [[cstr(:).'; delimiter(:).']{:}];
+  endif
 
 endfunction
 
@@ -82,3 +91,6 @@
 %!  "Octave*Scilab*Lush*Yorick")
 %!assert (strjoin ({"space", "comma", "dash", "semicolon", "done"},
 %!  {" ", ",", "-", ";"}), "space comma,dash-semicolon;done")
+%!assert (strjoin ({'Octave','Scilab'},'\n'), "Octave\nScilab")
+%!assert (strjoin ({'Octave','Scilab'},{'\n'}), "Octave\\nScilab")
+%!assert (strjoin ({},'foo'), "")
--- a/scripts/strings/strsplit.m
+++ b/scripts/strings/strsplit.m
@@ -22,7 +22,7 @@
 ## @deftypefnx {Function File} {[@var{cstr}] =} strsplit (@dots{}, @var{name}, @var{value})
 ## @deftypefnx {Function File} {[@var{cstr}, @var{matches}] =} strsplit (@dots{})
 ## Split the string @var{s} using the delimiters specified by @var{del}
-## and return a cell-string array of sub-strings.  If a delmiter is not
+## and return a cell-string array of sub-strings.  If a delimiter is not
 ## specified the string, @var{s}, is split at whitespace.  The delimiter,
 ## @var{del} may be a string, a scalar cell-string, or cell-string array.
 ## @var{del} must be a cell-string array.  By default, consecutive
@@ -34,7 +34,6 @@
 ## Example:
 ##
 ## @example
-## @group
 ## strsplit ("a b c")
 ##       @result{}
 ##           @{
@@ -69,7 +68,6 @@
 ##             [1,5] = c
 ##           @}
 ##
-## @end group
 ## @end example
 ##
 ## Supported @var{name}/@var{value} pair arguments are;
@@ -77,15 +75,15 @@
 ## @itemize
 ## @item @var{collapsedelimiters} may take the value of @var{true} or
 ## @var{false} with the default being @var{false}.
+##
 ## @item @var{delimitertype} may take the value of @code{simple} or
-## @code{regularexpression}. The default is @var{delimitertype} is
+## @code{regularexpression}.  The default is @var{delimitertype} is
 ## @code{simple}.
 ## @end itemize
 ## 
 ## Example:
 ##
 ## @example
-## @group
 ## strsplit ("a foo b,bar c", ",|\\s|foo|bar", "delimitertype", "regularexpression")
 ##       @result{}
 ##           @{
@@ -122,7 +120,6 @@
 ##             [1,5] = 
 ##             [1,6] = c
 ##           @}
-## @end group
 ## @end example
 ## 
 ## @seealso{ostrsplit, strjoin, strtok, regexp}
@@ -152,7 +149,7 @@
       args.(lower(params{n})) = params{n+1};
     elseif (ischar (varargin{n}))
       error ("strsplit:invalid_parameter_name",
-        sprintf ("strsplit: Invalid parameter name, `%s'", varargin{n}))
+             "strsplit: invalid parameter name, '%s'", varargin{n});
     else
       print_usage ();
     endif
@@ -207,8 +204,8 @@
     endif
     [result, ~, ~, ~, matches] = regexp (str, del, "split");
   else
-    error ("strsplit:invalid_delimitertype", 
-      sprintf ("strsplit: Invalid DELIMITERTYPE"))
+    error ("strsplit:invalid_delimitertype",
+           "strsplit: Invalid DELIMITERTYPE");
   endif
 endfunction
 
--- a/scripts/strings/strtok.m
+++ b/scripts/strings/strtok.m
@@ -211,9 +211,9 @@
 %% Test with TAB, LF, VT, FF, and CR
 %!test
 %! for ch = "\t\n\v\f\r"
-%!   [t, r] = strtok (cstrcat ("beg", ch, "end"));
+%!   [t, r] = strtok (["beg", ch, "end"]);
 %!   assert (t, "beg");
-%!   assert (r, cstrcat (ch, "end"));
+%!   assert (r, [ch, "end"]);
 %! endfor
 
 %% Test input validation
--- a/scripts/testfun/__have_feature__.m
+++ b/scripts/testfun/__have_feature__.m
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} __have_feature__ (feature)
+## @deftypefn {Function File} {} __have_feature__ (feature)
 ## Undocumented internal function.
 ## @end deftypefn
 
--- a/scripts/testfun/__printf_assert__.m
+++ b/scripts/testfun/__printf_assert__.m
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} __printf_assert__ (@dots{})
+## @deftypefn {Function File} {} __printf_assert__ (@dots{})
 ## Undocumented internal function.
 ## @end deftypefn
 
--- a/scripts/testfun/__prog_output_assert__.m
+++ b/scripts/testfun/__prog_output_assert__.m
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} __prog_output_assert__ (@var{str})
+## @deftypefn {Function File} {} __prog_output_assert__ (@var{str})
 ## Undocumented internal function.
 ## @end deftypefn
 
--- a/scripts/testfun/__run_test_suite__.m
+++ b/scripts/testfun/__run_test_suite__.m
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} __run_test_suite__ (@var{fcndirs}, @var{fixedtestdirs})
+## @deftypefn {Function File} {} __run_test_suite__ (@var{fcndirs}, @var{fixedtestdirs})
 ## Undocumented internal function.
 ## @end deftypefn
 
@@ -277,7 +277,7 @@
 endfunction
 
 function report_files_with_no_tests (with, without, typ)
-  pat = cstrcat ('\', typ, "$");
+  pat = ['\' typ "$"];
   n_with = num_elts_matching_pattern (with, pat);
   n_without = num_elts_matching_pattern (without, pat);
   n_tot = n_with + n_without;
--- a/scripts/testfun/assert.m
+++ b/scripts/testfun/assert.m
@@ -61,9 +61,9 @@
 
   in = deblank (argn(1,:));
   for i = 2:rows (argn)
-    in = cstrcat (in, ",", deblank (argn(i,:)));
+    in = [in "," deblank(argn(i,:))];
   endfor
-  in = cstrcat ("(", in, ")");
+  in = ["(" in ")"];
 
   if (nargin == 1 || (nargin > 1 && islogical (cond) && ischar (varargin{1})))
     if ((! isnumeric (cond) && ! islogical (cond)) || ! all (cond(:)))
@@ -147,7 +147,7 @@
         ## Without explicit tolerance, be more strict.
         if (! strcmp (class (cond), class (expected)))
           iserror = 1;
-          coda = cstrcat ("Class ", class (cond), " != ", class (expected));
+          coda = ["Class " class (cond) " != " class(expected)];
         elseif (isnumeric (cond))
           if (issparse (cond) != issparse (expected))
             if (issparse (cond))
@@ -228,9 +228,9 @@
     if (! isempty (idx))
       str2 = str2 (idx(1):idx(end));
     endif
-    msg = cstrcat ("assert ", in, " expected\n", str, "\nbut got\n", str2);
+    msg = ["assert " in " expected\n" str "\nbut got\n" str2];
     if (! isempty (coda))
-      msg = cstrcat (msg, "\n", coda);
+      msg = [msg, "\n", coda];
     endif
     error ("%s", msg);
   endif
--- a/scripts/testfun/demo.m
+++ b/scripts/testfun/demo.m
@@ -128,7 +128,7 @@
     try
       block = code(idx(doidx(i)):idx(doidx(i)+1)-1);
       ## Use an environment without variables
-      eval (cstrcat ("function __demo__ ()\n", block, "\nendfunction"));
+      eval (["function __demo__()\n" block "\nendfunction"]);
       ## Display the code that will be executed before executing it
       printf ("%s example %d:%s\n\n", name, doidx(i), block);
       __demo__;
--- a/scripts/testfun/speed.m
+++ b/scripts/testfun/speed.m
@@ -187,14 +187,14 @@
   do_display = (nargout == 0);
 
   if (do_display)
-    disp (cstrcat ("testing ", __f1, "\ninit: ", __init));
+    disp (["testing " __f1 "\ninit: " __init]);
   endif
 
   ## Add semicolon closure to all code fragments in case user has not done so.
-  __init = cstrcat (__init, ";");
-  __f1 = cstrcat (__f1, ";");
+  __init(end+1) = ";";
+  __f1(end+1) = ";";
   if (! isempty (__f2))
-    __f2 = cstrcat (__f2, ";");
+    __f2(end+1) = ";";
   endif
 
   ## Make sure the functions are freshly loaded by evaluating them at
@@ -217,19 +217,19 @@
       fflush (stdout);
     endif
 
-    eval (cstrcat ("__t = time();", __f1, "__v1=ans; __t = time()-__t;"));
+    eval (["__t = time();" __f1 "__v1=ans; __t = time()-__t;"]);
     if (__t < 0.25)
-      eval (cstrcat ("__t2 = time();", __f1, "__t2 = time()-__t2;"));
-      eval (cstrcat ("__t3 = time();", __f1, "__t3 = time()-__t3;"));
+      eval (["__t2 = time();" __f1 "__t2 = time()-__t2;"]);
+      eval (["__t3 = time();" __f1 "__t3 = time()-__t3;"]);
       __t = min ([__t, __t2, __t3]);
     endif
     __tnew(k) = __t;
 
     if (! isempty (__f2))
-      eval (cstrcat ("__t = time();", __f2, "__v2=ans; __t = time()-__t;"));
+      eval (["__t = time();" __f2 "__v2=ans; __t = time()-__t;"]);
       if (__t < 0.25)
-        eval (cstrcat ("__t2 = time();", __f2, "__t2 = time()-__t2;"));
-        eval (cstrcat ("__t3 = time();", __f2, "__t3 = time()-__t3;"));
+        eval (["__t2 = time();" __f2 "__t2 = time()-__t2;"]);
+        eval (["__t3 = time();" __f2 "__t3 = time()-__t3;"]);
         __t = min ([__t, __t2, __t3]);
       endif
       __torig(k) = __t;
@@ -280,27 +280,25 @@
     loglog (__test_n, __tnew*1000, "*-g;execution time;");
     xlabel ("test length");
     ylabel ("best execution time (ms)");
-    title ({__f1, cstrcat("init: ", __init)});
+    title ({__f1, ["init: " __init]});
 
   elseif (do_display)
 
     subplot (1, 2, 1);
     semilogx (__test_n, __torig./__tnew,
-              cstrcat ("-*r;", strrep (__f1, ";", "."), " / ",
-                       strrep (__f2, ";", "."), ";"),
-               __test_n, __tnew./__torig,
-              cstrcat ("-*g;", strrep (__f2, ";", "."), " / ",
-                       strrep (__f1, ";", "."), ";"));
+             ["-*r;" strrep(__f1, ";", ".") " / " strrep(__f2, ";", ".") ";"],
+              __test_n, __tnew./__torig,
+             ["-*g;", strrep(__f2, ";", ".") " / " strrep(__f1, ";", ".") ";"]);
     title ("Speedup Ratio");
     xlabel ("test length");
     ylabel ("speedup ratio");
 
     subplot (1, 2, 2);
     loglog (__test_n, __tnew*1000,
-            cstrcat ("*-g;", strrep (__f1, ";", "."), ";"),
+            ["*-g;" strrep(__f1,";",".") ";"],
             __test_n, __torig*1000,
-            cstrcat ("*-r;", strrep (__f2,";","."), ";"));
-    title ({"Execution Times", cstrcat("init: ", __init)});
+            ["*-r;" strrep(__f2,";",".") ";"]);
+    title ({"Execution Times", ["init: " __init]});
     xlabel ("test length");
     ylabel ("best execution time (ms)");
 
--- a/scripts/testfun/test.m
+++ b/scripts/testfun/test.m
@@ -155,10 +155,10 @@
   ## Locate the file to test.
   __file = file_in_loadpath (__name, "all");
   if (isempty (__file))
-    __file = file_in_loadpath (cstrcat (__name, ".m"), "all");
+    __file = file_in_loadpath ([__name ".m"], "all");
   endif
   if (isempty (__file))
-    __file = file_in_loadpath (cstrcat (__name, ".cc"), "all");
+    __file = file_in_loadpath ([__name ".cc"], "all");
   endif
   if (iscell (__file))
       ## If repeats, return first in path.
@@ -229,7 +229,7 @@
 
   ## Ready to start tests ... if in batch mode, tell us what is happening.
   if (__verbose)
-    disp (cstrcat (__signal_file, __file));
+    disp ([__signal_file, __file]);
   endif
 
   ## Assume all tests will pass.
@@ -281,7 +281,7 @@
           __demo_code = __code;
           __demo_idx = [1, length(__demo_code)+1];
         else
-          __demo_code = cstrcat (__demo_code, __code);
+          __demo_code = [__demo_code, __code];
           __demo_idx = [__demo_idx, length(__demo_code)+1];
         endif
 
@@ -326,9 +326,9 @@
       try
         __vars = deblank (__vars);
         if (! isempty (__vars))
-          eval (cstrcat (strrep (__vars, ",", "=[];"), "=[];"));
+          eval ([strrep(__vars, ",", "=[];"), "=[];"]);
           __shared = __vars;
-          __shared_r = cstrcat ("[ ", __vars, "] = ");
+          __shared_r = ["[ ", __vars, "] = "];
         else
           __shared = " ";
           __shared_r = " ";
@@ -392,7 +392,11 @@
       if (__id)
         __patstr = ["id=",__id];
       else
-        __patstr = ["<",__pattern,">"];
+        if (! strcmp (__pattern, '.'))
+          __patstr = ["<",__pattern,">"];
+        else
+          __patstr = ifelse (__warning, "a warning", "an error");
+        endif
       endif
       try
         eval (sprintf ("function __test__(%s)\n%s\nendfunction",
@@ -407,25 +411,34 @@
         __success = 0;
         __warnstate = warning ("query", "quiet");
         warning ("on", "quiet");
+        ## Clear error and warning strings before starting
+        lasterr ("");
+        lastwarn ("");
         try
+          ## FIXME: lastwarn () must be called once from *WITHIN* the try block
+          ##        or subsequent warning/lastwarn statements may fail.
+          ##        Likely this is something to do with the specialness of
+          ##        the try block which is disabling normal errors.
+          lastwarn ();
           eval (sprintf ("__test__(%s);", __shared));
           if (! __warning)
-            __msg = sprintf ("%sexpected %s but got no error\n",
+            __msg = sprintf ("%serror failed.\nExpected %s but got no error\n",
                              __signal_fail, __patstr);
           else
             if (! isempty (__id))
-              [~, __err] = lastwarn;
+              [~, __err] = lastwarn ();
               __mismatch = ! strcmp (__err, __id);
             else
-              __err = trimerr (lastwarn, "warning");
+              __err = trimerr (lastwarn (), "warning");
               __mismatch = isempty (regexp (__err, __pattern, "once"));
             endif
             warning (__warnstate.state, "quiet");
             if (isempty (__err))
-              __msg = sprintf ("%sexpected %s but got no warning\n",
-                             __signal_fail, __patstr);
+              __msg = sprintf (["%swarning failed.\n" \
+                                "Expected %s but got no warning\n"],
+                               __signal_fail, __patstr);
             elseif (__mismatch)
-              __msg = sprintf ("%sexpected %s but got %s\n",
+              __msg = sprintf ("%swarning failed.\nExpected %s but got <%s>\n",
                                __signal_fail, __patstr, __err);
             else
               __success = 1;
@@ -434,18 +447,19 @@
 
         catch
           if (! isempty (__id))
-            [~, __err] = lasterr;
+            [~, __err] = lasterr ();
             __mismatch = ! strcmp (__err, __id);
           else
-            __err = trimerr (lasterr, "error");
+            __err = trimerr (lasterr (), "error");
             __mismatch = isempty (regexp (__err, __pattern, "once"));
           endif
           warning (__warnstate.state, "quiet");
           if (__warning)
-            __msg = sprintf ("%sexpected warning %s but got error %s\n",
+            __msg = sprintf (["%swarning failed.\n" \
+                              "Expected warning %s but got error <%s>\n"],
                              __signal_fail, __patstr, __err);
           elseif (__mismatch)
-            __msg = sprintf ("%sexpected %s but got %s\n",
+            __msg = sprintf ("%serror failed.\nExpected %s but got <%s>\n",
                              __signal_fail, __patstr, __err);
           else
             __success = 1;
@@ -565,13 +579,16 @@
   if (nargout == 0)
     if (__tests || __xfail || __xskip)
       if (__xfail)
-        printf ("PASSES %d out of %d tests (%d expected failures)\n",
-                __successes, __tests, __xfail);
+        printf ("PASSES %d out of %d test%s (%d expected failure%s)\n",
+                __successes, __tests, ifelse (__tests > 1, "s", ""),
+                __xfail, ifelse (__xfail > 1, "s", ""));
       else
-        printf ("PASSES %d out of %d tests\n", __successes, __tests);
+        printf ("PASSES %d out of %d test%s\n", __successes, __tests,
+               ifelse (__tests > 1, "s", ""));
       endif
       if (__xskip)
-        printf ("Skipped %d tests due to missing features\n", __xskip);
+        printf ("Skipped %d test%s due to missing features\n", __xskip,
+                ifelse (__xskip > 1, "s", ""));
       endif
     else
       printf ("%s%s has no tests available\n", __signal_empty, __file);
@@ -639,20 +656,17 @@
 
 ## Strip '.*prefix:' from '.*prefix: msg\n' and strip trailing blanks.
 function msg = trimerr (msg, prefix)
-  idx = index (msg, cstrcat (prefix, ":"));
+  idx = index (msg, [prefix ":"]);
   if (idx > 0)
     msg(1:idx+length(prefix)) = [];
   endif
-  msg = trimleft (deblank (msg));
+  msg = strtrim (msg);
 endfunction
 
 ## Strip leading blanks from string.
 function str = trimleft (str)
-  idx = find (isspace (str));
-  leading = find (idx == 1:length (idx));
-  if (! isempty (leading))
-    str = str(leading(end)+1:end);
-  endif
+  idx = find (! isspace (str), 1);
+  str = str(idx:end);
 endfunction
 
 ## Make a structure out of the named variables
@@ -672,7 +686,7 @@
       if (length (ln) >= 2 && strcmp (ln(1:2), "%!"))
         body = [body, "\n"];
         if (length (ln) > 2)
-          body = cstrcat (body, ln(3:end));
+          body = [body, ln(3:end)];
         endif
       endif
     endwhile
@@ -680,6 +694,7 @@
   endif
 endfunction
 
+
 ### example from toeplitz
 %!shared msg1,msg2
 %! msg1="C must be a vector";
--- a/scripts/ui/errordlg.m
+++ b/scripts/ui/errordlg.m
@@ -40,10 +40,11 @@
 
 endfunction
 
-%!demo
-%!  disp('- test errordlg with prompt only.');
-%!  errordlg('Oops, an expected error occured');
 
 %!demo
-%!  disp('- test errordlg with prompt and caption.');
-%!  errordlg('Oops another error','This is a very long and informative caption');
+%! disp ('- test errordlg with prompt only.');
+%! errordlg ('Oops, an expected error occured');
+
+%!demo
+%! disp ('- test errordlg with prompt and caption.');
+%! errordlg ('Oops another error','This is a very long and informative caption');
--- a/scripts/ui/helpdlg.m
+++ b/scripts/ui/helpdlg.m
@@ -40,10 +40,12 @@
 
 endfunction
 
-%!demo
-%!  disp('- test helpdlg with a help message only.');
-%!  helpdlg("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3.");
 
 %!demo
-%!  disp('- test helpdlg with help message and caption.');
-%!  helpdlg('You should see a single line.','A help dialog');
+%! disp ('- test helpdlg with a help message only.');
+%! helpdlg ("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3.");
+
+%!demo
+%! disp ('- test helpdlg with help message and caption.');
+%! helpdlg ('You should see a single line.','A help dialog');
+
--- a/scripts/ui/inputdlg.m
+++ b/scripts/ui/inputdlg.m
@@ -142,64 +142,66 @@
 
 endfunction
 
-%!demo
-%!  disp('- test inputdlg with prompt and caption only.');
-%!  prompt = {'Width','Height','Depth'};
-%!  dims = inputdlg ( prompt, 'Enter Box Dimensions' );
-%!  if isempty(dims)
-%!     helpdlg('Canceled by user', 'Information');
-%!  else
-%!     volume  = str2num(dims{1}) * str2num(dims{2}) * str2num(dims{3});
-%!     surface = 2 * (str2num(dims{1}) * str2num(dims{2}) + ...
-%!                    str2num(dims{2}) * str2num(dims{3}) + ...
-%!                    str2num(dims{1}) * str2num(dims{3}));
-%!     helpdlg(sprintf('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
-%!  end
 
 %!demo
-%!  disp('- test inputdlg with prescribed scalar (2 lines per text field) and defaults.');
-%!  prompt = {'Width','Height','Depth'};
-%!  default = {'1.1','2.2','3.3'};
-%!  rc = 2;
-%!  dims = inputdlg ( prompt, 'Enter Box Dimensions',rc,default );
-%!  if isempty(dims)
-%!     helpdlg('Canceled by user', 'Information');
-%!  else
-%!     volume  = str2num(dims{1}) * str2num(dims{2}) * str2num(dims{3});
-%!     surface = 2 * (str2num(dims{1}) * str2num(dims{2}) + ...
-%!                    str2num(dims{2}) * str2num(dims{3}) + ...
-%!                    str2num(dims{1}) * str2num(dims{3}));
-%!     helpdlg(sprintf('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
-%!  end
+%! disp ('- test inputdlg with prompt and caption only.');
+%! prompt = {'Width','Height','Depth'};
+%! dims = inputdlg (prompt, 'Enter Box Dimensions');
+%! if (isempty (dims))
+%!   helpdlg ('Canceled by user', 'Information');
+%! else
+%!   volume  = str2num (dims{1}) * str2num (dims{2}) * str2num (dims{3});
+%!   surface = 2 * (str2num (dims{1}) * str2num (dims{2}) + ...
+%!                  str2num (dims{2}) * str2num (dims{3}) + ...
+%!                  str2num (dims{1}) * str2num (dims{3}));
+%!   helpdlg (sprintf ('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
+%! end
+
+%!demo
+%! disp ('- test inputdlg with prescribed scalar (2 lines per text field) and defaults.');
+%! prompt = {'Width','Height','Depth'};
+%! default = {'1.1','2.2','3.3'};
+%! rc = 2;
+%! dims = inputdlg (prompt, 'Enter Box Dimensions',rc,default);
+%! if (isempty (dims))
+%!   helpdlg ('Canceled by user', 'Information');
+%! else
+%!   volume  = str2num (dims{1}) * str2num (dims{2}) * str2num (dims{3});
+%!   surface = 2 * (str2num (dims{1}) * str2num (dims{2}) + ...
+%!                  str2num (dims{2}) * str2num (dims{3}) + ...
+%!                  str2num (dims{1}) * str2num (dims{3}));
+%!    helpdlg (sprintf ('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
+%! end
 
 %!demo
-%!  disp('- test inputdlg with prescribed vector [1,2,3] for # of lines per text field and defaults.');
-%!  prompt = {'Width','Height','Depth'};
-%!  default = {'1.10', '2.10', '3.10'};
-%!  rc = [1,2,3];  % NOTE: must be an array
-%!  dims = inputdlg ( prompt, 'Enter Box Dimensions',rc,default );
-%!  if isempty(dims)
-%!     helpdlg('Canceled by user', 'Information');
-%!  else
-%!     volume  = str2num(dims{1}) * str2num(dims{2}) * str2num(dims{3});
-%!     surface = 2 * (str2num(dims{1}) * str2num(dims{2}) + ...
-%!                    str2num(dims{2}) * str2num(dims{3}) + ...
-%!                    str2num(dims{1}) * str2num(dims{3}));
-%!     helpdlg(sprintf('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
-%!  end
+%! disp ('- test inputdlg with prescribed vector [1,2,3] for # of lines per text field and defaults.');
+%! prompt = {'Width','Height','Depth'};
+%! default = {'1.10', '2.10', '3.10'};
+%! rc = [1,2,3];  % NOTE: must be an array
+%! dims = inputdlg (prompt, 'Enter Box Dimensions',rc,default);
+%! if (isempty (dims))
+%!   helpdlg ('Canceled by user', 'Information');
+%! else
+%!   volume  = str2num (dims{1}) * str2num (dims{2}) * str2num (dims{3});
+%!   surface = 2 * (str2num (dims{1}) * str2num (dims{2}) + ...
+%!                  str2num (dims{2}) * str2num (dims{3}) + ...
+%!                  str2num (dims{1}) * str2num (dims{3}));
+%!   helpdlg (sprintf ('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
+%! end
 
 %!demo
-%!  disp('- test inputdlg with prescribed row by column sizes and defaults.');
-%!  prompt = {'Width','Height','Depth'};
-%!  default = {'1.10', '2.20', '3.30'};
-%!  rc = [1,10; 2,20; 3,30];  % NOTE: must be an array
-%!  dims = inputdlg ( prompt, 'Enter Box Dimensions',rc,default );
-%!  if isempty(dims)
-%!     helpdlg('Canceled by user', 'Information');
-%!  else
-%!     volume  = str2num(dims{1}) * str2num(dims{2}) * str2num(dims{3});
-%!     surface = 2 * (str2num(dims{1}) * str2num(dims{2}) + ...
-%!                    str2num(dims{2}) * str2num(dims{3}) + ...
-%!                    str2num(dims{1}) * str2num(dims{3}));
-%!     helpdlg(sprintf('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
-%!  end
+%! disp ('- test inputdlg with prescribed row by column sizes and defaults.');
+%! prompt = {'Width','Height','Depth'};
+%! default = {'1.10', '2.20', '3.30'};
+%! rc = [1,10; 2,20; 3,30];  % NOTE: must be an array
+%! dims = inputdlg (prompt, 'Enter Box Dimensions',rc,default);
+%! if (isempty (dims))
+%!   helpdlg ('Canceled by user', 'Information');
+%! else
+%!   volume  = str2num (dims{1}) * str2num (dims{2}) * str2num (dims{3});
+%!   surface = 2 * (str2num (dims{1}) * str2num (dims{2}) + ...
+%!                  str2num (dims{2}) * str2num (dims{3}) + ...
+%!                  str2num (dims{1}) * str2num (dims{3}));
+%!   helpdlg (sprintf ('Results:\nVolume = %.3f\nSurface = %.3f', volume, surface), 'Box Dimensions');
+%! end
+
--- a/scripts/ui/listdlg.m
+++ b/scripts/ui/listdlg.m
@@ -94,21 +94,21 @@
 
   ## handle key, value pairs
   for i = 1:2:nargin-1
-    if strcmp (varargin{i}, "ListString")
+    if (strcmp (varargin{i}, "ListString"))
       listcell = varargin{i+1};
-    elseif strcmp (varargin{i}, "SelectionMode")
+    elseif (strcmp (varargin{i}, "SelectionMode"))
       selmode = varargin{i+1};
-    elseif strcmp (varargin{i}, "ListSize")
+    elseif (strcmp (varargin{i}, "ListSize"))
       listsize = varargin{i+1};
-    elseif strcmp (varargin{i}, "InitialValue")
+    elseif (strcmp (varargin{i}, "InitialValue"))
       initialvalue = varargin{i+1};
-    elseif strcmp (varargin{i}, "Name")
+    elseif (strcmp (varargin{i}, "Name"))
       name = varargin{i+1};
-    elseif strcmp (varargin{i}, "PromptString")
+    elseif (strcmp (varargin{i}, "PromptString"))
       prompt = varargin{i+1};
-    elseif strcmp (varargin{i}, "OKString")
+    elseif (strcmp (varargin{i}, "OKString"))
       okstring = varargin{i+1};
-    elseif strcmp (varargin{i}, "CancelString")
+    elseif (strcmp (varargin{i}, "CancelString"))
       cancelstring = varargin{i+1};
     endif
   endfor
@@ -137,7 +137,7 @@
     ## swap width and height to correct calling format for JDialogBox
     listsize = {num2str(listsize(2)), num2str(listsize(1))};
     initialvalue = arrayfun (@num2str, initialvalue, "UniformOutput", false);
-    if isempty(prompt)
+    if (isempty (prompt))
       prompt = {""};
     endif
 
@@ -158,35 +158,37 @@
 
 endfunction
 
+
 %!demo
-%!  disp('- test listdlg with selectionmode single. No caption, no prompt.');
-%!  itemlist = {'An item \\alpha', 'another', 'yet another'};
-%!  s = listdlg ( 'ListString',itemlist, 'SelectionMode','Single' );
-%!  imax = numel (s);
-%!  for i=1:1:imax
-%!     disp(['Selected: ',num2str(i),': ', itemlist{s(i)}]);
-%!  end
+%! disp ('- test listdlg with selectionmode single. No caption, no prompt.');
+%! itemlist = {'An item \\alpha', 'another', 'yet another'};
+%! s = listdlg ('ListString',itemlist, 'SelectionMode','Single');
+%! imax = numel (s);
+%! for i=1:1:imax
+%!   disp (['Selected: ',num2str (i),': ', itemlist{s (i)}]);
+%! end
 
 %!demo
-%!  disp('- test listdlg with selectionmode and preselection. Has caption and two lines prompt.');
-%!  itemlist = {'An item \\alpha', 'another', 'yet another'};
-%!  s = listdlg ( 'ListString',itemlist, ...
-%!                'SelectionMode','Multiple', ...
-%!                'Name','Selection Dialog', ...
-%!                'InitialValue',[1,2,3,4],
-%!                'PromptString',{'Select <b>an</b> item...', '...or <b>multiple</b> items'} );
-%!  imax = numel (s);
-%!  for i=1:1:imax
-%!     disp(['Selected: ',num2str(i),': ', itemlist{s(i)}]);
-%!  end
+%! disp ('- test listdlg with selectionmode and preselection. Has caption and two lines prompt.');
+%! itemlist = {'An item \\alpha', 'another', 'yet another'};
+%! s = listdlg ('ListString',itemlist, ...
+%!              'SelectionMode','Multiple', ...
+%!              'Name','Selection Dialog', ...
+%!              'InitialValue',[1,2,3,4],
+%!              'PromptString',{'Select <b>an</b> item...', '...or <b>multiple</b> items'} );
+%! imax = numel (s);
+%! for i=1:1:imax
+%!   disp (['Selected: ',num2str (i),': ', itemlist{s (i)}]);
+%! end
 
 %!demo
-%!  disp('- test listdlg with listsize.');
-%!  itemlist = {"Neutron","Electron","Quark","Proton","Neutrino"};
-%!  s = listdlg ( "ListString",itemlist,
-%!                "Name","Bits and Pieces",
-%!                "ListSize",[200 75] );
-%!  imax = numel (s);
-%!  for i=1:1:imax
-%!     disp(['Selected: ',num2str(i),': ', itemlist{s(i)}]);
-%!  end
+%! disp ('- test listdlg with listsize.');
+%! itemlist = {"Neutron","Electron","Quark","Proton","Neutrino"};
+%! s = listdlg ("ListString",itemlist,
+%!              "Name","Bits and Pieces",
+%!              "ListSize",[200 75] );
+%! imax = numel (s);
+%! for i=1:1:imax
+%!   disp (['Selected: ',num2str (i),': ', itemlist{s (i)}]);
+%! end
+
--- a/scripts/ui/questdlg.m
+++ b/scripts/ui/questdlg.m
@@ -120,55 +120,56 @@
 
 endfunction
 
+
 %!demo
-%!  disp('- test questdlg with two buttons');
-%!  a = questdlg('Would you like some free money?',...
+%! disp ('- test questdlg with two buttons');
+%! a = questdlg ('Would you like some free money?',...
 %!               '$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $',...
 %!               'No', 'Cancel', 'Cancel');
-%!  if strcmp (a, 'No')
-%!    msgbox('Suit yourself.', 'Message Box');
-%!  endif
+%! if (strcmp (a, 'No'))
+%!   msgbox ('Suit yourself.', 'Message Box');
+%! endif
 
 %!demo
-%!  disp('- test questdlg with message and title only.');
-%!  a = 'No';
-%!  c = 0;
-%!  while (strcmp(a, 'No') || !c)
-%!    a = questdlg('Close this Question Dialog?', 'Reductio Ad Absurdum');
-%!    if strcmp(a, 'Yes')
-%!      q = 'Are you sure?';
-%!      while (strcmp(a, 'Yes') && !c)
-%!        a = questdlg(q, 'Reductio Ad Absurdum');
-%!        word = ' really';
-%!        i = strfind(q, word);
-%!        if isempty( i )
-%!          i = strfind(q, ' sure');
-%!          q = [q '!'];
-%!        else
-%!          word = [word ','];
-%!        endif
-%!        q = [q(1:i-1) word q(i:end)];
-%!      endwhile
-%!    endif
-%!    if strcmp(a, 'Cancel')
-%!      warndlg('Answer "Yes" or "No".', 'Warning Dialog');
-%!      a = 'No';
-%!      c = 1;
-%!    endif
-%!  endwhile
-%!  msgbox('Whew!');
+%! disp ('- test questdlg with message and title only.');
+%! a = 'No';
+%! c = 0;
+%! while (strcmp (a, 'No') || !c)
+%!   a = questdlg ('Close this Question Dialog?', 'Reductio Ad Absurdum');
+%!   if (strcmp (a, 'Yes'))
+%!     q = 'Are you sure?';
+%!     while (strcmp (a, 'Yes') && !c)
+%!       a = questdlg (q, 'Reductio Ad Absurdum');
+%!       word = ' really';
+%!       i = strfind (q, word);
+%!       if (isempty (i))
+%!         i = strfind (q, ' sure');
+%!         q = [q '!'];
+%!       else
+%!         word = [word ','];
+%!       endif
+%!       q = [q(1:i-1) word q(i:end)];
+%!     endwhile
+%!   endif
+%!   if (strcmp (a, 'Cancel'))
+%!     warndlg ('Answer "Yes" or "No".', 'Warning Dialog');
+%!     a = 'No';
+%!     c = 1;
+%!   endif
+%! endwhile
+%! msgbox ('Whew!');
 
 %!demo
-%!  disp('- test questdlg with five inputs');
-%!  ans = questdlg('Are you ready Steve?', 'Brian', 'No', 'Uh huh', 'Uh huh');
-%!  if !strcmp (ans, 'No')
-%!    ans = questdlg ('Andy?', 'Brian', 'No', 'Yeah', 'Yeah');
-%!    if !strcmp (ans, 'No')
-%!      ans = questdlg ('Mick?', 'Brian', 'No', 'Okay', 'Okay');
-%!      if !strcmp (ans, 'No')
-%!        ans = msgbox ("Well all right, fellas.    \n\n     Let''s GO!!!!!",...
-%!                      'Ballroom Blitz', 'none');
-%!      endif
-%!    endif
-%!  endif
+%! disp ('- test questdlg with five inputs');
+%! ans = questdlg ('Are you ready Steve?', 'Brian', 'No', 'Uh huh', 'Uh huh');
+%! if (! strcmp (ans, 'No'))
+%!   ans = questdlg ('Andy?', 'Brian', 'No', 'Yeah', 'Yeah');
+%!   if (! strcmp (ans, 'No'))
+%!     ans = questdlg ('Mick?', 'Brian', 'No', 'Okay', 'Okay');
+%!     if (! strcmp (ans, 'No'))
+%!       ans = msgbox ("Well all right, fellas.    \n\n     Let''s GO!!!!!",...
+%!                     'Ballroom Blitz', 'none');
+%!     endif
+%!   endif
+%! endif
 
--- a/scripts/ui/warndlg.m
+++ b/scripts/ui/warndlg.m
@@ -39,10 +39,12 @@
 
 endfunction
 
-%!demo
-%!  disp('- test warndlg with prompt only.');
-%!  warndlg('Oh, a warning occured');
 
 %!demo
-%!  disp('- test warndlg with prompt and caption.');
-%!  warndlg('Oh, No...','This is the last Warning');
+%! disp ('- test warndlg with prompt only.');
+%! warndlg ('Oh, a warning occured');
+
+%!demo
+%! disp ('- test warndlg with prompt and caption.');
+%! warndlg ('Oh, No...','This is the last Warning');
+
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,7 @@
   -I$(top_srcdir)/liboctave/system \
   -I$(top_srcdir)/liboctave/util \
   -I$(top_srcdir)/libinterp \
-  -I$(top_builddir)/libinterp/interpfcn -I$(top_srcdir)/libinterp/interpfcn \
+  -I$(top_builddir)/libinterp/corefcn -I$(top_srcdir)/libinterp/corefcn \
   -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu
 
 AM_CFLAGS += $(WARN_CFLAGS)
--- a/src/main.cc
+++ b/src/main.cc
@@ -51,3 +51,22 @@
 
   return retval;
 }
+
+
+/*!
+@mainpage Source code documentation for GNU Octave
+
+GNU Octave is a high-level language, primarily intended for numerical
+computations.  It provides a convenient interactive command line
+interface for solving linear and nonlinear problems numerically, and
+for performing other numerical experiments.  It may also be used as a
+batch-oriented language for data processing.
+
+GNU Octave is free software. You may redistribute it and/or modify it
+under the terms of the <a href="http://www.gnu.org/licenses/">GNU
+General Public License</a> as published by the Free Software Foundation.
+
+This is the developer documentation for Octave's own source code. It is
+intended to help for hacking Octave. It may also be useful for
+understanding the Octave API when writing your own .oct files.
+*/
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -34,6 +34,7 @@
   if.tst \
   index.tst \
   io.tst \
+  jit.tst \
   line-continue.tst \
   logical-index.tst \
   null-assign.tst \
--- a/test/error.tst
+++ b/test/error.tst
@@ -18,7 +18,6 @@
 
 ## Test %!error usage
 
-%% test/octave.test/error/error-1.m
 %!function g ()
 %!  error ("foo");
 %!endfunction
@@ -27,7 +26,6 @@
 %!endfunction
 %!error <foo> f ()
 
-%% test/octave.test/error/error-2.m
 %!function g ()
 %!  error ("foo\n");
 %!endfunction
@@ -36,15 +34,12 @@
 %!endfunction
 %!error <foo> f ()
 
-%% test/octave.test/error/error-3.m
 %!error error ()
 
-%% test/octave.test/error/error-4.m
 %!error <foo> error ("foo\n")
 
 ## Test %!warning usage
 
-%% test/octave.test/error/warning-1.m
 %!function g ()
 %!  warning ("foo");
 %!endfunction
@@ -53,7 +48,6 @@
 %!endfunction
 %!warning <foo> f ()
 
-%% test/octave.test/error/warning-2.m
 %!test
 %! st.identifier = "backtrace";
 %! ws = warning ("query", "backtrace");
@@ -67,7 +61,6 @@
 
 ## Test usage() function
 
-%% test/octave.test/error/usage-1.m
 %!function g ()
 %!  usage ("foo");
 %!endfunction
@@ -76,7 +69,6 @@
 %!endfunction
 %!error <foo> f ()
 
-%% test/octave.test/error/usage-2.m
 %!function g ()
 %!  usage ("foo");
 %!endfunction
@@ -85,9 +77,7 @@
 %!endfunction
 %!error <foo> f ()
 
-%% test/octave.test/error/usage-3.m
 %!error usage ()
 
-%% test/octave.test/error/usage-4.m
 %!error <foo> usage ("foo\n")
 
--- a/test/eval-catch.tst
+++ b/test/eval-catch.tst
@@ -16,56 +16,47 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/eval-catch/eval-catch-1.m
 %!test
 %! eval ("clear a; a;", "");
 
-%% test/octave.test/eval-catch/eval-catch-2.m
 %!test
 %! eval ("", "error ('Should not get here');");
 
-%% test/octave.test/eval-catch/eval-catch-3.m
 %!test
 %! eval ("clear a; a; x = 0;", "x = 1;");
 %! assert (x, 1);
 
-%% test/octave.test/eval-catch/eval-catch-5.m
 %!test
 %! eval ("clear a; a; str = '';", "str=lasterr;");
 %! assert (lasterr()(1:13), "'a' undefined");
 %! assert (str(1:13), "'a' undefined");
 
-%% test/octave.test/eval-catch/eval-catch-6.m
 %!test
 %! eval ("error ('user-defined error'); str = '';", "str = lasterr;");
 %! assert (lasterr()(1:18), "user-defined error");
 %! assert (str(1:18), "user-defined error");
 
-%% test/octave.test/eval-catch/eval-catch-7.m
 %!function ms = mangle (s)
 %!  ## Wrap angle brackets around S.
-%!  ms = cstrcat ("<", s, ">");
+%!  ms = ["<" s ">"];
 %!endfunction
 %!test
 %! eval ("clear a; a; str='';", "str = mangle (lasterr);");
 %! assert (mangle (lasterr)(1:14), "<'a' undefined");
 %! assert (str(1:14), "<'a' undefined");
 
-%% test/octave.test/eval-catch/eval-catch-8.m
 %!test
 %! eval ("eval (\"clear a; a;str1='';\", \"str1=lasterr;\"); clear b; b; str2='';",
 %! "str2 = lasterr;");
 %! assert (str1(1:13), "'a' undefined");
 %! assert (str2(1:13), "'b' undefined");
 
-%% test/octave.test/eval-catch/eval-catch-9.m
 %!test
 %! eval ("clear a; a; str1='';",
 %! "eval (\"clear b; b; str2='';\", \"str2=lasterr;\"); str1=lasterr;");
 %! assert (str1(1:13), "'b' undefined");
 %! assert (str2(1:13), "'b' undefined");
 
-%% test/octave.test/eval-catch/eval-catch-10.m
 %!test
 %! eval ("eval (\"clear a; a; str='';\",\"error (cstrcat (\\\"rethrow: \\\", lasterr));str='';\");",
 %! "str=lasterr;");
--- a/test/for.tst
+++ b/test/for.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/for/for-1.m
 %!test
 %! for i = 1
 %!   __printf_assert__ ("%d", i);
@@ -24,7 +23,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1"));
 
-%% test/octave.test/for/for-2.m
 %!test
 %! for i = 1:4
 %!   __printf_assert__ ("%d", i);
@@ -32,7 +30,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1234"));
 
-%% test/octave.test/for/for-3.m
 %!test
 %! for i = [1,2,3,4]
 %!   __printf_assert__ ("%d", i);
@@ -40,7 +37,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1234"));
 
-%% test/octave.test/for/for-4.m
 %!test
 %! for i = [1,2;3,4]
 %!   __printf_assert__ ("%d", i(1,1));
@@ -49,7 +45,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1324"));
 
-%% test/octave.test/for/for-5.m
 %!test
 %! for i = I
 %!   __printf_assert__ ("%d", imag (i));
@@ -57,7 +52,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1"));
 
-%% test/octave.test/for/for-6.m
 %!test
 %! for i = [1,2,3,4]*I
 %!   __printf_assert__ ("%d", imag (i));
@@ -65,7 +59,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1234"));
 
-%% test/octave.test/for/for-7.m
 %!test
 %! for i = [1,2;3,4]*I
 %!   __printf_assert__ ("%d", imag (i(1,1)));
@@ -74,7 +67,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1324"));
 
-%% test/octave.test/for/for-8.m
 %!test
 %! for i = [1,2,3,4]
 %!   if (i > 2)
@@ -85,7 +77,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("12"));
 
-%% test/octave.test/for/for-9.m
 %!test
 %! for i = [1,2,3,4]
 %!   if (i < 3)
--- a/test/global.tst
+++ b/test/global.tst
@@ -16,12 +16,10 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/global/global-1.m
 %!test
 %! global G = 1;
 %! assert (G,1);
 
-%% test/octave.test/global/global-2.m
 %!function f ()
 %!  global G;
 %!  assert (G,1);
@@ -30,7 +28,6 @@
 %! global G = 1;
 %! f;
 
-%% test/octave.test/global/global-3.m
 %!function f ()
 %!  fail ("G");
 %!endfunction
@@ -38,7 +35,6 @@
 %! global G = 1;
 %! f ();
 
-%% test/octave.test/global/global-4.m
 %!function f ()
 %!  global H = 1;
 %!endfunction
@@ -46,7 +42,6 @@
 %!  f;
 %!  fail ("H");
 
-%% test/octave.test/global/global-5.m
 %!function f ()
 %!  global H = 1;
 %!endfunction
@@ -56,7 +51,6 @@
 %!test
 %! g ();
 
-%% test/octave.test/global/global-6.m
 %!function f ()
 %!  global H = 1;
 %!endfunction
@@ -68,7 +62,6 @@
 %! f ();
 %! g ();
 
-%% test/octave.test/global/global-7.m
 %!test
 %!function f ()
 %!  global H = 1;
@@ -76,7 +69,6 @@
 %!test
 %! fail ("H");
 
-%% test/octave.test/global/global-8.m
 %!function f ()
 %!  global H = 1;
 %!endfunction
--- a/test/if.tst
+++ b/test/if.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/if/if-1.m
 %!test
 %! i = 0;
 %! if (i == 0)
@@ -25,7 +24,6 @@
 %! endif
 %! assert (__prog_output_assert__ ("1"));
 
-%% test/octave.test/if/if-2.m
 %!test
 %! if (eye (2))
 %!   __printf_assert__ ("fail\n");
@@ -34,7 +32,6 @@
 %! end
 %! assert (__prog_output_assert__ ("pass"));
 
-%% test/octave.test/if/if-3.m
 %!test
 %! x = 2;
 %! if (eye (2))
@@ -44,7 +41,6 @@
 %! endif
 %! assert (__prog_output_assert__ ("pass"));
 
-%% test/octave.test/if/if-4.m
 %!test
 %! x = 0;
 %! y = -2;
@@ -57,7 +53,6 @@
 %! end
 %! assert (__prog_output_assert__ ("pass"));
 
-%% test/octave.test/if/if-5.m
 %!test
 %! x = 0;
 %! y = -2;
@@ -72,7 +67,6 @@
 %! endif
 %! assert (__prog_output_assert__ ("pass"));
 
-%% test/octave.test/if/if-6.m
 %!test
 %! x = 0;
 %! y = -2;
--- a/test/io.tst
+++ b/test/io.tst
@@ -20,7 +20,6 @@
 ## saving sparse matrices to MAT files when using 64-bit indexing since
 ## that is not implemented yet.
 
-%% test/octave.test/io/load-save.m
 %!function [ret, files] = testls (input)
 %!  ## flag a1 global so as to test the storage of global flags
 %!  global a1;
@@ -232,17 +231,13 @@
 %% FIXME: This test is disabled as it writes to stdout and there is no easy
 %% way to recover output.  Need to spawn new octave process and pipe stdout
 %% somewhere to treat this case.
-%% test/octave.test/io/puts-1.m
 %!#test
 %! puts ("foo\n");
 
-%% test/octave.test/io/puts-2.m
 %!assert (puts (1),-1)
 
-%% test/octave.test/io/puts-3.m
 %!error <Invalid call to puts> puts ()
 
-%% test/octave.test/io/puts-4.m
 %!error <Invalid call to puts> puts (1, 2)
 
 %!assert (sscanf ('123456', '%10c'), '123456')
@@ -277,7 +272,6 @@
 %! assert (msg, "");
 %! assert (pos, 6);
 
-%% test/octave.test/io/sscanf-1.m
 %!test
 %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C");
 %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d");
@@ -287,22 +281,17 @@
 %! && v1 == [1; 2; 3; 4; 5; 6] && c1 == 6 && ischar (m1)
 %! && v2 == [1; 2] && c2 == 2 && ischar (m2)));
 
-%% test/octave.test/io/sscanf-2.m
 %!error <Invalid call to sscanf> sscanf ()
 
-%% test/octave.test/io/sscanf-3.m
 %!error sscanf (1, 2)
 
-%% test/octave.test/io/sscanf-4.m
 %!error <Invalid call to sscanf> sscanf ("foo", "bar", "C", 1)
 
-%% test/octave.test/io/sscanf-5.m
 %!test
 %! [x, n] = sscanf ("   0.024000 0.200 0.200 2.000         1987           5           0  0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 2 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 4 5 1 2    2 5 5 8 2 8 12 6 15 18 28 26 47 88 118 162 192 130 88 56 27 23 14 9 6 3 4 1 0    2 3 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0   0.026000 0.250 0.250 2.100         3115           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0    0 0 0 0 1 0 1 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 1 0 1    1 1 0 1 0 1 3 2 0 5 15 25 44 66 145 179 193 172 104 57 17 11 12 2 1 0 1 1 0 1    0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.028000 0.300 0.300 2.200         4929           3           0  1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0    0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0    1 0 1 0 1 2 2 3 2 3 14 21 49 80 148 184 218 159 124 63 37 13 12 3 1 1 0 0 0 0    0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0    0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.030000 0.350 0.350 2.300         7051           5           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0    0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1    0 0 1 0 0 0 2 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1    0 0 0 2 0 0 0 1 5 6 14 28 51 88 154 177 208 169 124 65 39 15 5 3 3 2 1 0 1 0 1   0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0    0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.032000 0.400 0.400 2.400         9113           4           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0    1 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 2 0    1 0 0 1 1 0 2 3 5 3 17 30 60 117 156 189 209 129 102 64 56 16 11 4 2 2 0 0 0 0   1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0   0.034000 0.450 0.450 2.500        11811           6           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0    0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0    0 0 2 1 0 0 1 0 5 5 15 21 57 99 149 190 195 159 130 69 41 16 10 2 5 3 0 1 0 0    0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.036000 0.500 0.500 2.600        14985           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 0 0 0 0    0 0 0 0 1 0 0 2 2 6 10 34 60 95 126 177 194 155 99 71 44 17 6 7 2 0 0 0 3 0 0    1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.038000 0.550 0.550 2.700        18391           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0    0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 2    1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 2 0 0 1 1 0 1    2 1 0 0 0 1 0 1 3 6 19 27 52 95 161 154 169 134 94 64 37 19 9 6 0 2 1 0 0 0 0    1 2 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 2 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0    0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.040000 0.600 0.600 2.800        22933           5           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1    0 0 0 0 0 2 0 3 4 7 18 27 47 82 134 163 133 138 101 58 34 26 10 5 2 1 2 1 1 0    2 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0   0.042000 0.650 0.650 2.900        27719           5           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 1 0 0 0 1 1 2 8 16 37 51 87 128 153 146 123 105 62 35 24 8 3 5 0 1 2 1 0 0   0 1 1 1 0 0 0 1 0 1 0 0 2 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0    0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.044000 0.700 0.700 3.000        32922           5           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 2 0    0 0 0 0 0 0 0 2 1 0 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 1 1    1 1 0 0 0 1 4 3 5 5 15 35 54 88 132 168 149 105 92 62 30 16 17 4 5 1 0 0 1 0 1   1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.046000 0.750 0.750 3.100        38973           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0    0 0 0 1 0 0 0 4 3 5 20 37 56 94 110 135 149 124 84 58 36 17 14 7 1 0 2 0 1 0 0   1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 0 0 1    1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0    1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.048000 0.800 0.800 3.200        45376           5           0  1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0    0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 2 1 1 2 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0    0 0 0 1 0 0 0 0 1 3 18 34 55 82 104 135 116 99 79 60 51 29 10 4 3 1 1 1 0 0 1    0 0 0 1 0 0 3 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1    0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0    1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.050000 0.850 0.850 3.300        52060           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0 1 1 0 0 0 1    0 0 0 0 0 2 2 1 3 12 24 40 39 107 121 127 138 100 86 68 44 23 15 7 3 1 1 0 1 1   0 0 2 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 2 0 0 0 1 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.052000 0.900 0.900 3.400        59454           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0 1    0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0    0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 2 0 2 1 0 0 0 1 0    0 1 0 0 0 0 0 3 3 6 21 32 68 90 132 111 122 107 73 57 47 24 11 7 4 2 2 1 0 0 0   0 0 0 0 0 1 0 0 1 0 0 2 0 1 1 0 0 1 0 0 0 0 0 3 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0    0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0   0.054000 0.950 0.950 3.500        67013           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 1 0 0 0    1 0 1 0 1 2 4 3 7 9 28 31 71 94 115 96 108 78 82 60 38 17 12 11 4 3 1 1 0 2 1    0 0 0 2 1 3 0 0 0 0 3 0 0 1 0 0 0 0 0 0 0 2 0 0 0 1 0 2 0 1 0 2 0 1 0 0 1 0 0    0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0   0.056000 1.000 1.000 3.600        75475           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 2 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 3 0 0 1    1 2 0 1 4 0 1 8 6 7 17 41 56 71 109 113 84 103 72 54 35 22 6 9 1 7 5 4 0 0 1 0   0 0 0 0 0 1 0 0 2 1 0 0 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 1 0 2 0 1 0 0 0 0 1 0 1    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 3 0 0 0 1 0 0 0 0 0 0 1 1 0 0 2 0 0 0 0    0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0   0.058000 1.050 1.050 3.700        83558           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0    0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 2 0 0    2 0 0 1 0 3 2 3 6 15 27 41 77 73 94 94 92 76 61 56 42 23 13 11 6 2 1 2 0 1 2 0   0 1 0 1 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 2 0 0 0 0 0 1 2 0    0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0   0.060000 1.100 1.100 3.800        93087           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1    0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 2 2 0 0 0 1 0 1 1 0 0 0 1 1 0 4    0 0 1 2 0 3 1 3 5 13 33 31 65 75 77 96 97 80 59 45 36 32 18 2 5 0 1 0 0 1 0 0    3 0 0 0 0 1 0 0 0 0 0 1 0 0 1 2 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 0 2 0 0 2 0 1 0    0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0    0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.062000 1.150 1.150 3.900       102829           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0    0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0    0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 0 2 0 2    1 2 0 0 2 4 3 5 11 9 23 43 53 68 65 87 83 77 59 49 34 18 15 9 4 2 3 2 0 0 0 4    0 1 1 0 0 2 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 2 0 0 0 0 1 0 0 1 1 1 1 0 0 0 1 0    0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0   0.064000 1.200 1.200 4.000       113442           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0    0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 1 1 1 0 1 1 1 1 1 0 0 0 1    2 0 0 0 2 0 4 5 11 13 29 39 61 68 61 75 76 74 73 44 37 29 19 6 3 3 2 0 1 2 1 0   0 0 0 1 1 1 0 1 1 0 0 0 1 0 1 1 0 1 2 0 2 1 1 1 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0    0 0 0 0 1 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0    0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0   0.066000 1.250 1.250 4.100       126668           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0    0 0 1 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1    0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 1 1 2 3 0 2 1 2 0 1 0 3 0 0 0 1 0 1 1 3    0 0 1 3 0 2 4 3 12 12 30 48 56 66 77 78 71 82 52 31 32 19 20 16 8 2 1 3 0 0 2    1 0 1 0 1 0 0 0 1 3 1 0 1 0 1 1 1 0 0 0 0 0 2 0 2 0 0 0 0 0 1 0 0 0 0 1 1 0 0    0 0 0 1 0 0 0 0 0 2 0 3 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0    0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.068000 1.300 1.300 4.200       138042           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 2 0 0 1 0 1 0 0 0 0 0    0 0 0 1 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0    0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 3 0 0 1 0 0 1 2 0 0 0 3 0 1 0 0 3 0    1 0 1 1 3 1 4 7 11 14 27 36 44 68 72 70 71 45 44 46 29 13 16 11 5 2 0 3 0 0 0    0 1 1 2 0 0 1 1 2 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 2 0 0 1 1 0 1 1 1 0    0 1 0 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0    0 0 0 1 0 0 1 0 0 0 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   0.070000 1.350 1.350 4.300       152335           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0    0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0    1 0 0 0 2 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 2 0 0 0 0 1 1 1 0 1 1 0 1 1 1 1 0 2 0    0 0 0 0 2 0 1 7 14 19 34 35 54 72 68 72 68 58 48 36 37 27 25 17 1 4 1 0 0 0 1    2 2 0 0 1 1 1 2 1 0 3 1 0 1 0 2 1 0 0 0 1 1 1 2 0 0 0 0 1 1 0 1 1 0 2 1 1 1 1    0 0 0 1 1 0 0 2 0 0 1 0 0 0 1 1 0 2 1 1 0 0 0 0 2 0 0 0 0 0 0 0 1 1 0 0 0 0 1    0 0 1 0 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0   0.072000 1.400 1.400 4.400       166280           4           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0    0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0    2 0 0 0 0 0 0 0 1 0 1 0 1 1 1 0 0 1 0 1 0 0 3 4 2 2 0 0 0 0 0 1 1 3 1 0 3 2 2    1 2 2 0 2 2 1 8 14 26 24 29 47 47 68 65 63 55 42 41 26 29 17 8 4 4 1 0 1 2 0 0   0 1 1 2 0 1 2 1 0 0 1 1 1 0 0 1 0 0 0 1 0 0 1 2 1 2 1 0 0 0 0 0 1 1 2 0 2 2 0    0 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0    0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0   0.074000 1.450 1.450 4.500       179484           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0    1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 1 0 1 0 0 1 0 1 2 0 0 0 0 0 0 0 0 0 1 0    0 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 2 0 0 1 1 2 1 0    1 1 2 2 0 1 5 6 10 20 43 50 57 62 53 62 66 45 42 33 27 26 23 14 3 0 2 0 1 0 0    1 1 0 0 2 1 1 0 0 3 0 1 1 1 0 1 1 0 1 0 1 2 1 0 0 1 2 0 2 0 0 0 0 1 1 3 1 0 0    2 1 1 1 0 0 0 0 0 0 1 2 0 1 0 0 0 0 0 1 1 0 2 0 0 0 0 0 1 0 2 1 0 0 0 0 0 0 1    0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0   0.076000 1.500 1.500 4.600       197657           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0    0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 2 0 0 0 1 0 0 0 0    0 0 1 0 1 0 0 0 0 0 0 0 0 1 2 0 0 0 2 1 1 0 1 1 0 1 1 3 2 1 1 2 1 0 1 0 0 0 0    0 1 1 1 0 5 3 7 12 24 38 32 41 48 54 66 71 49 46 31 38 25 15 8 6 6 5 0 1 3 0 1   1 1 1 1 0 1 2 0 1 0 0 0 1 0 2 1 2 0 0 0 0 1 3 1 0 0 0 0 1 1 0 1 0 1 1 1 1 1 0    4 1 1 1 0 3 0 0 0 2 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0    0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0   0.078000 1.550 1.550 4.700       212054           3           0  0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0    0 1 0 1 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1    0 0 2 0 0 0 1 0 0 1 0 1 1 0 1 3 1 0 0 1 2 0 0 0 1 0 0 0 0 0 2 1 2 1 1 1 0 0 1    5 1 1 2 3 5 7 9 11 22 31 37 48 50 52 54 57 37 38 38 33 24 11 19 11 3 1 2 0 3 3   2 1 0 1 3 0 1 1 1 1 1 2 0 0 0 1 1 2 0 1 1 3 0 1 1 0 0 1 0 2 0 1 0 0 1 3 0 2 0    1 0 1 2 0 1 1 1 1 1 0 3 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0    0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0   0.080000 1.600 1.600 4.800       231971           3           0  0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 2 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1    0 0 0 0 2 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 2 1 0 1 1 1 0 1 0 0 1 0 1 3 0 0 0 1 0    0 0 1 1 1 0 0 4 1 1 0 2 0 1 1 1 2 0 0 0 1 0 1 2 1 2 3 2 0 1 0 4 3 1 1 1 1 3 1    0 0 0 2 1 0 2 7 17 13 29 47 58 59 52 38 51 51 38 34 35 21 14 13 4 1 0 1 1 1 0    2 2 4 1 0 1 1 4 0 0 0 2 0 2 2 2 0 0 1 3 2 1 1 2 2 2 2 1 0 3 0 2 1 2 1 2 2 0 0    1 1 0 2 0 2 2 0 1 0 2 2 3 1 2 3 1 1 0 1 0 2 0 1 2 1 2 0 2 1 0 0 3 0 0 1 1 1 1    0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0   0.082000 1.650 1.650 4.900       252503           3           0  0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 2 0 0    0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0    0 0 0 0 2 0 0 1 0 1 2 2 2 1 0 2 0 1 0 1 1 2 2 0 3 0 0 4 1 0 0 3 0 0 1 2 0 1 1    1 3 0 1 0 2 9 11 25 27 34 53 41 49 43 47 36 31 38 22 30 22 18 9 5 9 2 2 1 2 2    3 1 4 1 1 0 0 1 2 0 2 1 0 0 1 3 2 2 1 0 0 0 1 2 1 0 0 0 2 1 1 0 2 0 0 1 0 0 2    1 3 1 1 1 0 2 1 1 0 2 1 0 1 3 0 0 0 0 2 0 0 1 0 0 0 0 0 1 2 1 1 1 0 2 1 0 0 0    2 0 1 0 0 0 0 1 0 0 0 0 1 0 0 2 0 1 0 1 0 0 0 0 0 0 0 0 0 0   0.084000 1.700 1.700 5.000       267889           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 1 0 1    0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0    0 1 0 1 1 0 3 0 1 1 1 0 1 2 1 0 2 0 2 4 0 1 0 0 0 1 1 0 1 3 2 0 2 0 4 0 0 2 0    1 4 2 4 3 3 6 10 14 28 37 54 36 40 52 40 50 46 40 32 26 29 12 18 5 2 0 2 4 1 2   1 0 2 1 2 2 1 0 1 0 2 1 2 4 1 1 5 1 0 2 0 1 2 3 2 2 1 2 1 0 2 1 2 1 1 4 1 2 1    4 0 2 2 0 0 3 1 0 2 0 0 1 1 1 0 0 2 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 0 0 1 0    0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0   0.086000 1.750 1.750 5.100       290294           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 2 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0    0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 3 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 2    1 0 1 0 1 0 0 2 2 0 1 2 2 0 2 0 2 0 1 0 0 1 1 1 3 1 1 1 1 3 4 1 1 2 2 2 1 0 3    0 0 0 2 4 5 6 16 18 20 31 40 54 55 46 41 52 35 27 21 28 27 20 15 8 6 7 1 0 0 3   0 0 2 2 0 3 1 3 1 1 2 0 0 1 2 1 3 2 0 1 2 1 3 1 1 1 1 1 2 0 2 1 0 1 1 1 3 1 1    2 0 1 0 1 0 2 1 1 0 0 1 2 0 3 1 1 0 0 0 1 3 1 1 1 0 0 1 2 1 0 0 1 1 1 0 0 1 0    0 0 0 0 0 2 0 1 0 0 0 2 1 0 2 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0   0.088000 1.800 1.800 5.200       312476           6           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 1 0 1 1 0 0 0 0    0 0 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 0 0 0 1 0 1 0 0 0 0 0 0 2    1 0 0 1 0 0 1 1 1 1 4 2 0 1 0 0 3 0 0 0 0 0 1 1 4 0 0 0 0 1 1 2 1 0 3 0 0 2 2    4 0 3 1 6 9 10 13 21 24 32 43 33 41 43 49 50 32 26 31 27 12 16 17 3 3 3 5 0 3    0 2 1 3 3 2 1 2 3 1 2 1 1 1 2 0 1 1 0 2 0 3 0 0 2 0 0 0 0 1 0 1 1 3 3 0 1 1 1    1 1 1 2 2 2 0 3 1 0 2 2 2 0 0 0 0 3 1 2 5 1 1 2 0 0 3 3 0 2 2 0 0 0 0 1 2 0 0    1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0   0.090000 1.850 1.850 5.300       337348           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 2 0 1 0 1 0 0 0 1 0 0 0    0 0 0 1 0 0 0 0 2 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0    2 0 0 0 1 3 2 0 0 2 2 3 3 2 2 2 0 0 1 1 3 1 3 0 0 0 0 0 0 1 2 1 2 1 2 2 2 0 1    1 0 4 2 2 7 6 15 22 21 39 37 50 31 51 30 33 34 34 26 21 14 13 10 9 4 3 3 4 2 2   0 1 2 3 3 0 1 3 2 5 3 2 2 4 0 2 3 0 4 2 1 2 2 2 4 2 1 3 1 3 2 1 3 1 2 4 1 1 1    1 2 4 1 3 3 3 1 0 4 1 0 1 1 1 1 2 3 0 3 0 0 4 1 1 1 0 2 2 2 1 2 2 0 1 1 0 0 0    2 0 1 0 1 0 0 1 0 0 0 1 3 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0   0.092000 1.900 1.900 5.400       357303           3           0  0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0    0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 1 3 1 0 1 0 0 0 0 1 0 0 1 0 0 1 1 2 2 0 0 2    2 1 1 1 1 1 1 0 1 0 0 1 1 1 3 1 1 1 1 1 0 1 4 0 1 1 1 3 0 1 1 2 2 2 0 2 3 2 2    2 2 1 2 1 3 8 22 14 32 36 46 39 42 39 29 36 38 26 24 26 18 16 19 10 9 3 6 5 0    3 2 1 1 1 2 0 2 1 1 0 1 1 3 1 0 2 4 2 2 1 4 1 2 2 1 1 0 1 2 0 2 2 2 4 2 1 1 0    2 1 3 1 2 3 4 2 3 2 3 0 1 2 1 0 0 0 4 1 1 1 2 1 3 1 0 5 1 0 0 0 0 0 0 1 0 2 0    1 2 1 0 1 0 0 0 0 0 1 1 0 1 0 1 4 0 0 0 1 0 1 0 0 0 0 0 0 0 0   0.094000 1.950 1.950 5.500       383138           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0    0 0 1 0 0 2 1 0 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 2 1 1 1 1    2 1 0 2 0 1 0 3 2 1 3 0 1 3 1 1 0 5 0 1 0 1 2 0 0 1 1 2 0 0 6 1 0 3 2 2 3 4 5    0 4 2 1 5 4 11 15 22 27 28 57 38 38 40 38 39 38 27 26 30 18 14 10 10 4 4 4 3 3   2 2 2 2 1 1 1 1 2 2 3 4 1 2 3 1 2 1 2 2 2 1 3 2 1 5 0 1 1 1 3 2 2 2 1 3 1 1 0    3 2 2 0 0 2 2 2 0 0 0 2 0 1 3 1 2 3 2 1 1 0 1 1 1 0 3 2 2 1 0 0 1 3 1 1 0 1 0    0 0 0 0 1 0 0 0 0 1 0 0 3 1 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0   0.096000 2.000 2.000 5.600       409868           3           0  0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 2 0 0    1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 2 0 1 0 0 2 0 2 0 0 0 0 1 0 0 2 1    2 2 2 1 2 1 1 1 1 1 2 0 0 1 1 0 1 0 2 1 2 0 2 0 3 1 2 1 3 1 5 0 2 2 1 2 4 1 2    0 3 1 4 7 5 9 13 22 19 31 27 28 41 34 39 37 22 23 21 22 17 23 15 8 9 3 8 0 3 1   2 2 2 3 1 0 4 2 4 2 2 2 2 4 2 1 1 0 2 0 3 0 3 2 2 1 2 2 1 4 1 2 2 1 1 5 2 1 2    1 2 2 1 0 2 4 3 2 1 2 2 3 2 3 1 2 1 1 1 1 2 1 1 2 2 1 2 3 2 1 1 0 2 2 4 0 1 1    1 1 1 0 0 1 1 3 0 0 0 0 0 1 0 0 2 0 1 2 0 1 1 1 0 1 0 1 0 0   0.098000 2.050 2.050 5.700       439102           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 1 1 0 0 1 0 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 0    0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 2 0 0 1 1 1 1 2 0 1 1 0 0 0 0 1 1 1 0 4 0 0    0 2 1 1 0 3 4 0 1 2 2 1 0 3 0 3 2 0 0 2 0 1 0 0 1 0 1 3 1 3 5 0 2 2 3 5 2 2 2    0 3 2 3 6 5 16 21 19 23 28 29 35 42 42 44 39 33 23 30 18 25 24 15 13 5 4 2 2 0   3 3 0 0 1 3 0 1 1 3 2 4 3 4 2 1 1 1 3 1 0 0 2 2 4 2 2 1 4 2 4 2 2 2 1 2 2 1 2    0 4 2 2 3 1 2 1 1 2 2 1 2 4 2 1 4 1 2 2 2 2 0 2 0 3 0 1 0 2 1 0 4 2 1 3 2 1 0    2 1 1 1 1 0 1 1 2 1 1 1 2 0 1 0 2 1 1 0 0 1 0 0 1 0 0 0 0 0 0   0.100000 2.100 2.100 5.800       467340           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 1 0 0 1 2 0 0 0 0 0 1 0 2 0 0 2 0 0 1 1 0 0    0 1 0 0 1 1 0 0 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 1 2 0 2    2 4 1 0 1 1 2 3 4 1 4 1 5 1 2 1 0 2 2 2 1 5 4 1 5 4 0 1 2 4 2 2 0 2 1 2 5 4 1    1 1 2 5 7 9 16 23 31 15 22 36 36 44 42 29 31 28 28 18 35 12 10 13 8 4 3 2 2 5    1 2 3 3 1 3 3 5 2 0 3 4 1 2 2 3 0 0 5 2 3 6 2 1 2 5 3 4 3 1 1 1 1 2 2 4 0 2 3    1 2 1 2 4 5 4 3 5 2 1 2 0 5 0 2 2 4 1 0 4 1 0 2 1 2 0 0 1 3 2 4 3 0 2 3 3 3 4    2 2 0 0 0 0 1 1 0 3 2 0 1 2 0 4 2 1 1 1 2 0 0 0 0 0 0 0 0 0 0   0.102000 2.150 2.150 5.900       497495           5           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 2 1 0 0 0 0 1 0 1 0 0 0 0 1 2    0 0 0 0 0 2 0 0 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 2 0 0 1 0 0 0 1 0 2 2 1 0 0 0    2 0 2 1 1 1 6 3 2 0 3 2 2 2 1 1 3 4 1 0 1 2 4 2 3 3 1 1 1 1 3 3 1 4 1 3 4 3 2    3 1 2 2 5 11 11 14 26 27 28 28 28 36 39 42 29 33 24 20 29 18 13 17 13 6 10 4 3   3 6 1 0 1 0 2 1 3 2 3 1 2 3 1 2 1 2 0 2 2 3 1 3 1 1 2 4 4 1 4 3 2 2 3 5 5 3 0    2 5 3 5 1 4 1 1 3 4 2 2 2 2 1 3 0 1 1 2 2 4 2 1 3 2 0 1 2 1 0 2 3 1 2 0 0 0 2    0 0 1 3 0 0 1 2 0 3 1 0 3 1 2 2 1 1 2 0 0 0 0 2 0 0 1 0 0 0 0 0   0.104000 2.200 2.200 6.000       529288           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 2 0 0    0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 1 3 0 2 0 2 0 0    3 2 2 0 4 0 3 2 2 1 3 1 7 3 1 1 0 4 3 2 1 0 0 3 2 3 5 2 1 4 1 5 1 0 3 2 3 0 1    2 4 7 3 7 8 12 15 20 24 34 39 34 35 27 36 34 23 22 26 15 24 12 12 14 5 3 0 7 1   1 3 5 1 2 2 2 4 3 1 2 5 2 2 3 1 1 4 2 1 3 0 4 5 4 6 4 5 3 3 3 3 1 1 5 0 6 1 2    4 2 3 2 1 3 2 0 0 0 1 3 3 0 1 4 0 3 2 3 0 3 3 0 2 3 4 3 1 1 1 2 5 3 1 2 1 1 2    4 1 0 2 4 1 3 0 0 3 0 1 3 0 1 0 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0   0.106000 2.250 2.250 6.100       560628           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 2 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 1    1 0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 2 0 0 0 0 2 0 3 1 1 0 0 2 2 2 0 5 2 1    1 1 1 3 1 2 3 0 1 0 0 0 0 1 0 2 2 1 2 1 0 4 3 2 1 2 1 0 4 2 2 0 2 1 1 2 3 1 2    1 2 4 4 11 12 17 19 19 29 30 24 30 35 51 32 36 34 31 19 22 17 11 19 11 7 6 6 3   4 0 3 3 2 0 2 2 2 3 1 5 3 2 3 5 1 0 2 2 5 4 2 3 2 0 1 6 1 2 2 2 2 1 1 2 2 1 4    3 2 2 1 2 5 2 0 2 0 2 5 4 5 2 1 3 6 1 3 4 4 0 0 6 0 2 6 1 2 2 2 0 1 3 1 3 4 2    1 4 2 1 2 3 3 0 3 1 0 2 0 2 1 0 2 1 2 0 0 1 1 0 2 0 0 0 0 0 0 0   0.108000 2.300 2.300 6.200       593293           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 2 0 2 2 1 0 0 2 0 1 0 1 0 0 1 2 2 1 0    0 1 0 2 0 0 0 0 0 1 1 1 1 1 0 0 1 1 0 0 1 1 1 2 2 1 0 1 1 0 1 5 0 2 4 1 0 1 4    2 1 3 2 2 3 2 3 2 0 0 3 4 3 1 3 2 2 0 3 0 2 4 0 3 2 5 1 2 1 4 6 1 2 4 0 3 6 1    7 6 4 5 4 10 16 24 22 20 40 37 44 34 29 21 28 36 36 27 23 24 14 10 4 5 2 5 3 6   2 3 3 1 4 2 1 5 1 3 5 3 2 1 2 2 6 2 3 1 1 0 5 3 3 3 4 5 2 2 3 3 5 5 1 6 2 3 2    6 0 5 2 4 3 5 1 2 2 5 1 2 3 1 2 2 2 4 2 5 5 2 2 2 5 0 1 2 5 2 3 2 3 1 1 2 4 0    2 1 4 2 1 1 1 0 1 2 0 0 1 3 1 0 2 1 1 3 3 2 0 0 0 1 2 0 0 0 0   0.110000 2.350 2.350 6.300       636559           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0 0 1 1 2 0 0 1 0 0 0 0 0 0 0    1 2 0 0 1 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0 2 0 1 0 1 0 1 0 0 1 1 3 0 1 2 2 0 2 1    1 1 1 0 1 0 1 3 0 3 2 3 4 3 3 4 3 3 2 6 3 1 1 1 2 4 2 3 1 5 1 3 1 4 5 3 3 2 1    3 7 4 3 10 19 17 19 23 27 28 33 39 36 23 23 32 32 16 19 35 23 12 11 12 8 4 5 7   1 2 2 1 2 3 5 4 2 3 2 6 4 4 2 4 1 2 2 1 2 3 0 4 2 1 2 6 2 2 1 3 3 1 6 4 8 5 2    3 5 2 3 0 3 2 3 1 2 2 3 4 3 8 6 2 1 4 6 3 1 2 0 2 0 2 5 0 3 3 3 3 1 3 3 2 5 4    2 1 4 2 2 4 4 1 3 2 5 2 3 1 2 0 4 0 1 0 6 3 1 2 0 2 0 1 0 0 0 0   0.112000 2.400 2.400 6.400       670484           3           0  0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 2    0 1 1 1 3 0 0 0 2 1 3 0 1 1 1 0 1 1 1 0 0 1 2 0 1 3 1 5 2 3 0 4 0 2 0 0 1 2 1    0 1 0 0 1 0 2 2 3 2 3 2 2 2 3 4 4 2 3 5 3 3 2 3 3 4 2 4 0 3 2 4 4 1 3 1 3 4 2    2 5 2 8 6 12 17 14 22 27 26 29 39 30 24 36 22 22 20 9 19 15 5 12 16 4 7 5 7 5    5 1 4 5 5 4 4 1 4 4 3 3 3 4 2 2 4 2 4 4 4 4 0 2 3 2 1 4 3 6 1 3 3 3 4 5 4 2 2    2 5 3 0 2 5 4 2 5 3 5 1 1 3 1 1 3 6 6 2 3 2 0 3 2 4 3 4 1 2 2 6 2 0 3 2 2 5 3    3 5 2 1 0 3 1 1 2 2 0 1 1 3 2 3 2 1 1 1 1 3 2 1 0 0 0 0 0 0 0   0.114000 2.450 2.450 6.500       711783           4           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 1 0 2 1 2 0 1 0 0 1 0 0 1 1 1 1 0 0 0 1    1 2 0 1 1 0 0 0 2 1 1 1 1 1 2 1 2 3 3 1 1 1 2 3 1 3 2 2 1 0 1 1 4 4 4 1 0 4 0    0 1 1 2 1 3 2 0 3 4 1 1 1 1 3 2 0 1 3 2 1 2 1 0 3 3 2 5 4 2 5 3 4 2 2 5 3 3 3    3 5 5 8 7 14 12 28 22 24 23 36 33 26 32 27 26 18 30 24 15 13 19 15 17 6 5 7 5    4 3 5 3 1 4 4 9 5 3 1 4 0 0 6 2 5 3 3 3 1 2 3 2 4 1 5 5 3 8 2 1 1 4 1 7 5 6 6    4 4 3 2 6 3 3 3 3 1 3 4 5 4 3 4 3 1 2 3 1 2 1 2 2 6 5 2 2 2 4 2 2 0 2 3 3 2 7    4 4 1 4 2 0 3 1 1 2 1 2 3 1 3 2 2 4 3 1 4 0 0 4 2 2 2 1 0 0 0 0   0.116000 2.500 2.500 6.600       745364           5           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 1 2 1 1 2 1 1 1 0 1 0 2 0 1 1    0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 2 3 0 1 4 4 0 4 0 1 0 1 3 3 0 2 1 2 3    2 1 1 1 2 0 4 0 0 4 5 2 5 4 1 3 5 5 4 0 4 4 2 3 2 3 5 2 2 4 2 3 4 2 3 3 3 3 3    2 4 12 10 13 14 19 22 23 24 36 19 32 25 25 36 24 18 20 21 14 18 13 8 6 9 2 9 5   2 5 3 4 4 3 3 0 4 3 2 5 3 4 2 2 6 3 4 0 2 4 1 3 4 7 4 5 3 2 4 5 5 3 4 4 4 2 3    2 4 4 2 1 5 7 1 5 2 4 1 5 5 3 4 4 3 2 4 2 4 0 6 2 3 4 1 2 2 2 4 1 4 2 2 2 5 6    5 1 4 4 2 3 3 3 1 4 3 4 2 6 2 5 3 2 2 1 3 2 2 5 1 1 0 0 1 0 0 0   0.118000 2.550 2.550 6.700       791846           4           0  0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 2 1 1 0 0 0 0 0 1 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0    1 4 1 2 3 0 3 1 0 1 1 1 0 3 1 2 1 1 1 0 0 1 1 1 3 1 3 2 3 1 2 2 1 3 2 4 1 4 0    2 4 1 4 3 2 1 1 2 1 3 2 3 3 2 1 1 5 3 3 3 3 2 3 4 3 5 3 1 1 2 2 3 5 1 2 1 1 4    4 6 9 6 6 13 17 21 20 24 22 25 20 29 23 28 30 26 27 18 20 17 16 17 12 10 8 5 6   6 6 4 3 1 2 4 6 9 2 2 3 5 7 6 2 3 8 5 4 5 6 4 6 5 3 5 3 2 5 3 2 8 3 5 4 5 3 5    4 3 4 8 4 3 8 3 3 3 1 1 2 2 5 4 7 3 2 3 3 2 2 3 6 3 2 2 1 1 5 2 5 6 3 5 3 4 1    3 1 2 1 0 4 1 4 2 2 2 3 1 1 1 1 3 2 0 1 6 1 1 0 2 1 0 1 0 0 0 0   0.120000 2.600 2.600 6.800       833394           3           0  0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 2 1 1 1 2 1 0 0 0 1 0 1 0 0 0 1 0 0 1 1 2 1 0 0    0 0 0 2 2 0 3 1 0 0 2 1 1 1 1 0 1 2 1 5 0 1 0 2 2 1 2 0 4 2 1 4 3 4 2 2 1 2 1    5 2 3 1 3 0 2 2 2 2 3 4 0 4 2 3 3 4 5 2 2 6 3 4 5 5 5 3 4 6 5 1 3 0 5 4 5 1 3    2 2 6 18 13 17 27 27 21 28 28 24 26 27 29 23 21 16 17 19 22 14 11 9 5 14 7 7 6   4 4 12 3 6 4 5 4 6 4 2 0 1 8 1 6 8 5 2 3 4 5 6 4 2 5 8 3 1 1 6 3 7 8 4 1 6 5 2   8 11 5 6 5 6 2 4 5 1 2 7 2 2 5 5 6 3 3 2 3 8 5 1 9 3 3 2 3 6 3 5 3 2 4 6 3 1 3   5 4 4 4 6 3 3 5 0 2 2 5 1 3 2 2 1 4 2 0 2 2 2 2 4 1 2 1 2 1 1 0   0.122000 2.650 2.650 6.900       876007           3           0  0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 2 1 1 1 1 2 2 1 0 0 1 0 0 0 1 1 0 0 0 2 0 0    4 1 0 2 1 2 0 1 2 0 1 3 2 1 0 1 1 0 1 2 1 0 2 3 3 5 3 3 3 0 1 4 0 1 5 3 4 3 1    2 2 2 4 1 3 3 3 2 3 2 3 2 1 4 4 2 2 5 5 3 4 1 2 1 2 4 2 4 7 2 4 4 2 7 3 5 7 5    3 6 8 10 10 18 21 22 24 14 25 27 29 31 22 25 24 21 27 20 19 22 19 14 13 14 10    5 7 3 4 5 5 3 1 4 3 8 4 5 4 0 3 4 3 4 1 7 6 1 1 3 4 4 3 4 3 6 4 3 4 2 4 4 3 5    6 5 1 1 6 2 6 6 3 5 5 3 2 6 5 4 3 4 6 4 3 5 5 6 5 6 2 4 2 1 2 2 4 2 7 6 2 1 3    1 5 2 1 2 4 3 3 3 2 5 2 4 1 4 3 2 2 5 5 1 1 3 3 2 2 2 2 1 0 0 0 0 0   0.124000 2.700 2.700 7.000       925764           3           0  0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 2 1 3 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 1 1 0    1 2 0 0 3 2 0 1 2 1 1 2 0 2 1 2 2 0 0 2 3 2 3 2 2 3 2 2 4 0 2 0 5 1 3 2 3 1 2    3 2 0 6 4 3 6 2 5 0 5 2 1 4 4 5 7 4 2 3 5 2 0 2 5 2 4 7 4 4 4 8 5 3 1 7 2 2 1    5 5 5 14 19 16 22 18 30 29 25 36 23 23 22 25 25 27 26 23 14 20 16 16 10 6 6 6    4 2 6 6 6 6 6 4 6 1 0 3 4 4 5 2 4 3 2 4 4 5 5 5 6 10 6 3 6 8 5 5 8 7 4 6 4 3 4   8 5 5 7 4 6 3 5 8 4 3 4 4 3 4 3 1 3 3 7 2 4 8 3 6 4 3 3 2 5 4 4 3 7 4 5 4 4 3    4 7 2 3 3 4 3 0 2 2 4 3 4 2 4 2 2 6 4 4 6 6 1 5 1 1 2 1 0 0 0 0 0   0.126000 2.750 2.750 7.100       969560           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 1 1 0 1 2 0 2 0 2 2 0 1 1 1 0 0 1 0 1 1 1 1 2 0    1 2 2 1 2 0 0 1 0 1 0 2 1 0 1 0 1 1 2 0 3 0 3 4 3 1 3 2 0 4 0 1 2 0 3 1 1 2 3    2 2 2 5 1 7 1 5 1 5 4 2 0 0 1 2 1 3 2 3 3 5 4 10 10 2 5 11 4 1 2 1 7 3 5 4 4 1   5 10 8 7 9 9 20 20 21 33 21 28 20 27 32 21 29 22 20 24 15 13 27 14 13 15 10 9    3 11 6 7 5 3 6 8 5 4 4 1 3 3 5 2 7 3 6 6 1 6 4 6 5 3 4 2 4 3 3 9 4 5 4 4 5 2 3   10 4 3 2 6 10 6 3 6 5 5 5 4 8 8 5 4 3 6 4 4 2 4 4 4 5 7 4 4 4 4 5 2 2 3 4 5 2    1 3 2 6 2 7 7 1 6 4 4 6 5 5 4 0 2 2 3 2 7 5 0 4 1 1 4 6 1 0 3 2 0 0 1   0.128000 2.800 2.800 7.200      1022713           5           0  0 0 0 0 0 0 0 0 0 0 0 1 0 2 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 2 1 0 0 4 0 0 1 2 3    1 1 0 1 0 1 0 3 1 1 1 2 2 1 1 1 3 1 0 2 4 2 1 2 1 2 0 3 1 3 2 1 5 2 1 3 1 2 1    5 3 2 1 2 5 3 8 2 3 2 5 5 4 3 6 4 4 4 3 2 3 8 4 3 4 5 4 5 4 7 6 5 3 3 3 5 2 9    10 7 9 12 11 13 17 15 22 19 33 24 28 30 26 21 24 22 27 20 26 16 10 10 9 20 10    7 4 5 7 7 2 7 5 3 5 1 6 1 5 7 5 6 3 1 5 1 1 3 4 8 6 3 9 5 5 3 6 7 4 6 7 6 4 2    4 6 2 3 6 5 6 7 6 4 4 9 6 8 6 9 7 1 2 6 2 7 5 4 4 4 4 5 5 4 4 3 6 3 5 3 6 4 3    6 6 2 5 2 8 4 5 3 6 5 4 5 8 4 3 5 6 5 5 2 8 1 2 2 5 4 1 3 0 0 0 0 0   0.130000 2.850 2.850 7.300      1081669           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 5 0 0 2 2 0 0 1 0 0 0 1 1 0 2 0 2 2 2 1 0    1 0 2 2 3 1 1 0 2 0 1 0 2 1 1 2 2 0 1 4 3 0 2 1 1 0 2 5 2 1 0 1 3 2 5 2 1 2 5    2 3 4 3 6 6 6 4 6 6 3 1 3 2 3 4 7 5 2 9 7 4 1 4 4 3 2 2 2 7 4 8 4 7 4 6 8 5 1    8 6 10 18 21 18 15 21 24 21 26 22 30 28 27 23 22 21 17 25 20 17 13 17 9 12 7 8   5 4 4 5 5 2 4 1 1 2 5 7 6 4 9 7 7 5 5 5 5 5 2 4 5 3 6 8 2 4 9 4 10 5 1 4 5 5 5   10 3 2 8 6 5 7 3 13 3 3 6 5 1 4 5 9 5 2 7 4 5 6 3 5 6 5 4 5 9 6 4 3 4 4 4 5 8    5 5 0 3 6 3 4 3 7 5 6 4 3 3 6 8 4 1 3 1 2 7 3 4 6 6 1 3 4 1 0 1 0 0   0.132000 2.900 2.900 7.400      1131887           3           0  0 0 0 0 0 0 0 0 1 0 0 1 2 1 1 0 0 0 1 2 2 1 1 0 2 1 1 0 1 1 1 0 2 2 3 1 0 1 0    1 0 2 0 2 0 1 4 0 1 2 2 0 0 0 2 3 0 1 2 3 0 1 2 3 5 6 2 2 3 1 4 4 8 4 3 3 3 7    2 2 5 7 4 1 2 4 8 1 5 2 7 3 4 2 9 6 5 5 6 2 2 3 6 2 5 6 7 7 2 8 3 3 3 3 6 6 5    3 10 15 15 17 19 13 29 20 23 22 34 28 28 33 20 20 22 17 22 18 15 19 14 11 9 13   6 6 13 4 2 9 8 8 7 6 5 6 4 4 9 6 2 8 9 7 2 6 3 7 3 6 3 7 4 4 5 4 5 6 4 7 5 4     10 2 6 6 8 3 6 6 9 5 8 8 7 6 4 8 5 7 5 5 7 3 5 5 5 10 7 3 8 7 5 7 2 4 4 6 4 10   7 6 4 4 4 4 3 2 4 2 6 5 9 7 3 2 6 2 5 1 5 6 2 2 1 9 2 5 2 5 1 0 0 0 1 1   0.134000 2.950 2.950 7.500      1185706           3           0  0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 3 2 1 0 1 1 0 0 0 0 0 1 0 1 1 2 0 1 0 1 2 0 0 0    1 1 0 1 1 1 0 2 2 0 1 3 3 2 3 0 0 2 2 3 2 1 1 3 0 0 1 1 3 4 3 1 1 9 1 4 0 1 3    4 1 3 2 6 4 7 7 3 2 8 5 2 5 2 4 6 7 3 7 7 8 4 7 2 4 7 7 9 9 2 5 5 8 3 5 7 3 6    10 6 10 15 10 13 14 29 21 23 37 26 20 28 20 16 24 25 16 19 21 20 20 17 11 10     12 8 7 7 5 5 5 4 5 6 7 3 6 5 7 5 11 9 6 8 11 6 4 6 8 8 7 7 7 4 5 4 8 5 4 3 4 8   10 7 9 4 7 6 8 9 7 3 5 7 7 6 2 6 4 7 3 9 8 12 7 6 6 6 4 5 7 2 4 7 3 2 4 4 7 1    4 5 0 4 6 3 10 8 5 4 3 4 5 7 5 7 5 7 3 5 2 5 6 4 5 2 4 1 6 6 2 4 2 0 0 1 0   0.136000 3.000 3.000 7.600      1238426           3           0  0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 2 4 0 2 0 2 2 0 1 1 1 0 2 1 1 2 1 0 1 1 0 3 1 0    0 1 0 1 0 0 2 1 1 0 4 0 2 6 3 3 4 0 3 1 2 4 0 4 4 0 1 5 2 2 5 1 3 4 3 3 5 2 4    4 6 2 5 3 4 5 4 5 6 7 5 6 2 8 3 4 7 2 4 4 3 7 6 5 1 4 8 3 7 10 3 3 6 1 5 3 8     11 5 7 15 11 15 17 21 23 21 24 28 16 21 29 15 22 27 28 20 13 19 13 7 15 10 11    9 6 8 8 4 7 5 4 6 5 10 6 7 8 9 3 5 5 9 5 9 4 4 4 3 5 7 4 10 6 8 4 9 8 4 6 7 9    11 6 8 3 5 8 12 3 6 9 7 11 9 6 7 4 7 7 7 2 5 4 5 0 2 9 5 5 5 10 7 5 6 3 9 4 4    13 2 7 5 7 4 7 2 0 4 5 4 4 6 8 1 2 5 6 4 7 3 11 4 3 3 5 5 4 4 3 1 4 2 2 1 1 0   0.138000 3.050 3.050 7.700      1299809           6           0  0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 1 2 1 1 0 0 1 0 0 2 0 1 2 0 0 3 0 0 1 3 1    2 0 2 0 1 1 2 1 2 3 2 1 2 5 2 2 2 4 3 2 5 3 0 3 2 4 5 4 3 0 5 4 1 4 3 8 6 4 4    7 4 5 4 3 6 5 6 10 3 6 6 2 6 3 4 4 3 6 7 6 8 3 4 7 5 4 9 2 4 8 5 9 8 3 7 5 7 7   13 7 11 15 17 16 18 18 18 20 17 26 25 19 20 26 31 22 18 20 18 14 11 16 4 7 11    10 8 9 9 6 3 8 8 7 5 6 10 3 5 6 6 3 12 7 8 8 2 10 4 13 9 9 12 4 5 9 7 9 5 7 4    8 9 6 7 8 10 8 7 5 7 11 6 4 4 4 6 4 9 4 5 9 10 7 4 12 7 4 9 5 10 10 6 8 4 7 2    4 7 2 6 8 4 11 3 3 9 7 6 7 3 8 7 4 8 5 3 7 4 5 5 7 4 6 7 5 5 3 5 2 5 4 1 2 0 0   1   0.140000 3.100 3.100 7.800      1361810           3           0  0 0 0 0 0 0 0 0 0 1 0 0 0 0 3 2 1 0 0 0 1 1 1 2 0 0 0 0 1 0 2 2 2 1 0 0 3 3 0    2 0 6 2 3 1 0 3 3 1 2 2 5 3 5 3 3 2 2 7 3 2 2 3 4 2 3 4 4 1 3 7 4 5 4 2 3 5 4    2 1 3 6 3 4 3 8 7 6 5 3 5 11 5 5 3 3 7 3 6 4 4 2 4 4 4 1 5 5 9 6 6 9 3 10 8 6    8 3 10 8 16 16 13 18 23 29 25 19 19 20 27 19 22 27 24 21 15 18 11 20 21 17 12    5 18 6 12 7 9 11 7 12 11 4 8 8 4 8 7 7 2 6 4 4 9 6 9 3 4 7 7 7 4 10 4 11 5 8 8   8 5 4 4 8 6 4 9 8 12 12 8 5 8 3 10 8 7 5 3 5 6 8 5 6 10 7 2 11 2 5 5 6 8 10 2    7 5 5 14 2 7 3 9 3 5 2 8 2 3 4 4 7 9 5 4 7 6 7 5 6 3 5 4 7 6 7 7 9 3 0 2 1 1 1   0 0   0.142000 3.150 3.150 7.900      1429499           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 3 1 2 1 1 0 0 0 3 0 2 2 1 0 3 0 2 1 3 0 0 1    1 3 1 2 4 1 5 3 5 1 0 7 1 3 2 3 2 2 2 3 0 0 1 3 6 3 2 2 4 4 4 6 4 3 6 4 10 3 7   2 5 4 7 4 5 8 4 7 4 1 7 11 5 2 10 2 11 3 7 8 10 9 6 3 5 3 6 3 10 11 5 5 9 7 10   8 9 5 15 11 9 18 18 15 24 17 23 17 19 25 17 24 18 37 16 17 21 17 14 20 17 15     15 9 4 11 7 3 8 10 8 8 6 8 3 4 5 8 4 6 3 9 9 6 2 10 4 4 3 8 4 9 1 7 5 9 7 10 9   10 4 6 5 8 6 6 10 10 6 5 7 6 6 10 5 7 8 8 8 7 7 11 12 8 3 10 6 9 13 11 4 6 7 6   3 10 5 8 4 7 7 7 5 8 4 9 5 5 7 6 6 7 11 11 7 8 5 3 5 7 7 10 3 3 6 5 7 9 2 3 7    1 0 0 0 0 1   0.144000 3.200 3.200 8.000      1493946           3           0  0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 2 3 0 0 1 2 1 1 1 4 1 0 1 0 1 2 1 3 1 1 1 1 2    1 1 3 2 6 0 4 0 1 4 2 4 5 2 1 3 0 2 2 4 2 3 2 4 3 5 4 4 4 1 5 1 3 4 5 6 4 7 2    8 8 8 5 3 6 0 7 3 2 2 5 7 5 7 5 8 9 6 4 3 6 8 6 10 2 5 6 3 3 6 6 6 6 17 5 10 6   6 11 11 13 12 21 26 18 24 21 24 23 30 18 22 20 24 19 13 17 25 22 17 15 8 13 7    10 8 9 6 7 9 8 7 8 9 7 7 6 12 5 9 9 12 9 12 6 9 7 10 7 7 4 9 7 4 2 7 4 5 8 8 9   7 6 7 5 9 4 8 13 6 5 4 7 9 6 7 7 9 4 4 5 8 10 9 10 6 6 7 9 12 11 8 8 9 11 5 8    7 5 5 8 5 9 10 5 5 11 11 6 8 8 4 8 5 5 5 4 7 4 5 6 5 6 6 7 7 4 2 6 3 2 1 0 0 0   0 0   0.146000 3.250 3.250 8.100      1562352           5           0  0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 2 0 1 2 1 1 0 0 1 0 1 2 0 0 0 3 1 2 0 4 4 2 0    0 2 3 2 0 1 3 3 4 0 1 4 3 3 4 5 5 4 2 1 4 2 5 3 2 7 6 3 5 6 5 5 5 1 5 2 7 4 8    7 4 6 5 7 5 3 5 8 1 6 4 6 8 7 6 7 6 3 4 6 3 5 8 4 10 3 3 11 6 5 3 9 6 4 3 17 9   11 11 24 13 15 14 25 26 26 21 17 32 32 22 18 25 29 29 27 24 21 12 23 14 12 11    9 17 7 9 11 3 7 6 5 5 12 3 6 8 7 4 7 11 10 8 9 5 8 2 10 9 8 10 10 7 7 4 7 5 7    7 9 10 8 7 7 16 6 8 10 5 6 6 12 12 7 11 11 8 9 7 8 12 10 7 8 7 11 8 9 7 7 4 9    4 7 14 9 8 8 13 9 8 7 13 5 9 5 7 4 9 5 7 8 7 8 7 3 10 9 3 4 4 4 5 2 6 6 3 5 10   4 4 2 3 0 1 0 0   0.148000 3.300 3.300 8.200      1630559           3           0  0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 4 2 1 1 1 2 1 2 0 2 1 5 0 1 1 4 0 2 1 4 5 3 0    1 1 1 2 1 3 3 3 1 1 1 1 1 3 4 6 6 8 8 4 3 2 7 2 2 1 7 4 4 5 1 10 6 4 4 4 3 3 3   6 11 6 4 5 4 8 5 5 9 4 5 5 7 6 4 13 12 3 6 7 5 2 7 9 7 8 8 4 7 6 4 10 6 8 9 9    9 13 15 17 23 25 13 16 24 22 26 21 27 24 24 21 21 21 15 17 22 25 21 22 17 14     11 8 12 5 9 7 8 5 11 10 6 6 5 9 13 10 9 8 8 8 6 4 9 10 9 9 7 8 7 5 7 8 14 13 5   14 5 12 11 8 9 6 5 4 9 13 7 10 13 11 11 8 5 9 10 8 7 6 7 13 3 13 8 7 13 17 5 8   5 10 7 12 7 6 6 9 7 8 8 11 8 11 9 11 11 8 5 6 10 4 9 3 10 8 7 10 8 7 8 10 10 7   4 11 5 7 8 2 4 3 0 0 1 0 1   0.150000 3.350 3.350 8.300      1707576           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 1 2 1 0 2 0 2 3 1 3 2 2 2 2 0 2 1 4 3 2 2 3    1 2 1 0 2 2 4 2 5 3 3 5 2 8 4 5 4 2 3 6 7 6 1 0 7 4 7 7 6 5 4 3 4 6 6 7 6 2 7    4 4 2 5 5 6 9 3 3 3 6 6 5 3 5 7 8 8 6 8 8 6 8 3 9 6 6 8 8 6 4 8 6 6 10 4 11 6    11 15 23 16 8 17 20 21 19 24 15 14 19 21 30 25 21 15 19 16 18 21 21 15 14 12     16 8 10 12 7 10 9 8 10 10 7 9 8 10 12 6 6 9 11 6 5 9 12 6 7 12 7 5 6 8 5 9 4     11 9 8 8 10 7 6 10 7 11 13 7 4 13 11 8 11 9 16 6 12 11 10 10 19 2 9 11 8 7 8 8   6 13 6 10 12 12 9 12 9 9 8 7 7 9 6 12 8 4 9 9 8 5 7 8 9 5 12 5 7 5 9 10 9 10 3   6 6 8 7 11 3 5 5 4 2 0 0 0 0   0.152000 3.400 3.400 8.400      1777231           3           0  0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 3 1 0 3 4 2 3 3 3 3 3 2 1 1 1 1 3 3 0    1 8 0 0 5 3 7 4 4 4 4 4 3 5 2 2 5 3 6 1 7 6 1 2 2 5 2 1 6 6 8 7 7 5 10 4 1 6 9   3 4 5 3 5 8 4 9 8 11 8 3 2 7 7 9 10 9 10 8 6 8 6 8 7 10 8 7 3 8 4 10 7 6 8 9 6   5 16 9 19 24 23 17 23 24 22 30 21 15 23 27 20 20 20 18 20 23 18 17 15 19 17 18   13 9 4 4 7 12 7 10 4 8 6 10 5 6 13 2 3 8 7 8 7 3 11 8 7 9 7 19 7 8 9 6 14 8 8    11 10 11 13 14 10 16 8 9 13 8 9 9 12 7 12 11 6 9 15 5 9 9 9 11 11 13 6 10 6 4    12 9 9 12 11 8 6 9 16 10 10 10 8 10 10 6 7 4 1 15 6 8 4 9 13 11 8 10 11 9 8 3    3 6 6 7 9 4 6 8 7 4 2 1 2 2 1 0   0.154000 3.450 3.450 8.500      1849489           6           0  0 0 0 0 0 0 0 0 0 0 1 1 3 0 1 2 2 0 1 4 1 1 0 1 0 2 1 0 0 1 1 1 1 6 3 6 1 3 1    3 3 0 6 0 4 2 7 4 6 4 4 3 7 4 5 7 5 5 2 3 9 9 2 5 5 3 9 4 2 7 6 2 8 2 5 7 12 6   5 4 5 10 4 12 10 6 4 14 7 9 10 11 7 7 7 7 3 9 7 4 3 8 7 5 7 9 6 8 9 6 8 8 12 6   5 11 12 13 11 13 21 26 19 23 25 18 23 22 23 23 18 27 20 15 20 25 24 19 18 12     14 13 15 8 15 10 11 7 9 13 11 12 13 11 11 7 11 13 6 5 10 6 6 10 8 14 5 14 11 8   5 9 7 10 10 8 7 15 13 3 13 12 18 15 7 10 9 10 8 15 9 6 8 9 10 10 9 5 7 7 5 10    11 13 12 12 12 10 6 17 10 11 9 4 8 7 6 6 9 12 8 16 18 7 5 10 8 12 10 15 6 13     11 6 10 16 10 11 16 8 9 5 11 10 14 11 5 2 5 7 3 1 1 0 1 0   0.156000 3.500 3.500 8.600      1920727           4           0  0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 2 1 2 0 3 0 1 1 0 1 0 3 0 4 4 1 3 1 2 3 3 4 3    1 2 3 9 5 2 3 7 3 3 6 5 2 6 1 4 3 2 3 6 5 1 8 3 8 5 3 7 6 13 11 9 5 8 7 7 5 8    7 4 8 6 4 10 4 6 5 6 9 9 12 6 7 10 9 9 8 8 3 8 9 8 8 2 12 11 13 8 13 7 8 6 6 9   6 8 16 13 14 16 16 22 20 21 21 17 20 18 19 22 20 11 20 22 21 14 19 15 23 17 15   12 14 19 16 10 11 14 11 9 11 9 12 8 16 14 9 6 18 10 11 7 10 11 17 10 13 8 10     12 9 12 7 7 10 10 11 11 9 8 8 14 10 10 9 14 9 14 13 9 19 16 17 4 11 8 12 11 10   21 6 10 8 9 12 9 7 7 12 7 16 14 10 13 6 13 8 9 10 6 10 8 7 10 4 6 11 19 12 6 7   5 8 11 10 12 13 9 6 10 5 11 11 4 14 10 7 2 6 5 1 2 5 1 1 0 0   0.158000 3.550 3.550 8.700      1999833           3           0  0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 2 3 2 2 2 1 2 3 0 1 0 1 3 2 0 0 3 2 3 2 5 7 0    3 4 1 10 7 7 4 5 2 3 4 3 8 3 6 4 4 4 8 2 3 4 5 5 7 1 6 7 8 1 6 8 1 4 4 11 9 4    7 11 9 10 5 6 8 4 3 9 7 9 11 5 5 8 8 4 8 7 8 11 9 12 6 4 13 4 12 10 6 9 11 10    11 10 11 11 11 14 15 14 23 18 17 29 16 26 23 15 19 14 18 19 22 31 13 21 20 12    16 15 14 18 17 15 8 12 14 13 10 10 10 10 10 13 11 6 8 11 8 14 8 10 11 11 8 10    13 5 14 7 12 9 10 10 12 15 18 8 6 9 9 12 8 9 20 14 16 10 11 14 5 5 13 6 11 9     11 15 6 9 13 11 7 8 7 10 8 16 12 11 8 10 14 11 17 11 8 16 13 9 10 5 10 17 13     14 16 8 10 9 11 5 10 9 10 12 8 11 12 11 8 6 7 12 15 13 12 7 13 5 0 3 2 0 0 0 0   0.160000 3.600 3.600 8.800      2073149           3           0  0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 1 2 1 2 2 1 0 2 2 1 0 3 6 4 5 5 2 2 2 5 5 3 6 4    6 4 5 2 4 4 3 2 4 6 3 3 6 5 7 4 5 7 5 3 5 6 13 5 3 10 5 9 7 4 5 6 5 10 6 5 5 6   6 4 14 7 6 11 6 9 10 9 8 5 3 8 10 10 6 6 8 9 5 6 14 7 11 10 9 9 11 13 8 4 5 10   12 6 16 8 8 7 19 20 23 10 16 27 25 23 19 26 21 16 20 21 24 18 25 8 11 13 16 18   13 22 18 9 16 4 16 10 12 13 9 7 9 8 17 11 10 13 10 14 4 9 12 16 8 9 16 17 13     11 14 8 8 13 9 11 15 10 11 14 8 6 4 9 11 18 9 9 8 9 15 11 11 11 9 6 13 13 10 7   8 10 15 14 9 7 4 10 12 17 10 14 13 10 10 12 20 9 7 6 11 15 11 10 8 9 6 10 13     17 6 8 9 6 13 13 16 10 15 5 11 14 11 12 6 5 12 9 4 9 2 4 1 1 0 0 0   0.162000 3.650 3.650 8.900      2156456           5           0  0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 2 0 1 1 3 2 3 4 3 3 2 1 3 6 5 2 3 4 4 3 6 2 3    4 4 5 5 3 4 1 4 5 9 3 3 4 3 3 8 5 6 12 2 10 3 4 6 8 9 8 8 2 2 7 5 8 2 8 9 7 2    6 8 6 5 8 2 7 5 6 13 5 6 8 11 6 10 5 6 3 8 10 11 10 10 14 10 11 8 11 8 12 6 12   5 15 12 13 10 13 13 18 23 12 21 18 21 23 20 30 20 23 26 24 24 21 21 29 19 21     16 23 20 13 19 13 16 11 15 13 13 11 8 11 14 14 13 4 16 15 18 13 9 19 8 11 6 9    14 8 13 12 13 10 13 10 14 11 13 11 8 10 13 11 11 14 11 8 14 11 10 9 14 12 14     18 8 12 7 13 12 10 14 14 8 12 17 11 13 9 12 12 15 7 9 13 17 11 11 11 12 17 12    11 16 15 8 9 12 7 13 15 11 16 7 10 7 14 5 18 10 10 8 8 6 6 13 14 6 9 11 9 9 3    5 1 1 3 0 0   0.164000 3.700 3.700 9.000      2234753           3           0  0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 4 1 4 2 1 3 1 1 3 2 3 3 1 3 6 2 4 4 3 3 3 6 5 2    6 4 1 3 3 7 1 4 4 6 12 4 5 2 6 4 9 3 1 8 11 5 2 7 6 3 8 4 7 3 8 3 9 6 7 8 9 2    7 6 9 6 15 6 9 5 9 4 9 17 15 10 2 10 6 8 12 12 11 12 10 9 7 11 8 7 5 11 10 14    16 7 7 7 13 15 10 16 17 21 19 14 18 24 19 27 27 24 20 22 24 21 20 14 24 17 17    18 32 15 12 13 15 12 8 14 11 11 19 11 14 15 18 10 5 12 11 11 9 15 9 7 9 16 12    9 12 10 15 9 18 7 11 12 14 7 20 8 10 13 14 11 6 6 9 11 8 10 16 8 17 13 17 9 16   11 10 9 13 20 17 14 12 10 13 11 9 9 17 20 10 16 8 14 13 14 18 15 15 8 10 12 11   22 12 13 9 12 9 11 14 19 12 12 8 8 12 11 19 11 11 12 15 11 15 13 9 9 10 9 4 9    4 2 1 0 0   0.166000 3.750 3.750 9.100      2327990           3           0  0 0 0 0 0 0 0 0 0 0 0 0 3 2 2 0 1 2 2 1 1 0 0 3 1 4 2 6 4 2 4 3 2 5 5 2 3 1 3    1 2 10 2 7 4 3 4 3 3 4 3 10 6 9 6 3 8 5 5 3 4 4 6 8 4 4 7 5 5 11 14 5 3 6 8 8    7 10 11 7 17 7 11 10 8 7 8 12 13 11 12 6 13 9 7 7 6 5 8 13 10 10 14 11 11 8 12   15 14 9 13 10 9 18 13 18 12 23 14 17 24 15 23 25 31 19 17 29 19 19 19 26 25 19   17 22 19 19 19 11 11 12 22 21 8 10 18 10 14 19 17 13 14 10 6 9 10 15 11 5 13     13 11 11 17 16 9 7 14 7 19 6 10 13 7 12 18 14 7 12 15 13 13 9 13 13 13 12 12     14 12 19 10 16 18 18 12 8 10 10 9 7 14 9 11 13 12 8 15 12 11 10 12 11 17 15 19   14 14 12 7 7 12 11 15 16 12 11 12 10 19 19 12 14 12 15 11 20 13 7 18 9 15 19     16 11 5 9 8 6 2 4 0 2 0 1   0.168000 3.800 3.800 9.200      2406866           3           0  0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 2 3 2 3 1 2 1 2 2 5 2 1 2 3 2 2 2 5 3 5 3 3 1 3    6 8 6 1 3 9 6 3 6 10 5 5 7 4 5 7 12 9 5 7 5 6 6 8 3 5 4 7 8 5 6 5 8 13 4 10 2    10 9 7 7 16 9 10 9 13 8 12 9 13 15 9 15 9 10 11 6 6 6 7 7 6 8 15 9 8 9 6 12 12   11 14 12 11 13 8 17 18 18 11 14 19 14 25 21 15 10 15 19 27 23 22 24 17 19 18     12 16 22 21 25 9 25 15 19 15 21 15 8 11 13 12 10 12 7 13 11 17 11 13 10 16 19    14 23 11 8 12 13 10 9 17 4 14 10 7 10 17 14 11 11 20 18 13 8 12 6 8 13 12 23     15 14 15 16 9 14 9 13 14 17 11 17 11 10 15 17 11 6 12 12 14 15 17 12 16 16 8     17 15 15 10 15 11 10 15 12 13 9 12 9 12 15 12 6 18 7 15 14 12 21 18 11 10 18     11 19 11 7 11 3 2 5 4 0 1 1   0.170000 3.850 3.850 9.300      2508471           7           0  0 0 0 0 0 0 0 0 0 0 0 0 1 3 1 2 1 4 3 3 1 2 7 0 3 2 2 2 2 5 2 3 2 3 3 4 3 7 3    5 3 4 4 6 2 3 10 4 11 3 13 7 7 5 6 3 8 10 6 6 4 10 11 4 12 7 8 9 7 7 8 4 6 7 9   9 5 9 11 5 14 9 10 7 9 8 8 5 6 11 13 14 10 10 10 10 8 9 9 9 9 14 14 13 11 8 18   9 10 9 16 12 13 15 13 10 17 16 20 14 22 20 26 29 29 27 24 20 37 21 24 13 18 13   28 24 22 25 21 13 14 15 9 11 18 8 16 17 16 13 12 16 11 11 17 15 11 15 10 11 12   13 12 12 20 15 14 15 16 12 17 15 15 12 10 14 14 17 15 19 15 13 13 11 12 16 14    17 16 8 16 12 8 14 13 13 10 10 9 12 11 19 20 13 11 4 15 11 14 11 20 18 18 13     20 12 20 21 15 15 12 13 18 18 11 16 9 14 9 18 11 10 11 20 11 13 17 13 13 12 14   16 10 12 12 23 12 11 12 8 8 1 0 1 2 0   0.172000 3.900 3.900 9.400      2591210           3           0  0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 4 4 3 2 1 3 3 2 3 0 3 6 1 3 1 5 5 4 3 9 9 0 4 7    5 3 5 5 8 7 3 3 5 5 8 5 11 10 8 10 3 6 6 6 7 7 8 8 12 9 6 10 8 7 10 8 8 10 4 6   12 20 4 6 11 7 9 10 7 5 10 6 12 11 7 13 13 16 12 6 8 14 13 9 7 5 14 17 17 10     12 11 6 13 11 17 3 23 13 21 12 21 28 11 23 30 28 23 24 26 26 17 21 15 27 23 33   16 22 25 11 20 22 23 21 20 7 21 13 16 12 16 16 13 18 18 9 13 16 15 9 20 13 19    15 8 9 11 14 13 10 9 10 16 15 14 17 15 19 16 12 14 12 14 14 16 19 19 4 24 8 12   15 16 11 15 14 20 14 13 13 14 16 19 14 13 19 14 18 23 15 15 4 14 17 14 8 10 15   20 11 15 19 12 9 13 12 11 16 12 16 13 14 16 13 16 16 19 19 12 11 10 19 15 15     14 12 5 11 18 17 10 13 12 9 6 2 0 0 1 0   0.174000 3.950 3.950 9.500      2675515           3           0  0 0 0 0 0 0 0 0 0 0 2 0 1 1 0 2 1 2 3 3 1 3 1 3 7 5 3 6 4 3 9 4 5 2 5 3 3 3 6    9 5 5 2 6 8 5 8 4 8 5 6 5 6 4 6 3 7 11 6 9 9 3 6 6 7 6 8 7 9 12 18 6 9 8 11 11   8 14 15 15 11 15 13 9 19 10 15 14 9 4 18 5 8 10 8 10 13 9 12 11 8 8 12 6 15 8    9 9 18 7 17 21 9 13 18 14 21 24 18 22 17 26 15 21 23 25 19 26 23 20 27 17 27     20 26 15 22 15 19 15 16 24 12 15 24 13 13 17 11 7 10 21 15 15 16 13 20 22 12     16 12 16 15 14 18 11 12 14 14 24 10 13 16 19 8 11 18 19 15 15 23 16 16 11 12     18 11 13 14 16 10 14 13 18 12 15 15 14 8 11 17 12 22 13 12 14 15 10 11 15 19     15 12 17 8 21 23 13 19 11 8 12 15 11 14 15 19 15 10 17 9 16 14 18 14 16 14 14    23 14 14 13 16 12 14 15 14 9 14 7 5 2 3 1 1 1   0.176000 4.000 4.000 9.600      2779386           5           0  0 0 0 0 0 0 0 0 0 0 0 2 2 3 0 1 3 0 6 2 6 3 1 5 0 4 1 6 5 1 6 3 6 5 6 2 5 4 5    3 9 8 5 7 5 8 4 12 8 12 6 8 5 7 5 7 10 5 5 6 7 9 7 10 7 10 10 8 12 10 6 13 10    11 12 11 10 10 16 9 6 12 9 11 17 10 11 10 14 11 16 7 11 13 12 10 17 14 11 13     12 10 13 16 16 17 17 15 14 11 8 15 13 27 22 14 19 17 22 22 27 18 28 19 27 32     24 33 21 17 23 12 27 25 20 20 17 22 14 15 22 21 14 9 16 12 19 16 17 16 16 20     14 18 15 14 18 10 12 9 16 12 12 10 13 19 12 12 15 14 15 22 12 11 15 18 19 18     10 6 11 14 10 23 17 14 16 19 10 10 16 19 17 23 16 18 19 18 16 12 14 14 14 13     11 10 24 21 22 26 18 18 18 14 17 5 13 17 11 13 16 14 18 16 9 15 15 18 16 14 21   13 22 17 9 8 16 17 16 16 19 7 20 19 18 16 10 6 10 6 3 5 1 0 0 2   0.178000 4.050 4.050 9.700      2869617           3           0  0 0 0 0 0 0 0 0 0 0 2 2 2 0 1 4 1 3 2 2 1 2 3 2 2 4 4 7 5 6 5 3 6 6 5 7 8 1 5    2 3 5 5 8 10 7 6 10 9 6 8 9 7 8 10 15 4 10 5 8 8 6 11 8 8 11 7 5 8 14 5 11 7     13 10 9 7 8 9 14 12 10 9 11 6 14 15 14 13 11 9 18 18 10 14 14 10 12 16 12 9 8    14 15 6 11 11 12 10 14 12 11 18 13 13 27 16 23 23 20 21 32 20 18 25 22 24 32     25 34 19 23 21 25 22 25 19 23 19 21 16 19 16 18 9 18 6 13 12 13 18 12 8 19 14    14 11 16 13 15 14 21 11 14 14 13 11 20 14 14 26 10 22 16 18 15 20 24 18 19 19    16 14 14 14 21 13 19 18 20 13 17 11 17 14 22 17 15 15 20 8 21 15 16 16 23 17     13 19 21 20 12 15 18 15 19 15 18 17 20 15 13 14 24 18 15 15 14 18 20 19 17 19    20 21 21 15 19 19 17 11 16 16 11 23 10 20 13 10 5 10 2 3 1 1 0   0.180000 4.100 4.100 9.800      2975040           3           0  0 0 0 0 0 0 0 0 1 0 0 1 2 2 4 4 2 4 4 1 2 5 0 3 3 5 2 5 5 4 9 2 7 8 4 8 3 11 6   10 4 7 8 6 6 5 8 8 7 11 4 4 11 12 7 11 7 10 11 7 11 11 10 9 7 13 12 18 8 14 12   14 12 8 8 16 10 10 14 16 10 6 8 15 15 15 22 13 19 18 12 6 11 10 7 12 12 24 15    17 9 17 21 10 17 18 14 14 14 9 22 11 23 17 15 23 32 20 11 12 20 15 23 30 20 25   19 26 29 19 27 23 15 19 11 30 16 21 24 18 18 14 8 6 25 13 21 13 13 19 13 21 25   23 18 14 14 13 20 12 14 8 10 25 14 15 20 15 10 15 16 21 8 15 20 21 20 13 16 15   20 11 18 17 17 9 12 24 19 13 18 17 20 14 15 20 10 23 19 25 8 7 13 14 11 15 18    13 10 12 10 17 11 24 16 17 11 12 13 16 20 14 26 12 17 13 14 16 16 6 20 16 23     22 11 17 16 14 25 19 17 21 22 19 13 19 16 18 10 11 7 4 6 0 0 2   0.182000 4.150 4.150 9.900      3083416           6           0  0 0 0 0 0 0 0 0 0 0 2 1 1 4 1 3 4 3 5 6 2 1 4 2 3 5 6 6 7 2 4 1 11 7 5 2 6 6 8   9 8 12 7 11 9 6 12 7 8 9 6 6 8 11 6 6 8 11 8 11 12 11 13 9 10 7 9 6 11 9 13 12   12 8 14 15 8 9 8 8 11 22 16 6 11 16 15 9 13 12 12 13 11 15 9 9 16 14 14 12 21    12 12 12 16 19 10 15 18 8 16 14 16 16 21 30 22 9 25 19 19 26 23 33 25 22 21 19   21 20 20 21 20 26 20 29 27 25 25 21 20 25 21 21 18 14 19 15 6 20 18 16 20 16     13 13 15 15 15 15 22 16 15 15 11 21 19 11 19 13 14 15 17 21 12 18 12 22 18 21    18 13 23 15 18 9 21 11 14 23 18 21 25 18 22 15 21 23 15 15 16 19 21 18 19 21     17 13 24 23 22 19 14 20 22 15 14 14 20 20 23 13 18 15 18 20 20 24 9 12 17 21     21 12 16 17 16 16 21 26 19 15 21 22 24 15 11 13 13 6 8 1 4 0 1 0   0.184000 4.200 4.200 10.00      3174897           3           0  0 0 0 0 0 0 0 0 0 0 1 1 2 3 0 5 4 3 3 0 7 3 2 4 2 8 6 4 5 9 3 8 6 4 2 7 6 8 7    9 3 5 8 5 9 7 7 6 11 14 7 12 9 9 5 15 12 14 15 12 9 11 5 8 13 11 12 10 9 17 12   11 8 17 11 19 11 15 9 11 7 15 14 16 16 16 7 12 10 14 13 13 16 16 11 15 13 14     12 16 11 12 13 17 10 13 19 11 17 11 13 14 13 10 19 19 23 24 22 24 24 31 19 23    22 28 21 25 29 17 23 17 21 30 22 19 25 27 27 22 23 23 17 25 17 20 17 12 23 21    9 17 20 16 19 16 17 20 9 16 11 22 16 15 12 15 17 23 24 16 16 18 26 11 16 20 18   10 14 17 26 19 17 15 17 19 12 21 20 24 17 27 13 16 18 19 23 14 19 14 10 11 18    19 6 15 21 23 25 17 17 18 21 27 20 17 18 20 25 22 20 18 22 18 17 15 24 16 15     22 18 22 14 20 20 22 18 22 25 19 26 12 19 19 13 12 16 19 14 9 7 5 4 2 0 2   0.186000 4.250 4.250 10.10      3283256           3           0  0 0 0 0 0 0 0 1 0 0 1 1 4 1 5 2 5 5 3 4 6 3 2 4 7 8 2 6 6 4 10 7 8 7 5 4 4 9 8   18 10 7 6 6 13 12 10 13 10 7 15 4 7 10 13 12 8 8 13 5 14 6 9 14 9 10 16 12 13    11 8 12 11 10 13 9 11 15 17 23 18 13 10 12 11 12 14 14 14 10 12 12 16 13 15 13   13 14 18 10 13 17 14 14 14 12 12 8 18 14 23 20 16 19 16 16 16 27 18 21 19 20     19 37 22 21 22 28 24 26 18 21 28 21 22 21 21 22 16 15 13 22 22 27 22 11 13 20    10 17 16 19 20 30 18 25 8 7 22 18 17 14 23 16 17 11 16 24 19 18 22 15 15 23 16   13 15 22 14 8 12 18 13 15 22 17 15 15 17 27 21 19 21 24 17 10 12 14 19 17 22     18 19 17 28 19 15 14 16 28 17 20 15 11 22 18 19 16 21 17 24 19 22 22 20 10 20    18 18 18 21 18 23 18 32 26 21 21 22 20 22 16 17 20 22 21 17 13 13 11 9 5 0 1 1   1   0.188000 4.300 4.300 10.20      3396610           5           0  0 0 0 0 0 0 0 0 0 0 1 2 3 0 2 5 5 4 3 3 5 1 2 3 6 9 3 3 3 8 7 2 9 5 7 5 11 8 9   7 6 9 6 4 5 8 6 10 9 14 10 15 6 7 13 15 10 13 7 15 10 10 11 14 14 6 7 17 13 19   3 13 9 6 13 13 14 10 11 12 16 17 13 10 15 15 19 19 11 11 15 11 13 9 13 20 8 18   14 18 23 23 23 15 19 20 14 11 7 18 16 15 22 28 20 24 22 25 17 20 39 24 26 25     25 33 25 25 25 33 15 29 18 29 18 12 18 23 17 24 28 22 16 20 33 23 18 23 26 23    15 24 16 16 16 16 17 15 15 16 14 11 9 23 17 13 13 18 12 19 20 30 20 20 15 21     19 16 18 20 23 19 15 10 11 15 19 13 22 22 18 19 16 19 23 16 10 25 23 20 21 20    31 19 19 18 15 22 18 14 13 21 18 19 22 19 16 17 21 14 20 26 18 26 22 19 26 19    20 22 15 13 24 23 15 21 21 21 27 18 22 19 24 17 22 16 18 23 10 12 3 5 3 3 0 0   0.190000 4.350 4.350 10.30      3502025           3           0  0 0 0 0 0 0 0 0 0 0 0 3 0 3 2 3 4 4 3 4 5 10 7 6 6 4 5 12 10 6 6 13 10 6 7 14    9 6 13 10 12 16 3 9 9 7 5 6 13 11 10 8 11 19 12 14 13 16 13 14 9 12 14 13 14     16 10 14 7 16 18 16 9 15 11 20 15 10 14 14 11 14 17 10 6 16 10 15 12 17 17 20    15 7 12 23 15 8 13 12 8 16 15 20 16 16 20 14 11 20 24 23 20 16 18 27 25 31 27    27 25 21 31 27 20 23 24 32 17 21 34 27 17 19 19 25 30 27 21 24 28 30 19 26 21    14 16 21 23 27 8 17 21 17 11 23 15 22 15 18 10 17 20 23 18 18 17 19 22 15 22     21 19 23 18 18 26 17 18 26 18 24 15 22 23 23 19 23 25 23 24 26 10 21 16 32 23    18 19 24 21 28 26 22 19 19 14 30 21 24 23 22 21 13 27 20 27 24 15 20 22 22 13    25 14 19 32 21 18 18 23 22 22 14 18 20 24 14 19 20 18 17 24 29 27 20 12 18 17    11 9 2 3 2 1 0   0.192000 4.400 4.400 10.40      3593938           3           0  0 0 0 0 0 0 0 0 0 0 1 0 1 1 2 3 4 7 8 1 5 6 8 3 7 5 4 9 8 8 7 7 9 7 9 9 15 5 7   8 15 14 9 9 13 8 8 15 10 7 10 9 10 14 7 8 18 16 17 11 14 15 13 8 15 8 15 18 16   16 22 12 8 16 13 10 13 13 10 21 11 10 16 16 13 13 17 16 20 23 13 22 16 14 15     22 19 22 15 22 24 16 16 16 19 12 15 16 17 20 18 19 26 17 23 18 32 20 28 36 22    25 30 29 31 36 24 24 21 29 24 32 29 30 23 34 19 33 34 25 20 31 27 24 16 14 21    20 13 24 17 28 13 24 16 26 15 26 21 11 15 20 13 20 18 25 23 18 24 26 22 16 22    14 13 16 20 24 25 19 29 20 15 20 16 25 26 21 22 17 24 22 21 17 23 23 15 19 30    23 17 21 19 18 21 26 14 29 24 20 33 19 15 20 23 28 19 23 25 15 19 17 31 23 18    29 26 25 14 24 25 18 19 19 24 35 31 23 23 14 15 19 11 20 19 24 17 16 9 10 12 3   2 2 0 1   0.194000 4.450 4.450 10.50      3712573           7           0  0 0 0 0 0 0 0 0 0 0 0 1 1 1 5 3 5 4 3 11 3 10 4 6 7 8 5 5 5 8 9 12 7 7 11 8 6    7 9 10 13 10 6 13 9 9 9 11 14 14 12 13 10 6 13 13 15 12 13 19 8 14 13 16 11 13   14 15 9 15 16 13 16 17 17 17 23 18 16 19 10 13 18 16 10 9 21 11 22 14 20 14 18   13 15 12 13 14 16 14 15 20 29 17 14 18 8 15 21 15 19 15 22 20 17 15 23 26 16     26 24 23 23 23 23 30 24 29 28 26 35 33 31 22 23 22 20 37 22 27 33 26 27 26 17    16 18 27 22 21 24 18 18 18 17 15 18 14 19 24 22 15 20 21 15 19 25 15 16 26 19    22 29 20 16 13 15 16 32 24 23 13 33 17 22 18 18 23 24 22 21 20 26 21 16 22 18    18 16 15 26 26 17 22 21 13 25 24 13 23 18 18 25 32 20 24 21 17 19 24 24 23 33    19 19 21 32 18 22 23 19 23 32 18 31 22 25 23 23 31 29 21 16 20 20 15 22 14 12    5 10 9 2 1 0 1   0.196000 4.500 4.500 10.60      3829518           3           0  0 0 0 0 0 0 0 0 0 1 2 2 1 6 2 6 5 9 3 5 6 8 6 3 8 10 7 11 9 4 8 9 5 11 10 13 9   16 13 10 9 5 12 9 15 10 13 9 12 18 14 19 9 13 14 12 13 21 17 17 18 16 13 12 16   14 18 10 15 15 16 11 15 22 17 19 17 11 12 26 12 17 19 18 21 20 27 17 18 19 21    14 19 16 12 16 21 20 18 8 17 17 13 13 18 15 19 15 19 20 28 21 29 27 27 34 24     26 31 25 24 16 17 23 23 30 28 18 28 32 28 37 18 26 18 16 33 21 31 21 20 22 19    20 25 18 18 20 11 17 20 22 23 14 14 17 18 20 25 20 19 20 22 19 16 33 25 21 21    24 18 16 22 29 22 16 27 26 28 21 20 22 17 25 23 20 23 18 16 19 26 22 21 22 23    15 20 19 17 23 19 20 15 22 18 22 26 23 23 31 17 29 18 13 15 19 18 24 22 28 22    17 23 24 26 21 23 25 24 29 26 18 41 24 29 22 27 23 28 16 30 24 18 23 19 17 18    21 17 14 8 2 5 2 0 0   0.198000 4.550 4.550 10.70      3950740           3           0  0 0 0 0 0 0 0 0 1 1 1 2 1 3 7 5 6 7 7 7 4 5 6 4 1 8 9 10 9 8 10 8 12 6 10 8 10   8 11 9 10 15 7 11 8 13 11 13 15 15 17 12 10 8 17 12 9 14 12 14 11 14 21 14 15    20 18 16 8 15 22 24 14 10 18 14 15 16 12 10 16 21 16 25 17 20 17 17 20 15 24     15 17 22 25 17 13 22 18 20 19 11 21 22 21 16 21 24 16 22 17 21 17 24 22 24 35    27 24 28 24 32 37 34 25 24 29 37 37 25 28 21 23 24 22 21 20 25 22 32 19 21 22    24 20 21 20 22 18 27 17 14 20 22 22 22 14 19 20 20 21 23 22 14 20 21 23 20 18    23 20 25 31 24 18 22 14 23 22 21 23 27 27 20 21 18 22 23 24 23 21 18 22 17 22    21 35 15 24 24 12 27 30 27 28 22 31 24 24 19 27 24 28 23 25 26 35 27 22 29 21    24 18 19 26 33 29 31 23 25 19 24 26 21 10 23 24 26 28 20 27 26 17 29 22 18 14    22 8 10 11 4 4 1 2 0   0.200000 4.600 4.600 10.80      4068161           5           0  0 0 0 0 0 0 0 0 0 1 1 0 1 5 5 2 9 3 11 6 9 8 7 7 8 3 3 13 10 8 7 5 8 13 8 7 14   12 10 7 15 13 13 11 12 12 14 12 13 12 10 15 11 14 7 16 15 8 15 13 15 13 18 13    17 21 15 12 13 13 17 18 18 18 16 19 20 17 14 17 24 13 12 18 19 19 13 21 18 26    21 23 16 14 18 19 13 33 13 19 20 14 20 23 14 26 19 22 21 21 16 27 30 25 28 22    32 21 30 27 31 21 30 22 27 27 31 27 21 17 38 41 17 21 20 19 30 24 27 20 20 21    30 20 19 19 31 25 24 13 21 23 19 24 33 24 17 20 17 12 25 23 18 24 11 24 25 22    33 20 11 22 31 21 20 26 27 21 26 24 14 23 23 20 20 26 28 10 20 27 24 22 17 27    28 20 23 23 33 20 24 26 32 33 29 21 25 24 17 18 19 27 26 20 24 26 24 24 26 21    19 24 21 36 32 18 33 33 20 23 25 33 19 27 25 27 24 27 21 21 23 28 18 27 25 19    24 15 17 12 15 7 2 1 0 0 ", "%f ", Inf);
 %! assert (rows (x) == n);
 
 %% Note use fprintf so output not sent to stdout
-%% test/octave.test/io/printf-1.m
 %!test
 %! nm = tmpnam ();
 %! fid1 = fopen (nm,"w");
@@ -315,25 +304,19 @@
 %! assert (x, 8);
 %! assert (str, "test:1");
 
-%% test/octave.test/io/printf-2.m
 %!error printf (1)
 
-%% test/octave.test/io/printf-3.m
 %!error <Invalid call to printf> printf ()
 
-%% test/octave.test/io/sprintf-1.m
 %!test
 %! [s, msg, status] = sprintf ("%s: %d\n", "test", 1);
 %!
 %! assert (s == "test: 1\n" && ischar (msg) && status == 8);
 
-%% test/octave.test/io/sprintf-2.m
 %!error sprintf (1)
 
-%% test/octave.test/io/sprintf-3.m
 %!error <Invalid call to sprintf> sprintf ()
 
-%% test/octave.test/io/fopen-1.m
 %!test
 %! arch_list = {"native"; "ieee-le"; "ieee-be"; "vaxd"; "vaxg"; "cray"};
 %! warning ("off", "Octave:fopen-mode")
@@ -362,7 +345,7 @@
 %!       else
 %!         fclose (id);
 %!       endif
-%!       tmp_mode = cstrcat (mode, "b");
+%!       tmp_mode = [mode, "b"];
 %!       [id, err] = fopen (nm, tmp_mode, arch);
 %!       if (id < 0)
 %!         __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err);
@@ -371,7 +354,7 @@
 %!       else
 %!         fclose (id);
 %!       endif
-%!       tmp_mode = cstrcat (mode, "t");
+%!       tmp_mode = [mode, "t"];
 %!       [id, err] = fopen (nm, tmp_mode, arch);
 %!       if (id < 0)
 %!         __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err);
@@ -393,43 +376,31 @@
 %!
 %! assert (status == 1);
 
-%% test/octave.test/io/fopen-2.m
 %!test
 %! s.a = 1;
 %! fail ("fopen (s)");
 
-%% test/octave.test/io/fopen-3.m
 %!error fopen ("foo", "x")
 
-%% test/octave.test/io/fopen-4.m
 %! fopen ("foo", "wb", "noodle");
 %! assert (__prog_output_assert__ ("error:"));
 
-%% test/octave.test/io/fopen-5.m
 %!error <Invalid call to fopen> fopen ()
 
-%% test/octave.test/io/fopen-6.m
 %!error <Invalid call to fopen> fopen ("foo", "wb", "native", 1)
 
-%% test/octave.test/io/fclose-1.m
 %!error fclose (0)
 
-%% test/octave.test/io/fclose-2.m
 %!error <Invalid call to fclose> fclose (1, 2)
 
-%% test/octave.test/io/tmpnam-1.m
 %!assert (ischar (tmpnam ()))
 
-%% test/octave.test/io/tmpnam-2.m
 %!warning tmpnam (1);
 
-%% test/octave.test/io/tmpnam-3.m
 %!warning tmpnam ("foo", 1);
 
-%% test/octave.test/io/tmpnam-4.m
 %!error <Invalid call to tmpnam> tmpnam (1, 2, 3)
 
-%% test/octave.test/io/binary-io-1.m
 %!test
 %! type_list = ["char"; "char*1"; "integer*1"; "int8";
 %! "schar"; "signed char"; "uchar"; "unsigned char";
@@ -464,7 +435,6 @@
 %! unlink (nm);
 %! assert (__prog_output_assert__ ("ok"));
 
-%% test/octave.test/io/file-pos-1.m
 %!test
 %! nm = tmpnam ();
 %! id = fopen (nm, "wb");
@@ -502,119 +472,81 @@
 %! endif
 %! unlink (nm);
 
-%% test/octave.test/io/fputs-1.m
 %!error <Invalid call to fputs> fputs ()
 
-%% test/octave.test/io/fputs-2.m
 %!error <Invalid call to fputs> fputs (1, "foo", 1)
 
-%% test/octave.test/io/fputs-3.m
 %!assert (fputs (1, 1),-1)
 
-%% test/octave.test/io/fgetl-1.m
 %!error <Invalid call to fgetl> fgetl ()
 
-%% test/octave.test/io/fgetl-2.m
 %!error <Invalid call to fgetl> fgetl (1, 2, 3)
 
-%% test/octave.test/io/fgetl-3.m
 %!error fgetl ("foo", 1)
 
-%% test/octave.test/io/fgets-1.m
 %!error <Invalid call to fgets> fgets ()
 
-%% test/octave.test/io/fgets-2.m
 %!error <Invalid call to fgets> fgets (1, 2, 3)
 
-%% test/octave.test/io/fgets-3.m
 %!error fgets ("foo", 1)
 
-%% test/octave.test/io/fprintf-1.m
 %!error <Invalid call to fprintf> fprintf ()
 
-%% test/octave.test/io/fprintf-2.m
 %!error <Invalid call to fprintf> fprintf (1)
 
-%% test/octave.test/io/fprintf-3.m
 %!test
 %! s.a = 1;
 %! fail ("fprintf (s)", "Invalid call to fprintf");
 
-%% test/octave.test/io/fprintf-4.m
 %!error fprintf (1, 1)
 
-%% test/octave.test/io/fprintf-5.m
 %!error fprintf (-1, "foo")
 
-%% test/octave.test/io/fscanf-1.m
 %!error <Invalid call to fscanf> fscanf ()
 
-%% test/octave.test/io/fscanf-2.m
 %!error <Invalid call to fscanf> fscanf (1)
 
-%% test/octave.test/io/fscanf-3.m
 %!error fscanf ("foo", "bar")
 
-%% test/octave.test/io/fread-1.m
 %!error <Invalid call to fread> fread ()
 
-%% test/octave.test/io/fread-2.m
 %!error <Invalid call to fread> fread (1, 2, "char", 1, "native", 2)
 
-%% test/octave.test/io/fread-3.m
 %!error fread ("foo")
 
-%% test/octave.test/io/fwrite-1.m
 %!error <Invalid call to fwrite> fwrite ()
 
-%% test/octave.test/io/fwrite-2.m
 %!error <Invalid call to fwrite> fwrite (1, rand (10), "char", 1, "native", 2)
 
-%% test/octave.test/io/fwrite-3.m
 %!error fwrite ("foo", 1)
 
-%% test/octave.test/io/feof-1.m
 %!error <Invalid call to feof> feof ()
 
-%% test/octave.test/io/feof-2.m
 %!error <Invalid call to feof> feof (1, 2)
 
-%% test/octave.test/io/feof-3.m
 %!error feof ("foo")
 
-%% test/octave.test/io/ferror-1.m
 %!error <Invalid call to ferror> ferror ()
 
-%% test/octave.test/io/ferror-2.m
 %!error <Invalid call to ferror> ferror (1, 'clear', 2)
 
-%% test/octave.test/io/ferror-3.m
 %!error ferror ("foo")
 
-%% test/octave.test/io/ftell-1.m
 %!error <Invalid call to ftell> ftell ()
 
-%% test/octave.test/io/ftell-2.m
 %!error <Invalid call to ftell> ftell (1, 2)
 
-%% test/octave.test/io/ftell-3.m
 %!error ftell ("foo")
 
-%% test/octave.test/io/fseek-1.m
 %!error <Invalid call to fseek> fseek ()
 
-%% test/octave.test/io/fseek-2.m
 %!error <Invalid call to fseek> fseek (1, 0, SEEK_SET, 1)
 
-%% test/octave.test/io/fseek-3.m
 %!error fseek ("foo", 0, SEEK_SET)
 
-%% test/octave.test/io/frewind-1.m
 %!error <Invalid call to frewind> frewind ()
 
-%% test/octave.test/io/frewind-2.m
 %!error <Invalid call to frewind> frewind (1, 2)
 
-%% test/octave.test/io/frewind-3.m
 %!error frewind ("foo")
 
new file mode 100644
--- /dev/null
+++ b/test/jit.tst
@@ -0,0 +1,383 @@
+## Copyright (C) 2012 Max Brister
+## 
+## This file is part of Octave.
+## 
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 3 of the License, or (at your
+## option) any later version.
+## 
+## Octave is distributed in the hope that it will be useful, but WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## Author: Max Brister <max@2bass.com>
+
+## Test some simple cases that compile.
+
+%!test
+%! for i=1:1e6
+%!   if i < 5
+%!     break;
+%!   else
+%!     break;
+%!   endif
+%! endfor
+%! assert (i, 1);
+
+%!test
+%! while 1
+%!   if 1
+%!     break;
+%!  else
+%!    break;
+%!  endif
+%! endwhile
+
+%!test
+%! for i=1:1e6
+%!   if i == 100
+%!     break;
+%!   endif
+%! endfor
+%! assert (i, 100);
+
+%!test
+%! inc = 1e-5;
+%! result = 0;
+%! for ii = 0:inc:1
+%!   result = result + inc * (1/3 * ii * ii);
+%! endfor
+%! assert (abs (result - 1/9) < 1e-5);
+
+%!test
+%! inc = 1e-5;
+%! result = 0;
+%! for ii = 0:inc:1
+%!   ## the ^ operator's result is complex
+%!   result = result + inc * (1/3 * ii ^ 2);
+%! endfor
+%! assert (abs (result - 1/9) < 1e-5);
+
+%!test
+%! temp = 1+1i;
+%! nan = NaN;
+%! while 1
+%!   temp = temp - 1i;
+%!   temp = temp * nan;
+%!   break;
+%! endwhile
+%! assert (imag (temp), 0);
+
+%!test
+%! temp = 1+1i;
+%! nan = NaN+1i;
+%! while 1
+%!   nan = nan - 1i;
+%!   temp = temp - 1i;
+%!   temp = temp * nan;
+%!   break;
+%! endwhile
+%! assert (imag (temp), 0);
+
+%!test
+%! temp = 1+1i;
+%! while 1
+%!   temp = temp * 5;
+%!   break;
+%! endwhile
+%! assert (temp, 5+5i);
+
+%!test
+%! nr = 1001;
+%! mat = zeros (1, nr);
+%! for i = 1:nr
+%!   mat(i) = i;
+%! endfor
+%! assert (mat == 1:nr);
+
+%!test
+%! nr = 1001;
+%! mat = 1:nr;
+%! mat(end) = 0; # force mat to a matrix
+%! total = 0;
+%! for i = 1:nr
+%!   total = mat(i) + total;
+%! endfor
+%! assert (sum (mat) == total);
+
+%!test
+%! nr = 1001;
+%! mat = [3 1 5];
+%! try
+%!   for i = 1:nr
+%!     if i > 500
+%!       result = mat(100);
+%!     else
+%!       result = i;
+%!     endif
+%!   endfor
+%! catch
+%! end
+%! assert (result == 500);
+
+%!function result = gen_test (n)
+%!  result = double (rand (1, n) > .01);
+%!endfunction
+
+%!function z = vectorized (A, K)
+%!  temp = ones (1, K);
+%!  z = conv (A, temp);
+%!  z = z > K-1;
+%!  z = conv (z, temp);
+%!  z = z(K:end-K+1);
+%!  z = z >= 1;
+%!endfunction
+
+%!function z = loopy (A, K)
+%!  z = A;
+%!  n = numel (A);
+%!  counter = 0;
+%!  for ii=1:n
+%!    if z(ii)
+%!      counter = counter + 1;
+%!    else
+%!      if counter > 0 && counter < K
+%!        z(ii-counter:ii-1) = 0;
+%!      endif
+%!      counter = 0;
+%!    endif
+%!  endfor
+%!
+%!  if counter > 0 && counter < K
+%!    z(end-counter+1:end) = 0;
+%!  endif
+%!endfunction
+
+%!test
+%! test_set = gen_test (10000);
+%! assert (all (vectorized (test_set, 3) == loopy (test_set, 3)));
+
+%!test
+%! niter = 1001;
+%! i = 0;
+%! while (i < niter)
+%!   i = i + 1;
+%! endwhile
+%! assert (i == niter);
+
+%!test
+%! niter = 1001;
+%! result = 0;
+%! m = [5 10];
+%! for i=1:niter
+%!   result = result + m(end);
+%! endfor
+%! assert (result == m(end) * niter);
+
+%!test
+%! ndim = 100;
+%! result = 0;
+%! m = zeros (ndim);
+%! m(:) = 1:ndim^2;
+%! i = 1;
+%! while (i <= ndim)
+%!   for j = 1:ndim
+%!     result = result + m(i, j);
+%!    endfor
+%!   i = i + 1;
+%! endwhile
+%! assert (result == sum (sum (m)));
+
+%!test
+%! ndim = 100;
+%! m = zeros (ndim);
+%! i = 1;
+%! while (i <= ndim)
+%!   for j = 1:ndim
+%!     m(i, j) = (j - 1) * ndim + i;
+%!   endfor
+%!   i = i + 1;
+%! endwhile
+%! m2 = zeros (ndim);
+%! m2(:) = 1:(ndim^2);
+%! assert (all (m == m2));
+
+%!test
+%! ndim = 2;
+%! m = zeros (ndim, ndim, ndim, ndim);
+%! result = 0;
+%! i0 = 1;
+%! while (i0 <= ndim)
+%!   for i1 = 1:ndim
+%!     for i2 = 1:ndim
+%!       for i3 = 1:ndim
+%!         m(i0, i1, i2, i3) = 1;
+%!         m(i0, i1, i2, i3, 1, 1, 1, 1, 1, 1) = 1;
+%!         result = result + m(i0, i1, i2, i3);
+%!       endfor
+%!     endfor
+%!   endfor
+%!   i0 = i0 + 1;
+%! endwhile
+%! expected = ones (ndim, ndim, ndim, ndim);
+%! assert (all (m == expected));
+%! assert (result == sum (expected (:)));
+
+%!function test_divide ()
+%! state = warning ("query", "Octave:divide-by-zero").state;
+%! unwind_protect
+%!   warning ("error", "Octave:divide-by-zero");
+%!   for i=1:1e5
+%!     a = 1;
+%!     a / 0;
+%!   endfor
+%! unwind_protect_cleanup
+%!   warning (state, "Octave:divide-by-zero");
+%! end_unwind_protect
+%!endfunction
+
+%!error <division by zero> test_divide ()
+
+%!test
+%! while 1
+%!   a = 0;
+%!   result = a / 1;
+%!   break;
+%! endwhile
+%! assert (result, 0);
+
+%!test
+%! m = zeros (2, 1001);
+%! for i=1:1001
+%!   m(end, i) = i;
+%!   m(end - 1, end - i + 1) = i;
+%! endfor
+%! m2 = zeros (2, 1001);
+%! m2(1, :) = fliplr (1:1001);
+%! m2(2, :) = 1:1001;
+%! assert (m, m2);
+
+%!test
+%! m = [1 2 3];
+%! for i=1:1001
+%!   m = sin (m);
+%!   break;
+%! endfor
+%! assert (m == sin ([1  2 3]));
+
+%!test
+%! i = 0;
+%! while i < 10
+%!   i += 1;
+%! endwhile
+%! assert (i == 10);
+
+%!test
+%! i = 0;
+%! while i < 10
+%!   a = ++i;
+%! endwhile
+%! assert (i == 10);
+%! assert (a == 10);
+%!test
+%! i = 0;
+%! while i < 10
+%!   a = i++;
+%! endwhile
+%! assert (i == 10);
+%! assert (a == 9);
+
+%!test
+%! num = 2;
+%! a = zeros (1, num);
+%! i = 1;
+%! while i <= num
+%!   a(i) = norm (eye (i));
+%!   ++i;
+%! endwhile
+%! assert (a, ones (1, num));
+
+%!function test_compute_idom ()
+%! while (li <= length (l1) && si <= length (s1))
+%!   if (l1 (li) < s1 (si))
+%!     if (li == si)
+%!       break;
+%!     endif;
+%!     li++;
+%!   else
+%!     si++;
+%!   endif;
+%! endwhile
+
+%!error test_compute_idom ()
+
+%!function x = test_overload (a)
+%!  while 1
+%!    x = a;
+%!    break;
+%!  endwhile
+%!endfunction
+
+%!assert (test_overload (1), 1);
+%!assert (test_overload ([1 2]), [1 2]);
+
+%!function a = bubble (a = [3 2 1])
+%!  swapped = 1;
+%!  n = length (a);
+%!  while (swapped)
+%!    swapped = 0;
+%!    for i = 1:n-1
+%!      if a(i) > a(i + 1)
+%!        swapped = 1;
+%!        temp = a(i);
+%!        a(i) = a(i + 1);
+%!        a(i + 1) = temp;
+%!      endif
+%!    endfor
+%!  endwhile
+%!endfunction
+
+%!assert (bubble (), [1 2 3]);
+
+%!test
+%! a = 0;
+%! b = 1;
+%! for i=1:1e3
+%!   for j=1:2
+%!     a = a + b;
+%!   endfor
+%! endfor
+%! assert (a, 2000);
+%! assert (b, 1);
+
+%!test
+%! a = [1+1i 1+2i];
+%! b = 0;
+%! while 1
+%!   b = a(1);
+%!   break;
+%! endwhile
+%! assert (b, a(1));
+
+%!function test_undef ()
+%!  for i=1:1e7
+%!    XXX;
+%!  endfor
+%!endfunction
+
+%!error <undefined near> (test_undef);
+
+%!shared id
+%! id = @(x) x;
+
+%!assert (id (1), 1)
+%!assert (id (1+1i), 1+1i)
+%!assert (id (1, 2), 1)
+%!error <undefined> (id ())
+
--- a/test/line-continue.tst
+++ b/test/line-continue.tst
@@ -71,7 +71,6 @@
 %! y = [1,2];
 %! assert (y, x);
 
-%% test/oc tave.test/contin/contin-16.m
 %!test
 %! x = [ 1 , ...
 %! 2];
--- a/test/prefer.tst
+++ b/test/prefer.tst
@@ -16,82 +16,67 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/prefer/prefer-1.m
 %!test
 %! m = [3 2];
 %! assert (all (m == (3:-1:2)));
 
-%% test/octave.test/prefer/prefer-2.m
 %!test
 %! m = [3,
 %! 2];
 %! assert (all (m == (3:-1:2)'));
 
-%% test/octave.test/prefer/prefer-3.m
 %!test
 %! a = 2;
 %! assert ([a - 1], 1);
 
-%% test/octave.test/prefer/prefer-4.m
 %!test
 %! m = [3,2];
 %! fail ("[m ']");
 
-%% test/octave.test/prefer/prefer-5.m
 %!assert (all ([3 2] == (3:-1:2)));
 
-%% test/octave.test/prefer/prefer-6.m
 %!assert (all ([3, 2] == (3:-1:2)));
 
-%% test/octave.test/prefer/prefer-7.m
 %!test
 %! m = [3,2];
 %! assert (all ([m (1)] == (3:-1:1)));
 
-%% test/octave.test/prefer/prefer-8.m
 %!test
 %! m = [3,2];
 %! assert ([m(1)],3);
 
-%% test/octave.test/prefer/prefer-10.m
 %!test
 %! a = 2;
 %! assert ([a- 1], 1);
 
-%% test/octave.test/prefer/prefer-11.m
 %!test
 %! a = 1;
 %! assert (all ([a -1] == (1:-2:-1)));
 
-%% test/octave.test/prefer/prefer-12.m
 %!test
 %! wsn = warning ("query", "Octave:str-to-num");
 %! warning ("off", "Octave:str-to-num");
 %! assert ("d" + 0, 100);
 %! warning (wsn.state, "Octave:str-to-num");
 
-%% test/octave.test/prefer/prefer-13.m
 %!test
 %! wsn = warning ("query", "Octave:str-to-num");
 %! warning ("on", "Octave:str-to-num");
 %! fail ("'d' + 0", "warning");
 %! warning (wsn.state, "Octave:str-to-num");
 
-%% test/octave.test/prefer/prefer-14.m
 %!test
 %! wir = warning ("query", "Ocave:imag-to-real");
 %! warning ("off", "Ocave:imag-to-real");
 %! assert (eye (1+i), 1);
 %! warning (wir.state, "Ocave:imag-to-real");
 
-%% test/octave.test/prefer/prefer-15.m
 %!test
 %! wir = warning ("query", "Ocave:imag-to-real");
 %! warning ("on", "Ocave:imag-to-real");
 %! fail ("eye (1+i)", "warning");
 %! warning (wir.state, "Ocave:imag-to-real");
 
-%% test/octave.test/prefer/prefer-17.m
 %!test
 %! wrre = warning ("query", "Octave:resize-on-range-error");
 %! warning ("off", "Octave:resize-on-range-error");
@@ -100,13 +85,11 @@
 %! assert (all (a == [0,1,2]));
 %! warning (wrre.state, "Octave:resize-on-range-error");
 
-%% test/octave.test/prefer/prefer-18.m
 %!test
 %! clear a;
 %! a(1) = 1; a(2) = 2;
 %! assert (all (a == [1,2]));
 
-%% test/octave.test/prefer/prefer-21.m
 %!test
 %! ped = print_empty_dimensions ();
 %! print_empty_dimensions (0);
@@ -116,7 +99,6 @@
 %! assert (isempty (findstr (b{1} ,"[](0x0)")));
 %! print_empty_dimensions (ped);
 
-%% test/octave.test/prefer/prefer-22.m
 %!test
 %! ped = print_empty_dimensions ();
 %! print_empty_dimensions (1);
@@ -125,13 +107,10 @@
 %! assert (!isempty (findstr (b{1}, "[](0x0)")));
 %! print_empty_dimensions (ped);
 
-%% test/octave.test/prefer/prefer-23.m
 %!assert (all (size (inv ([])) == [0, 0]));
 
-%% test/octave.test/prefer/prefer-24.m
 %!assert (all (svd ([]) == zeros (0, 1)));
 
-%% test/octave.test/prefer/prefer-27.m
 %!test
 %! sp = save_precision ();
 %! save_precision (1);
@@ -144,7 +123,6 @@
 %! assert (x,3);
 %! save_precision (sp);
 
-%% test/octave.test/prefer/prefer-28.m
 %!test
 %! sp = save_precision ();
 %! save_precision (5);
@@ -158,7 +136,6 @@
 %! save_precision (sp);
 
 %% FIXME: How to capture standard output for comparison?
-%% test/octave.test/prefer/prefer-29.m
 %!function f ()
 %! 1
 %!endfunction
@@ -170,7 +147,6 @@
 %! silent_functions (sf);
 
 %% FIXME: Same problem as above!!!
-%% test/octave.test/prefer/prefer-30.m
 %!function f ()
 %! 1
 %!endfunction
@@ -181,42 +157,36 @@
 %! assert (??);
 %! silent_functions (sf);
 
-%% test/octave.test/prefer/prefer-32.m
 %!test
 %! wndz = warning ("query", "Octave:neg-dim-as-zero");
 %! warning ("on", "Octave:neg-dim-as-zero");
 %! fail ("eye (-1) == []", "warning");
 %! warning (wndz.state, "Octave:neg-dim-as-zero");
 
-%% test/octave.test/prefer/prefer-33.m
 %!test
 %! wndz = warning ("query", "Octave:neg-dim-as-zero");
 %! warning ("off", "Octave:neg-dim-as-zero");
 %! assert (all (size (eye (-1)) == [0, 0]));
 %! warning (wndz.state, "Octave:neg-dim-as-zero");
 
-%% test/octave.test/prefer/prefer-34.m
 %!test
 %! watv = warning ("query", "Octave:assign-as-truth-value");
 %! warning ("off", "Octave:assign-as-truth-value");
 %! if (x = 1) 1; endif
 %! warning (watv.state, "Octave:assign-as-truth-value");
 
-%% test/octave.test/prefer/prefer-35.m
 %!test
 %! watv = warning ("query", "Octave:assign-as-truth-value");
 %! warning ("on", "Octave:assign-as-truth-value");
 %! fail ("if (x = 1) 1; endif", "warning");
 %! warning (watv.state, "Octave:assign-as-truth-value");
 
-%% test/octave.test/prefer/prefer-38.m
 %!test
 %! wdbz = warning ("query", "Octave:divide-by-zero");
 %! warning ("off", "Octave:divide-by-zero");
 %! assert (isinf (1/0));
 %! warning (wdbz.state, "Octave:divide-by-zero");
 
-%% test/octave.test/prefer/prefer-39.m
 %!test
 %! wdbz = warning ("query", "Octave:divide-by-zero");
 %! warning ("on", "Octave:divide-by-zero");
--- a/test/recursion.tst
+++ b/test/recursion.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/recursion/recursion-1.m
 %!function y = f (x)
 %!  if (x == 1)
 %!    y = x;
@@ -28,7 +27,6 @@
 %!
 %!assert (f (5), 120)
 
-%% test/octave.test/recursion/recursion-2.m
 %!function y = f (x)
 %!  if (x == 1)
 %!    y = x;
--- a/test/return.tst
+++ b/test/return.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/return/return-1.m
 %!function y = f ()
 %!  y = 1;
 %!  return;
@@ -25,7 +24,6 @@
 %!
 %!assert (f (), 1)
 
-%% test/octave.test/return/return-2.m
 %!test
 %! return;
 
--- a/test/struct.tst
+++ b/test/struct.tst
@@ -16,95 +16,73 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/struct/fieldnames-1.m
 %!test
 %! s.a = 1;
 %! c = fieldnames (s);
 %! assert (iscell (c) && strcmp (c{1}, "a"));
 
-%% test/octave.test/struct/fieldnames-2.m
 %!test
 %! s.a.b = 1;
 %! c = fieldnames (s.a);
 %! assert (iscell (c) && strcmp (c{1}, "b"));
 
-%% test/octave.test/struct/fieldnames-3.m
 %!error <Invalid call to fieldnames> fieldnames ();
 
-%% test/octave.test/struct/fieldnames-4.m
 %!test
 %! s.a = 1;
 %! fail ("fieldnames (s, 1)", "Invalid call to fieldnames");
 
-%% test/octave.test/struct/fieldnames-5.m
 %!error fieldnames (1);
 
-%% test/octave.test/struct/isfield-1.m
 %!test
 %! s.aaa = 1;
 %! s.a = 2;
 %! assert (isfield (s, "a"));
 
-%% test/octave.test/struct/isfield-2.m
 %!test
 %! s.aaa = 1;
 %! s.a = 2;
 %! assert (!(isfield (s, "b")));
 
-%% test/octave.test/struct/isfield-3.m
 %!error <Invalid call to isfield> isfield ();
 
-%% test/octave.test/struct/isfield-4.m
 %!test
 %! s.aaa = 1;
 %! s.a = 2;
 %! fail ("isfield (s, 'a', 3);", "Invalid call to isfield");
 
-%% test/octave.test/struct/isfield-5.m
 %!assert (isfield (1, "m") == 0);
 
-%% test/octave.test/struct/isfield-6.m
 %!test
 %! s.a = 2;
 %! assert (isfield (s, 2) == 0);
 
-%% test/octave.test/struct/isstruct-1.m
 %!assert (!(isstruct (1)))
 
-%% test/octave.test/struct/isstruct-2.m
 %!assert (!(isstruct ([1, 2])))
 
-%% test/octave.test/struct/isstruct-3.m
 %!assert (!(isstruct ([])))
 
-%% test/octave.test/struct/isstruct-4.m
 %!assert (!(isstruct ([1, 2; 3, 4])))
 
-%% test/octave.test/struct/isstruct-5.m
 %!assert (!(isstruct ("t")))
 
-%% test/octave.test/struct/isstruct-6.m
 %!assert (!(isstruct ("test")))
 
-%% test/octave.test/struct/isstruct-7.m
 %!assert (!(isstruct (["test"; "ing"])))
 
 %!assert (!(isstruct ({1})))
 
-%% test/octave.test/struct/isstruct-8.m
 %!test
 %! s.a = 1;
 %! assert (isstruct (s));
 
-%% test/octave.test/struct/isstruct-9.m
 %!test
 %! s.a.b = 1;
 %! assert (isstruct (s.a));
 
-%% test/octave.test/struct/isstruct-10.m
 %!error <Invalid call to isstruct> isstruct ();
 
-%% test/octave.test/struct/isstruct-11.m
 %!test
 %! s.a = 1;
 %! fail ("isstruct (s, 1)", "Invalid call to isstruct");
--- a/test/switch.tst
+++ b/test/switch.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/switch/switch-1.m
 %!test
 %! a = 1;
 %! b = 2;
@@ -29,7 +28,6 @@
 %!
 %! assert (x == c && y == a && z == b && p == c);
 
-%% test/octave.test/switch/switch-2.m
 %!test
 %! a = 1;
 %! b = 2;
@@ -53,7 +51,6 @@
 %!
 %! assert (all (x == [3, 1, 2, 3]));
 
-%% test/octave.test/switch/switch-3.m
 %!test
 %! a = 1;
 %! b = 2;
@@ -84,13 +81,10 @@
 %! assert (a == 2);
 
 
-%% test/octave.test/switch/switch-4.m
 %!error <syntax error> eval ("switch endswitch")
 
-%% test/octave.test/switch/switch-5.m
 %!error <syntax error> eval ("switch case endswitch")
 
-%% test/octave.test/switch/switch-6.m
 %!error <syntax error> eval ("switch 1 default 1; endswitch")
 
 %% test parsing of single-quoted character string appearing immediately
--- a/test/system.tst
+++ b/test/system.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/system/cputime-1.m
 %!test
 %! [t1, u1, s1] = cputime ();
 %! for i = 1:200
@@ -30,46 +29,36 @@
 %! assert (s2 >= s2);
 %!#assert (t1 == u1 + s1 && t2 == u2 + s2 && t2 >= t1 && u2 >= u2 && s2 >= s2);
 
-%% test/octave.test/system/tic-toc-1.m
 %!test
 %! tic ();
 %! sleep (2);
 %! assert (toc () > 0);
 
-%% test/octave.test/system/pause-1.m
 %!test
 %! pause (0);
 %! __printf_assert__ ("ok\n");
 %! assert (__prog_output_assert__ ("ok"));
 
-%% test/octave.test/system/pause-2.m
 %!error <Invalid call to pause> pause (1, 2)
 
-%% test/octave.test/system/sleep-1.m
 %!test
 %! sleep (0);
 %! __printf_assert__ ("ok\n");
 %! assert (__prog_output_assert__ ("ok"));
 
-%% test/octave.test/system/sleep-2.m
 %!error <Invalid call to sleep> sleep ()
 
-%% test/octave.test/system/sleep-3.m
 %!error <Invalid call to sleep> sleep (1, 2)
 
-%% test/octave.test/system/usleep-1.m
 %!test
 %! usleep (0);
 %! __printf_assert__ ("ok\n");
 %! assert (__prog_output_assert__ ("ok"));
 
-%% test/octave.test/system/usleep-2.m
 %!error <Invalid call to usleep> usleep ()
 
-%% test/octave.test/system/usleep-3.m
 %!error <Invalid call to usleep> usleep (1, 2)
 
-%% test/octave.test/system/rename-1.m
 %!test
 %! from = tmpnam ();
 %! to = tmpnam ();
@@ -88,13 +77,10 @@
 %!   endif
 %! endif
 
-%% test/octave.test/system/rename-2.m
 %!error <Invalid call to rename> rename ()
 
-%% test/octave.test/system/rename-3.m
 %!error <Invalid call to rename> rename ("foo", "bar", 1)
 
-%% test/octave.test/system/unlink-1.m
 %!test
 %! nm = tmpnam ();
 %! if ((id = fopen (nm, "wb")) > 0)
@@ -105,24 +91,18 @@
 %!   endif
 %! endif
 
-%% test/octave.test/system/unlink-2.m
 %!error <Invalid call to unlink> unlink ()
 
-%% test/octave.test/system/unlink-3.m
 %!error <Invalid call to unlink> unlink ("foo", 1)
 
-%% test/octave.test/system/readdir-1.m
 %!test
 %! [files, status, msg] = readdir (filesep);
 %! assert (iscell (files) && status == 0 && strcmp (msg, ""));
 
-%% test/octave.test/system/readdir-2.m
 %!error <Invalid call to readdir> readdir ()
 
-%% test/octave.test/system/readdir-3.m
 %!error <Invalid call to readdir> readdir ("foo", 1)
 
-%% test/octave.test/system/mk-rm-dir-1.m
 %!test
 %! nm = tmpnam ();
 %! e1 = mkdir (nm);
@@ -131,23 +111,18 @@
 %! [s4, e4] = stat (nm);
 %! assert ((e1 && strcmp (s2.modestr(1), "d") && e3 && e4 < 0));
 
-%% test/octave.test/system/mkdir-1.m
 %!error <Invalid call to mkdir> mkdir ()
 
-%% test/octave.test/system/mkdir-2.m
 %!error <Invalid call to mkdir> mkdir ("foo", 1, 2)
 
-%% test/octave.test/system/rmdir-1.m
 %!error <Invalid call to rmdir> rmdir ()
 
-%% test/octave.test/system/rmdir-2.m
 %!test
 %! crr = confirm_recursive_rmdir ();
 %! confirm_recursive_rmdir (0);
 %! assert (!rmdir ("foo", "s"));
 %! confirm_recursive_rmdir (crr);
 
-%% test/octave.test/system/umask-1.m
 %!test
 %! orig_umask = umask (0);
 %! nm = tmpnam ();
@@ -168,13 +143,10 @@
 %! # Restore original umask value
 %! umask (orig_umask);
 
-%% test/octave.test/system/umask-2.m
 %!error <Invalid call to umask> umask ()
 
-%% test/octave.test/system/umask-3.m
 %!error <Invalid call to umask> umask (1, 2)
 
-%% test/octave.test/system/stat-1.m
 %!test
 %! [s, err, msg] = stat (filesep);
 %! assert ((err == 0
@@ -191,13 +163,10 @@
 %! && isfield (s, "ctime")
 %! && ischar (msg)));
 
-%% test/octave.test/system/stat-2.m
 %!error <Invalid call to stat> stat ()
 
-%% test/octave.test/system/stat-3.m
 %!error <Invalid call to stat> stat ("foo", 1)
 
-%% test/octave.test/system/lstat-1.m
 %!test
 %! [s, err, msg] = lstat (filesep);
 %! assert ((err == 0
@@ -214,140 +183,102 @@
 %! && isfield (s, "ctime")
 %! && ischar (msg)));
 
-%% test/octave.test/system/lstat-2.m
 %!error <Invalid call to lstat> lstat ()
 
-%% test/octave.test/system/lstat-3.m
 %!error <Invalid call to lstat> lstat ("foo", 1)
 
-%% test/octave.test/system/glob-1.m
 %!assert (iscell (glob ([filesep "*"])))
 
-%% test/octave.test/system/glob-2.m
 %!error <Invalid call to glob> glob ()
 
-%% test/octave.test/system/glob-3.m
 %!error <Invalid call to glob> glob ("foo", 1)
 
-%% test/octave.test/system/fnmatch-1.m
 %!test
-%! string_fill_char = setstr (0);
+%! string_fill_char = char (0);
 %! assert ((fnmatch ("a*a", {"aba"; "xxxba"; "aa"}) == [1; 0; 1]
 %! && fnmatch ({"a*a"; "b*b"}, "bob")
 %! && fnmatch ("x[0-5]*", {"x1"; "x6"}) == [1; 0]
 %! && fnmatch ("x[0-5]*", {"x1"; "x6"; "x001"}) == [1; 0; 1]
 %! && fnmatch ("x???y", {"xabcy"; "xy"}) == [1; 0]));
 
-%% test/octave.test/system/fnmatch-2.m
 %!error <Invalid call to fnmatch> fnmatch ()
 
-%% test/octave.test/system/fnmatch-3.m
 %!error <Invalid call to fnmatch> fnmatch ("foo", "bar", 3)
 
-%% test/octave.test/system/file_in_path-1.m
 %!assert (ischar (file_in_path (path (), "date.m")))
 
-%% test/octave.test/system/file_in_path-2.m
 %!error <invalid option> file_in_path ("foo", "bar", 1)
 
-%% test/octave.test/system/file_in_path-3.m
 %!error <Invalid call to file_in_path> file_in_path ()
 
-%% test/octave.test/system/file_in_path-4.m
 %!error <Invalid call to file_in_path> file_in_path ("foo", "bar", "baz", "ooka")
 
-%% test/octave.test/system/tilde_expand-1.m
 %!testif HAVE_GETPWUID
 %! x = getpwuid (getuid ());
 %! assert ((strcmp (x.dir, tilde_expand ("~"))
 %! && strcmp (x.dir, tilde_expand (sprintf ("~%s", x.name)))
 %! && strcmp ("foobar", tilde_expand ("foobar"))));
 
-%% test/octave.test/system/tilde_expand-2.m
 %!error <Invalid call to tilde_expand> tilde_expand ()
 
-%% test/octave.test/system/tilde_expand-3.m
 %!error <Invalid call to tilde_expand> tilde_expand ("str", 2)
 
-%% test/octave.test/system/getpgrp-1.m
 %!testif HAVE_GETPGRP
 %! assert (getpgrp () > 0);
 
-%% test/octave.test/system/getpgrp-2.m
 %!error <... getpgrp> getpgrp (1)
 
-%% test/octave.test/system/getpid-1.m
 %!assert (getpid () > 0)
 
-%% test/octave.test/system/getpid-2.m
 %!error <... getpid> getpid (1)
 
-%% test/octave.test/system/getppid-1.m
 %!testif HAVE_GETPPID
 %! assert (getppid () > 0);
 
-%% test/octave.test/system/getppid-2.m
 %!error <... getppid> getppid (1)
 
-%% test/octave.test/system/geteuid-1.m
 %!assert (geteuid () >= 0)
 
-%% test/octave.test/system/geteuid-2.m
 %!error <... geteuid> geteuid (1)
 
-%% test/octave.test/system/getuid-1.m
 %!assert (getuid () >= 0)
 
-%% test/octave.test/system/getuid-2.m
 %!error <... getuid> getuid (1)
 
-%% test/octave.test/system/getegid-1.m
 %!assert (getegid () >= 0)
 
-%% test/octave.test/system/getegid-2.m
 %!error <... getegid> getegid (1)
 
-%% test/octave.test/system/getgid-1.m
 %!assert (getgid () >= 0)
 
-%% test/octave.test/system/getgid-2.m
 %!error <... getgid> getgid (1)
 
-%% test/octave.test/system/getenv-1.m
 %!assert (getenv ("HOME"), tilde_expand ("~"))
 
-%% test/octave.test/system/getenv-2.m
 %!error <Invalid call to getenv> getenv ()
 
-%% test/octave.test/system/getenv-3.m
 %!error <Invalid call to getenv> getenv ("foo", 1)
 
-%% test/octave.test/system/getenv-4.m
 %!test
 %! wns = warning ("query", "Octave:num-to-str");
 %! warning ("on", "Octave:num-to-str");
 %! fail ("getenv (1)", "warning");
 %! warning (wns.state, "Octave:num-to-str");
 
-%% test/octave.test/system/putenv-1.m
 %!test
 %! putenv ("foobar", "baz");
 %! assert (getenv ("foobar"), "baz");
 
-%% test/octave.test/system/putenv-2.m
 %!error <Invalid call to putenv> putenv ()
 
-%% test/octave.test/system/putenv-3.m
 %!error <Invalid call to putenv> putenv ("foo", "bar", 1)
 
-%% test/octave.test/system/putenv-4.m
 %!test
 %! wns = warning ("query", "Octave:num-to-str");
 %! warning ("on", "Octave:num-to-str");
 %! fail ("putenv (1, 2)","warning");
 %! warning (wns.state, "Octave:num-to-str");
 
-%% test/octave.test/system/cd-1.m
 %!test
 %! xdir = pwd ();
 %! cd /
@@ -363,13 +294,10 @@
 %! endif
 %! assert (pwd (), xdir);
 
-%% test/octave.test/system/cd-2.m
 %!error cd (1)
 
-%% test/octave.test/system/pwd-1.m
 %!assert (ischar (pwd ()))
 
-%% test/octave.test/system/getpwent-1.m
 %!testif HAVE_GETPWENT
 %! s = getpwent ();
 %! endpwent ();
@@ -382,36 +310,28 @@
 %! && isfield (s, "dir")
 %! && isfield (s, "shell")));
 
-%% test/octave.test/system/getpwent-2.m
 %!error <Invalid call to getpwent> getpwent (1)
 
-%% test/octave.test/system/getpwuid-1.m
 %!testif HAVE_GETPWUID
 %! x = getpwent ();
 %! y = getpwuid (x.uid);
 %! endpwent ();
 %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid);
 
-%% test/octave.test/system/getpwuid-2.m
 %!error <Invalid call to getpwuid> getpwuid ()
 
-%% test/octave.test/system/getpwuid-3.m
 %!error <Invalid call to getpwuid> getpwuid (1, 2)
 
-%% test/octave.test/system/getpwnam-1.m
 %!testif HAVE_GETPWNAM
 %! x = getpwent ();
 %! y = getpwnam (x.name);
 %! endpwent ();
 %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid);
 
-%% test/octave.test/system/getpwnam-2.m
 %!error <Invalid call to getpwnam> getpwnam ()
 
-%% test/octave.test/system/getpwnam-3.m
 %!error <Invalid call to getpwnam> getpwnam ("foo", 1)
 
-%% test/octave.test/system/setpwent-1.m
 %!testif HAVE_SETPWENT
 %! x = getpwent ();
 %! setpwent ();
@@ -419,13 +339,10 @@
 %! endpwent ();
 %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid);
 
-%% test/octave.test/system/setpwent-2.m
 %!error <Invalid call to setpwent> setpwent (1)
 
-%% test/octave.test/system/endpwent-1.m
 %!error <Invalid call to endpwent> endpwent (1)
 
-%% test/octave.test/system/getgrent-1.m
 %!testif HAVE_GETGRENT
 %! x = getgrent ();
 %! endgrent ();
@@ -435,36 +352,28 @@
 %! && isfield (x, "gid")
 %! && isfield (x, "mem")));
 
-%% test/octave.test/system/getgrent-2.m
 %!error <Invalid call to getgrent> getgrent (1)
 
-%% test/octave.test/system/getgrgid-1.m
 %!testif HAVE_GETGRGID
 %! x = getgrent ();
 %! y = getgrgid (x.gid);
 %! endgrent ();
 %! assert (strcmp (x.name, y.name) && x.gid == y.gid);
 
-%% test/octave.test/system/getgrgid-2.m
 %!error <Invalid call to getgrgid> getgrgid ()
 
-%% test/octave.test/system/getgrgid-3.m
 %!error <Invalid call to getgrgid> getgrgid (1, 2)
 
-%% test/octave.test/system/getgrnam-1.m
 %!testif HAVE_GETGRNAM
 %! x = getgrent ();
 %! y = getgrnam (x.name);
 %! endgrent ();
 %! assert (strcmp (x.name, y.name) && x.gid == y.gid);
 
-%% test/octave.test/system/getgrnam-2.m
 %!error <Invalid call to getgrnam> getgrnam ()
 
-%% test/octave.test/system/getgrnam-3.m
 %!error <Invalid call to getgrnam> getgrnam ("foo", 1)
 
-%% test/octave.test/system/setgrent-1.m
 %!testif HAVE_SETGRENT
 %! x = getgrent ();
 %! setgrent ();
@@ -472,18 +381,13 @@
 %! endgrent ();
 %! assert (strcmp (x.name, y.name) && x.gid == y.gid);
 
-%% test/octave.test/system/setgrent-2.m
 %!error <Invalid call to setgrent> setgrent (1)
 
-%% test/octave.test/system/endgrent-1.m
 %!error <Invalid call to endgrent> endgrent (1)
 
-%% test/octave.test/system/isieee-1.m
 %!assert (isieee () == 1 || isieee () == 0)
 
-%% test/octave.test/system/octave_config_info-1.m
 %!assert (isstruct (octave_config_info ()))
 
-%% test/octave.test/system/getrusage-1.m
 %!assert (isstruct (getrusage ()))
 
--- a/test/try.tst
+++ b/test/try.tst
@@ -16,14 +16,12 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/try/try-1.m
 %!test
 %! try
 %! catch
 %!   error ("Shoudn't get here");
 %! end_try_catch
 
-%% test/octave.test/try/try-2.m
 %!test
 %! try
 %!   clear a;
@@ -33,7 +31,6 @@
 %! a = 1;
 %! assert (a,1);
 
-%% test/octave.test/try/try-3.m
 %!test
 %! clear x;
 %! try
@@ -46,7 +43,6 @@
 %! assert (!exist ('x'));
 %! assert (a,2);
 
-%% test/octave.test/try/try-4.m
 %!test
 %! try
 %!   clear a;
@@ -56,7 +52,6 @@
 %! end_try_catch
 %! assert (exist ('x'));
 
-%% test/octave.test/try/try-5.m
 %!test
 %! try
 %!   clear a;
@@ -67,7 +62,6 @@
 %! end_try_catch
 %! assert (lasterr()(1:13), "'a' undefined");
 
-%% test/octave.test/try/try-6.m
 %!test
 %! try
 %!   error ("user-defined error");
@@ -75,10 +69,9 @@
 %!   assert (lasterr, "user-defined error");
 %! end_try_catch
 
-%% test/octave.test/try/try-7.m
 %!function ms = mangle (s)
 %!  ## Wrap angle brackets around S.
-%!  ms = cstrcat ("<", s, ">");
+%!  ms = ["<" s ">"];
 %!endfunction
 %!test
 %! try
@@ -89,7 +82,6 @@
 %!   assert (mangle (lasterr)(1:14), "<'a' undefined");
 %! end_try_catch
 
-%% test/octave.test/try/try-8.m
 %!test
 %! try
 %!   try
@@ -106,7 +98,6 @@
 %!   assert (lasterr()(1:13), "'b' undefined");
 %! end_try_catch
 
-%% test/octave.test/try/try-9.m
 %!test
 %! try
 %!   clear a;
@@ -123,7 +114,6 @@
 %!   end_try_catch
 %! end_try_catch
 
-%% test/octave.test/try/try-10.m
 %!test
 %! try
 %!   try
@@ -131,7 +121,7 @@
 %!     a;
 %!     error ("Shoudn't get here");
 %!   catch
-%!     error (cstrcat ("rethrow: ", lasterr));
+%!     error (["rethrow: " lasterr]);
 %!   end_try_catch
 %! catch
 %!   assert (lasterr()(1:22), "rethrow: 'a' undefined");
--- a/test/unwind.tst
+++ b/test/unwind.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/unwind/unwind-1.m
 %!function y = f (x)
 %!  global g;
 %!  save_g = g;
@@ -37,7 +36,6 @@
 %! y = f ([3,4]);
 %! assert (y, [0,1,-1]);
 
-%% test/octave.test/unwind/unwind-2.m
 %!function y = f (x)
 %!  global g;
 %!  save_g = g;
--- a/test/while.tst
+++ b/test/while.tst
@@ -16,7 +16,6 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-%% test/octave.test/while/while-1.m
 %!test
 %! i = 0;
 %! while (eye (2))
@@ -25,7 +24,6 @@
 %! endwhile
 %! assert (__prog_output_assert__ (""));
 
-%% test/octave.test/while/while-2.m
 %!test
 %! i = 5;
 %! while (--i)
@@ -34,7 +32,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("4321"));
 
-%% test/octave.test/while/while-3.m
 %!test
 %! i = 5;
 %! while (i)
@@ -44,7 +41,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("43210"));
 
-%% test/octave.test/while/while-4.m
 %!test
 %! i = 0;
 %! while (i++ < 20)
@@ -56,7 +52,6 @@
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("12"));
 
-%% test/octave.test/while/while-5.m
 %!test
 %! i = 0;
 %! while (++i < 5)