Package: startup
================

Version: 0.13.0 [2019-10-26]

NEW FEATURES:

 * startup::startup() will return immediately without processing R startup
   files if environment variable 'R_STARTUP_DISABLE' is set to 'TRUE'.

 * Added flag 'radian' to sysinfo() indicating whether R runs in radian
   (previously known as rtichoke and rice) or not.  Please stop using the
   'rice' and 'rtichoke' flags.

 * The startup::startup() code snipped injected in the .Rprofile file by
   startup::install() now prefix error messages with '.Rprofile error: '
   to help troubleshooting errors.

BUG FIXES:

 * The validation of 'R_LIBS', 'R_LIBS_SITE', 'R_LIBS_USER' by startup::check()
   had a _R_CHECK_LENGTH_1_LOGIC2_ bug.
   
 * The startup checks asserting that update.packages() is not called would
   pick up not only those with the period ('.') but any character in that
   position.

DEPRECATED AND DEFUNCT:

 * startup::startup() no longer warn about startup files with non-declared key
   names being skipped. This warning was introduced in startup 0.10.0 due to
   how such files were filtered out.


Version: 0.12.0 [2019-05-26]

SIGNIFICANT CHANGES:

 * Renviron and Rprofile startup files that use <key>!=<value> filters with
   non-defined keys are now included.  Previously they were skipped.  Note
   that <key>=<value> files are indeed skipped when <key> is not defined.

 * startup() now produces an informative warning if it detects that an R
   option that is considered unsafe to change from its default, e.g. changing
   'encoding' other than in interactive mode may break package installations
   and changing 'stringsAsFactors' will summon the dead.

NEW FEATURES:

 * Added support for when=<periodicity> file declarations, where <periodicity>
   can be 'once', 'hourly', 'daily', 'weekly', 'fortnightly', and 'monthly'.
   A startup file with such a declaration will be processed at most once per
   <periodicity>, e.g. a file with 'when=daily' somewhere in the pathname will
   be processed once per day.  The periodicity is based on the walltime in the
   local time zone, e.g. if a file with 'when=daily' was processed one minute
   before midnight, it will be processed again if an R session is started one
   minute past midnight.  Updating the file timestamp of a 'when' file will
   reset its timer.

 * Code in environment variable 'R_STARTUP_INIT' will now be evaluated by
   startup::startup() after Renviron and Rprofile files have been processed.
   For example, 'R_STARTUP_INIT="x <- 1" R' will launch R with 'x == 1'.

 * startup(debug = TRUE) now also reports on .First().

 * The messages of warnings and errors produced by the startup package itself
   now mention which startup function they originate from.  This helps to
   identify the origin of these when produced during the R startup process.

 * Added warn(), which produces a warning with information on which R source
   file it was produced in, if any.

MISCELLANEOUS:

 * Renamed example folders .Renviron.d/ and .Rprofile.d/ installed as part
   of the package to Renviron.d/ and Rprofile.d/ without the leading period.
   This was simply done to avoid 'R CMD check --as-cran' NOTEs.

BUG FIXES:

 * startup() did not ignore files with names such as #foo.R#.
 
DEPRECATED AND DEFUNCT:

 * Removed defunct renviron() and rprofile(). Use renviron_d() and rprofile_d().
 

Version: 0.11.0 [2018-08-24]

NEW FEATURES:

 * startup(debug = TRUE) now also displays the expanded path to any file or
   folder listed.  It also gives information on files that known environment
   variables (e.g. R_ENVIRON_USER) point to.  For Renviron files, it also
   reports on names of the environment variables set in each of those files.

 * startup(debug = TRUE) reports on the search path and loaded namespaces,
   and what packages will be attached after startup finishes.

 * Added character 'dirname' to sysinfo() specifying the basename of the
   current working directory.

 * startup(check = TRUE), warns if R_ENVIRON, R_ENVIRON_USER, R_PROFILE,
   R_PROFILE_USER, R_BUILD_ENVIRON, or R_CHECK_ENVIRON specifies non-existing
   files.

 * startup::check(fix = TRUE) now returns the pathnames of any files that
   needed to be fixed and was successfully updated.

 * RStudio: startup() now gives an informative warning if option 'error' is
   set during the R startup and it will be overridden by RStudio's debug
   settings.

 * Windows: Calling startup::restart() in the Windows RGui now produces an
   error clarifying that the RGui cannot be restarted this way.


