Edit the named function, or change editor settings.
If edit
is called with the name of a file or function as its
argument it will be opened in the text editor defined by EDITOR
.
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 leading
"@"
and trailing ".m"
will be considered.
HOME
to contain that
function along with its current definition.
name.cc
is specified, then it will search for
name.cc
in the path and try to modify it, otherwise it will
create a new .cc file in the current directory. If 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.
HOME
before editing.
Warning: You may need to clear name before the new definition
is available. If you are editing a .cc file, you will need to execute
mkoctfile name.cc
before the definition will be
available.
If edit
is called with field and value variables, the
value of the control field field will be set to value.
If an output argument is requested and the first input argument is
get
then edit
will return the value of the control field
field. If the control field does not exist, edit will return a
structure containing all fields and values. Thus, edit ("get",
returns a complete control structure.
"all"
)
The following control fields are used:
This is the location of user local m-files. Be sure it is in your path. The default is ~/octave.
This is the name to put after the "## Author:" field of new functions. By
default it guesses from the gecos
field of the password database.
This is the e-mail address to list after the name in the author field. By
default it guesses <$LOGNAME@$HOSTNAME>
, and if $HOSTNAME
is not defined it uses uname -n
. You probably want to override
this. Be sure to use the format user@host
.
GNU General Public License (default).
BSD-style license without advertising clause.
Public domain.
Your own default copyright and license.
Unless you specify ‘pd’, edit will prepend the copyright statement with "Copyright (C) YYYY Author".
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 ‘system’).
Determines whether files should be edited in place, without regard to
whether they are modifiable or not. The default is false
.
Package: octave