1,847
edits
(How can I contribute code to Octave?) |
|||
(One intermediate revision by the same user not shown) | |||
Line 13: | Line 13: | ||
== How can I contribute code to Octave? == | == How can I contribute code to Octave? == | ||
In general you can contribute code to Octave in form of '''patches (changesets)'''. Those have to be uploaded to the [https://savannah.gnu.org/bugs/?group=octave bug] or [https://savannah.gnu.org/patch/?group=octave patch] tracker. | |||
== How can I find which file implements a given command? == | * In [[Building]] is described, how you get and build the latest Octave source code on your system. | ||
* In [[Mercurial]] we describe, how you create a patch (changeset) from your modifications. | |||
* Our [[Contribution guidelines]] should be read and followed as well, to ensure acceptance of your contribution. | |||
== How can I find which source file implements a given command? == | |||
Use Octave's {{manual|which}} command. | |||
=== m-file functions === | |||
<syntaxhighlight lang="Octave"> | <syntaxhighlight lang="Octave"> | ||
>> which help | >> which help | ||
Line 24: | Line 31: | ||
'help' is a function from the file /some/path/m/help/help.m | 'help' is a function from the file /some/path/m/help/help.m | ||
In this case, the desired function is a m-file, one can simply edit it inside the GUI, just type: | |||
<syntaxhighlight lang="Octave"> | <syntaxhighlight lang="Octave"> | ||
>> edit help | >> edit help | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== built-in functions === | |||
Some functions are already compiled (a.k.a. ''built-in functions''), for example: | Some functions are already compiled (a.k.a. ''built-in functions''), for example: | ||
Line 37: | Line 47: | ||
'addpath' is a built-in function from the file libinterp/corefcn/load-path.cc | 'addpath' is a built-in function from the file libinterp/corefcn/load-path.cc | ||
This function is to be found in Octave's source code, in this case at [https://hg.savannah.gnu.org/hgweb/octave/file/b33d4fbce33e/libinterp/corefcn/load-path.cc#l2355]. | This function is to be found in Octave's source code, in this case at {{Path|[https://hg.savannah.gnu.org/hgweb/octave/file/b33d4fbce33e/libinterp/corefcn/load-path.cc#l2355 libinterp/corefcn/load-path.cc]}}. Open the respective file with an editor of your choice and search for the pattern "<code> (addpath,</code>". | ||
[[Category:Development]] | [[Category:Development]] | ||
[[Category:FAQ]] | [[Category:FAQ]] |