view 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
line wrap: on
line source

## System-wide startup file for Octave.
##
## If the environment variable OCTAVE_VERSION_INITFILE is set when Octave
## starts, then that file is executed instead of this file.
##
## This file contains commands that should be executed each time Octave starts
## for every user at this site.

## Configure readline using the file inputrc in the Octave startup directory.
readline_read_init_file (sprintf ("%s%s%s",
                                  octave_config_info ("startupfiledir"),
                                  filesep, "inputrc"));

## Configure LESS pager if present
if (strcmp (PAGER (), "less") && isempty (getenv ("LESS")))
  PAGER_FLAGS ('-e -X -P"-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$"');
endif

## This appears here instead of in the pkg/PKG_ADD file so that --norc
## will also skip automatic loading of packages.
pkg ("load", "auto");

## For Matlab compatibility, run startup.m when starting Octave.
if (exist ("startup", "file))
  startup;  # No arg list here since startup might be a script.
endif

## For Matlab compatibility, schedule finish.m to run when exiting Octave.
atexit ("__finish__");