Index: edit.m =================================================================== RCS file: /cvsroot/octave/octave-forge/main/miscellaneous/edit.m,v retrieving revision 1.18 diff -u -r1.18 edit.m --- edit.m 22 Mar 2006 17:50:47 -0000 1.18 +++ edit.m 31 Mar 2006 01:24:53 -0000 @@ -1,85 +1,115 @@ -## edit name -## Edit the named function. -## -## If the function is available in a file on your path and that file -## is modifiable, then it will be editted in place. If it is a system -## function, then it will first be copied to the directory HOME -## and then editted. -## -## If name is the name of a function defined in the interpreter but -## not in an m-file, then an m-file will be created in HOME -## to contain that function along with its current definition. -## -## If 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 HOME. 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. -## -## If name.ext is on your path then it will be editted, otherwise -## the editor will be started with HOME/name.ext as the -## filename. If name.ext is not modifiable, it will be copied to -## HOME before editting. -## -## WARNING!! You may need to clear name before the new definition -## is available. If you are editting a .cc file, you will need -## to mkoctfile name.cc before the definition will be available. -## -## edit field value -## Set the value for an edit control field. -## -## edit get field -## Return the value for an edit control field. +## -*- texinfo -*- +## @deftypefn {Function File} {} edit @var{name} +## Edit the named function. +## +## If the function is available in a file on your path and that file +## is modifiable, then it will be editted in place. If it is a system +## function, then it will first be copied to the directory @var{home} +## and then editted. +## +## If @var{name} is the name of a function defined in the interpreter but +## not in an m-file, then an m-file will be created in @var{home} +## to contain that function along with its current definition. +## +## If @var{name}.cc is specified, then it will search for @var{name}.cc in the +## path and try to modify it, otherwise it will create a new .cc file +## in @var{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. +## +## If @var{name}.ext is on your path then it will be editted, otherwise +## the editor will be started with @var{home}/@var{name}.ext as the +## filename. If @var{name}.ext is not modifiable, it will be copied to +## @var{home} before editting. +## +## WARNING!! You may need to clear @var{name} before the new definition +## is available. If you are editting a .cc file, you will need +## to mkoctfile @var{name}.cc before the definition will be available. +## +## @table @samp +## @item edit(@var{field}, @var{value}) +## Set the value for an edit control field. +## +## @item edit(@var{get}, @var{field}) +## Return the value for an edit control field. +## @end table ## ## The following control fields are used: ## -## editor -## This is the editor to use to modify the functions. By default it uses -## Octave's EDITOR state variable, which comes from getenv("EDITOR") and -## defaults to vi. Use %s in place of the function name. E.g., -## [EDITOR, " %s"] -## use the editor which Octave uses for bug_report -## "xedit %s &" -## pop up simple X11 editor in a separate window -## "gnudoit -q \"(find-file \\\"%s\\\")\"" -## send it to current emacs; must have (gnuserv-start) in .emacs -## -## home -## This is the location of user local m-files. Be be sure it is on LOADPATH. -## The default is ~/octave. -## -## author -## This is the name to put after the "## Author:" field of new functions. -## By default it guesses from the `gecos' field of password database. -## -## email -## This is the e-mail address to list after the name in the author field. -## By default it guesses
, and if $HOSTNAME is not -## defined it uses "uname -n". You probably want to override this. Be -## sure to use "" as your format. -## -## license -## gpl GNU General Public License (default) -## bsd BSD-style license without advertising clause -## pd public domain -## "text" your own default copyright and license -## -## Unless you specify PD, edit will prepend the copyright statement -## with "Copyright (C) yyyy Function Author" +## @table @samp +## @item editor +## This is the editor to use to modify the functions. By default it uses +## Octave's EDITOR state variable, which comes from getenv("EDITOR") and +## defaults to vi. Use %s in place of the function name. E.g., +## +## @example +## [EDITOR, " %s"] +## @end example +## use the editor which Octave uses for bug_report +## +## @example +## "xedit %s &" +## @end example +## pop up simple X11 editor in a separate window +## +## @example +## "gnudoit -q \"(find-file \\\"%s\\\")\"" +## @end example +## send it to current emacs; must have (gnuserv-start) in .emacs +## +## @example +## '"C:/Program Files/Good Editor/Editor.exe" "`cygpath -wa %s`"' +## @end example +## in cygwin, to use your favorite native windows based (non-cygwin) +## editor. Pay special attention to the "" and the ``; they are +## significant. +## +## @item home +## This is the location of user local m-files. Be be sure it is on LOADPATH. +## The default is ~/octave. +## +## @item author +## This is the name to put after the "## Author:" field of new functions. +## By default it guesses from the `gecos' field of password database. +## +## @item email +## 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 "