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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5316
aaa6df7aa13a [project @ 2005-04-28 15:01:33 by jwe]
jwe
parents:
diff changeset
1 ## System-wide startup file for Octave.
aaa6df7aa13a [project @ 2005-04-28 15:01:33 by jwe]
jwe
parents:
diff changeset
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
aaa6df7aa13a [project @ 2005-04-28 15:01:33 by jwe]
jwe
parents:
diff changeset
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
e8868fde0fc5 [project @ 2006-11-07 20:52:18 by jwe]
jwe
parents: 5794
diff changeset
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
e8868fde0fc5 [project @ 2006-11-07 20:52:18 by jwe]
jwe
parents: 5794
diff changeset
15 if (strcmp (PAGER (), "less") && isempty (getenv ("LESS")))
e8868fde0fc5 [project @ 2006-11-07 20:52:18 by jwe]
jwe
parents: 5794
diff changeset
16 PAGER_FLAGS ('-e -X -P"-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$"');
e8868fde0fc5 [project @ 2006-11-07 20:52:18 by jwe]
jwe
parents: 5794
diff changeset
17 endif
7073
66c6cab344f7 [project @ 2007-10-26 16:09:12 by jwe]
jwe
parents: 6144
diff changeset
18
66c6cab344f7 [project @ 2007-10-26 16:09:12 by jwe]
jwe
parents: 6144
diff changeset
19 ## This appears here instead of in the pkg/PKG_ADD file so that --norc
66c6cab344f7 [project @ 2007-10-26 16:09:12 by jwe]
jwe
parents: 6144
diff changeset
20 ## will also skip automatic loading of packages.
66c6cab344f7 [project @ 2007-10-26 16:09:12 by jwe]
jwe
parents: 6144
diff changeset
21 pkg ("load", "auto");
7391
f071480b7eac [project @ 2008-01-17 07:50:33 by jwe]
jwe
parents: 7073
diff changeset
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
17f2cdb5232e [project @ 2008-01-17 08:14:32 by jwe]
jwe
parents: 7391
diff changeset
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