Mercurial > octave
annotate scripts/startup/version-rcfile @ 21350:ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
* NEWS: Announce new behavior.
* basics.txi: Document file
* version-rcfile: Add command to execute startup.m if it exists.
Clean up formatting of file.
* __finish__.m: Fix typo in docstring. Clean up comments to match
version-rcfile.
* site-rcfile: Clean up formatting.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 25 Feb 2016 11:25:29 -0800 |
parents | ac0f7acdc3fd |
children | 1e0889a31c6a |
rev | line source |
---|---|
5316 | 1 ## System-wide startup file for Octave. |
2 ## | |
20479
ac0f7acdc3fd
avoid executing startup file twice when using run-octave script (bug #45872)
John W. Eaton <jwe@octave.org>
parents:
18013
diff
changeset
|
3 ## If the environment variable OCTAVE_VERSION_INITFILE is set when Octave |
ac0f7acdc3fd
avoid executing startup file twice when using run-octave script (bug #45872)
John W. Eaton <jwe@octave.org>
parents:
18013
diff
changeset
|
4 ## starts, then that file is executed instead of this file. |
ac0f7acdc3fd
avoid executing startup file twice when using run-octave script (bug #45872)
John W. Eaton <jwe@octave.org>
parents:
18013
diff
changeset
|
5 ## |
21350
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
6 ## This file contains commands that should be executed each time Octave starts |
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
7 ## for every user at this site. |
5316 | 8 |
21350
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
9 ## Configure readline using the file inputrc in the Octave startup directory. |
16879
cc3743a91652
Rename read_readline_init_file to readline_read_init_file.
Rik <rik@octave.org>
parents:
7392
diff
changeset
|
10 readline_read_init_file (sprintf ("%s%s%s", |
18013
501cb6a90f0f
maint: Replace unnecessary tabs with spaces.
Rik <rik@octave.org>
parents:
16879
diff
changeset
|
11 octave_config_info ("startupfiledir"), |
501cb6a90f0f
maint: Replace unnecessary tabs with spaces.
Rik <rik@octave.org>
parents:
16879
diff
changeset
|
12 filesep, "inputrc")); |
6144 | 13 |
21350
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
14 ## Configure LESS pager if present |
6144 | 15 if (strcmp (PAGER (), "less") && isempty (getenv ("LESS"))) |
16 PAGER_FLAGS ('-e -X -P"-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$"'); | |
17 endif | |
7073 | 18 |
19 ## This appears here instead of in the pkg/PKG_ADD file so that --norc | |
20 ## will also skip automatic loading of packages. | |
21 pkg ("load", "auto"); | |
7391 | 22 |
21350
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
23 ## For Matlab compatibility, run startup.m when starting Octave. |
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
24 if (exist ("startup", "file)) |
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
25 startup; # No arg list here since startup might be a script. |
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
26 endif |
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
27 |
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
28 ## For Matlab compatibility, schedule finish.m to run when exiting Octave. |
7392 | 29 atexit ("__finish__"); |
21350
ea31a050bdd8
Execute commands in startup.m at start for compatibility with Matlab.
Rik <rik@octave.org>
parents:
20479
diff
changeset
|
30 |