# $search-path(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$search-path - MicroEmacs search path

## SYNOPSIS

$search-path string

[Microsoft Windows/MS-DOS]
$search-path <path1>;<path2>;....;<pathn>

[UNIX]
$search-path <path1>:<path2>:....:<pathn>

## DESCRIPTION

$search-path is automatically determined by MicroEmacs when it initializes. The variable identifies the directory paths which are searched to locate editor specific files. The variable may contain multiple search paths each separated by the platform path separator (semi-colon (';') on Microsoft Windows or MS-DOS environments and a colon (':') on UNIX environments). Where multiple search paths are defined then they are searched in a left to right order.

$search-path is determined at run-time and is fixed once the editor starts. The value of the search path is determined from a number of different sources in a platform specific manner as follows:-

- Built in pathnames - On UNIX platforms then preset search paths are built into the executable i.e. `/opt/jasspa`, `/usr/local/jasspa` etc.
- The users home directory, taken from the `/etc/passwd` under UNIX and from the shell environment under Microsoft Windows.
- The location of the executable, typically only used under Microsoft Windows and MS-DOS environments where the concept of standard installation locations is vague.
- The environment variable $MEUSERPATH(5) which identifies the preferred user directory location, overriding any home directory location specified by the system.
- The environment variable $MEINSTALLPATH(5) which identifies the installation directory of the standard macros overriding any built in search path(s).
- The environment variable $MEPATH(5) which absolutely overrides any search paths with a user defined path where $MEUSERPATH(5) is not defined.
- The command line option -u user-name to me(1) which overrides the user name found by the system.
- The environment variable $MENAME(5) which overrides the user name found by the system.

The search paths are generally ordered from highest priority to lowest priority and typically arranged in the order:-

$search-path=<user>:<company>:<me>

where <user> represents the users path(s); <company> is the company file path(s) (e.g. company wide template files) and <me> path(s) which contain the standard MicroEmacs 2009 files.

This would correspond to a typical directory installation, of user foo on UNIX such as:

`/usr/foo/.jassa` - User files.
`/usr/local/jasspa/company` - Company wide files
`/usr/local/jasspa/macros` - MicroEmacs installation directory

## USAGE

The current working directory is always checked first for the location of any file.

$search-path is used to locate all macro files, and other files located with operators such as &find(4).

Users should not modify this variable directly, the external aforementioned environment variables should be used to affect any desired changes.

## NOTES

The search path operation was revised in the MicroEmacs 2004 release and operates differently from earlier releases.

## SEE ALSO

me(1), execute-file(2), &find(4). $home(5), $progname(5), $user-name(5), $user-path(5), $MEINSTALLPATH(5), $MENAME(5), $MEPATH(5), $MEUSERPATH(5), Variable Functions.

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>