BUG FIXES:

 * startup::install() would append the startup::startup() statement to the
   last line in .Rprofile if that line (incorrectly) did not have a newline.

 * startup::startup(check = TRUE) would give "Error in if (!eof_ok(file)) { : 
   argument is of length zero" on Windows if the Rprofile file checked is
   a symbolic link.
   

Version: 0.10.0 [2018-03-26]

SIGNIFICANT CHANGES:

 * Renviron and Rprofile startup files that use <key>=<value> filters with
   non-declared keys are skipped.  Previously they were always processed.
   This update makes it easier to include "secrets", e.g. files in folder
   ~/.Renviron.d/private/SECRET=banana/ will only be included if the
   environment variable 'SECRET' is set to exactly 'banana'.  An informative
   warning, which can be disabled, will be produced by startup 0.10.* until
   startup 0.11.0 is released.

NEW FEATURES:

 * Added is_debug_on() which returns TRUE if the startup debug mode is on.
   To control the debug mode, see ?startup::startup.

 * startup(debug = TRUE) reports on several R_* environment variables.
   
 * restart() gained argument 'quiet' for controlling whether the restart
   should be quiet or not.

 * Added flag 'microsoftr' to sysinfo() indicating whether R runs in
   Microsoft R Open or not.

 * Added flag 'pqr' to sysinfo() indicating whether running pqR ("A Pretty
   Quick Version of R"), or not.

 * Added flag 'rstudioterm' to sysinfo() indicating whether R runs in an
   RStudio Terminal or not.  To test whether R runs via the RStudio Console,
   use the 'rstudio' flag.

 * Added flag 'rtichoke' to sysinfo() indicating whether R runs in rtichoke
   (previously known as Rice) or not.  Please stop using the 'rice' flag and
   start using the 'rtichoke' instead (both have identical values).

 * The 'ess' flag of sysinfo() is now based on whether "ESSR" in search() or
   not - used to check for environment variable 'EMACS' equaling "t" or not.

 * Now startup::restart() also work when running R via 'rtichoke'.

BUG FIXES:

 * startup::restart() would not work in the RStudio Terminal.  Note that it
   does not work in the RStudio Console due to limitations in RStudio.

 * On Windows, startup::startup() would produce a false warning on non-existing
   'R_LIBS_USER' folders.


Version: 0.9.0 [2018-01-09]

NEW FEATURES:

 * Added restart() for restarting the current R session.  It can also be used
   to adjust various R command-line arguments and environment variables, e.g.
   restart(as = "R CMD build") mimics the 'R CMD build' setup as far as
   possible.


Version: 0.8.0 [2017-10-18]

NEW FEATURES:

 * Added startup::current_script() which returns the .Rprofile.d/ pathname
   that is currently processed by startup::startup().
   
 * Added flag 'rice' to sysinfo() indicating whether R runs via Rice or not,
   meaning it can be used as a file and directory name tag, e.g. rice=TRUE.
 
 * startup(debug = TRUE) outputs much more information on what has taken place
   and what will take place through R's startup process.

 * startup() gained argument 'check' for controlling whether the content of
   startup files should be validated or not.

 * check(), and therefore also startup(check = TRUE), warns if R_LIBS,
   R_LIBS_SITE, or R_LIBS_USER specifies non-existing directory.
   
DEPRECATED AND DEFUNCT:

 * renviron() and rprofile() are now defunct.  Removed api()$renviron()
   and api()$rprofile().  Use renviron_d() and rprofile_d() instead.

BUG FIXES:

 * Now install(backup = TRUE) guarantees that the .Rprofile file is backed up,
   otherwise, an error is produced.  Previously it could silently fail if a
   backup file with the exact same name already existed.


Version: 0.7.0 [2017-09-04]

SIGNIFICANT CHANGES:

 * Package requires R (>= 2.14.0; Oct 2011) - was R (>= 2.13.0; Apr 2011).

NEW FEATURES:

 * Convenient session details are now gathered and recorded as R options
   immediately after processing '.Renviron.d' files.  These options, prefixed
   'startup.session.', are available while processing '.Rprofile.d' files and,
   by default, also after startup::startup() has completed.  For information
   on session details recorded, see help("startup_session_options").

 * Added a package vignette (available only in R >= 3.0.2).
 
 
Version: 0.6.1 [2017-05-16]

BUG FIXES:

 * startup() ignores more of the hidden files and folders that macOS may create
   and which should not be sourced during startup.  For instance, when copying
   a file 'foo.R' to a non-macOS file system, an auxiliary file '._foo.R' may
   be created as well.
 

Version: 0.6.0 [2017-04-30]

SIGNIFICANT CHANGES:

 * Package requires R (>= 2.13.0; Apr 2011) - was R (>= 2.12.0; Oct 2010).

NEW FEATURES:

 * New conditional <key>=<value> specification: an unknown '<key>' (i.e. one
   that is not one of the known sysinfo() fields or 'package') will be
   interpreted as the name of an environment variable.  For instance, files
   path/LANGUAGE=en/*.R will be included only if system environment variable
   LANGUAGE equals 'en' (or is not set).

 * startup::install() now injects 'try(startup::startup())' such that 
   install.packages("startup") will work even when 'startup' is not installed,
   e.g. after a major-version R update.

 * startup::install() and startup::uninstall() now output messages on what is
   done and why, and they now return the R startup file modified. They also
   produce a warning if startup is already installed or uninstalled,
   respectively.

 * startup::install() gained argument 'overwrite' to control whether to append
   (default) to a pre-existing R startup file or to overwrite it.

 * ROBUSTNESS: Backups now assert that not only the backup files are created,
   but also that they have the same file size as the original file.


Version: 0.5.0 [2017-02-12]

NEW FEATURES:

 * Startup directory or file names that start with two or more periods are now
   excluded, e.g. ~/.Rprofile.d/..hide/test.R.

 * startup() protects against attempts to update R packages also via
   pacman::p_up() in addition to utils::update.packages().

 * Added flag 'ess' to sysinfo() indicating whether R runs under Emacs Speaks
   Statistics (ESS) or not.

 * startup(debug = TRUE) detects if R_TESTS is set and reports which the file
   is and that the base package has already processed it.

BUG FIXES:

 * Now startup() ignores macOS files named .DS_Store and directories named
   __MACOSX (and their content).  Previously, such files could result
   in startup errors.
 

Version: 0.4.0 [2016-12-20]

NEW FEATURES:

 * Now it is possible to do negated filename specifications, e.g.
   hpc,package=future/os!=windows.
   
 * Filename flags can now be specified a TRUE, FALSE, T, F, 1, and 0 (non-case
   sensitive), e.g. interactive=false and interactive=0.
   
 * Added element 'gui' to sysinfo().
 
 * Added flags 'rstudio' and 'wine' to sysinfo() indicating whether R runs via
   RStudio and via Linux Wine, respectively.
   
 * New conditional <key>=<value> specification: Directory and file names
   containing a package=<name> specification will be processed if and only if
   package <name> is installed.
   
 * Errors occurring while sourcing an Rprofile file now also contain
   information about in file the error occurred.  Lines with invalid syntax in
   Renviron files are ignored with a message outputted saying so.  Due to
   limitations in how base::readRenviron() works, it is not possible to detect
   these errors nor capture the outputted message.
  
 * Now objects are auto printed to match the behavior of the R startup process.
  
 * startup(debug = TRUE) now outputs time stamps since start per entry.

DEPRECATED AND DEFUNCT:

 * renviron() and rprofile() were renamed to renviron_d() and rprofile_d(),
   respectively.

BUG FIXES:

 * A file extension *.R would incorrectly become part of the <value> in a
   trailing <key>=<value> specification.
  
 * Now R_STARTUP_DEBUG=TRUE also works for Rscript; used to work only for the
   R executable.

 * Some macOS backup files would not be filtered out when running on Windows.
 

Version: 0.3.0 [2016-11-21]

 * No updates.  First submission to CRAN.


Version: 0.2.0 [2016-11-20]

NEW FEATURES:

 * Add arguments sibling = FALSE to startup().  If sibling = TRUE, the
   corresponding startup file needs to exist in the same location as the
   directory in order for the directory to be processed.


Version: 0.1.0 [2016-11-15]

 * Package created. Adopted from a specialized .Rprofile script.
