# $system(5)

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

## NAME

$system - System configuration variable

## SYNOPSIS

$system bitmask; Default is system dependent

## DESCRIPTION

The $system is used to define and configure the MicroEmacs environment, it is a bit based flag where:-

0x001

This bit is set if MicroEmacs is running in Console mode. On UNIX systems the default is to use X whenever possible, in which case this bit will be clear. If X is not used then a TERMCAP base interface is used instead and this bit will be set (see notes below on how to set which interface to use). On all other systems this bit will be clear.

0x002

If this bit is set then the current system supports definable RGB colors allowing any color to be created and used in a color scheme. This bit cannot be set, typically Windows and UNIX X-Windows systems support this.

0x004

If this bit is set then the current system supports ANSI colors (8 colors, black, red, green, yellow, blue, magenta, cyan & white), bits 0x002 and 0x004 are mutually exclusive. On UNIX systems if the TERMCAP interface is being used then this bit can be changed to (de)select the used of color. Many unix terminals do not support color so this should be set appropriately. On all other systems this bit cannot be changed and MS-DOS is currently the only other system to use ANSI colors.

0x008

If this bit is set then the current system supports Extended ANSI colors, brighter versions of the 8 ANSI colors doubling the number of colors available to 16. On UNIX systems if the TERMCAP interface is being used then this bit can be changed to (de)select the used of bold with color to create this extended color set for foreground colors. But many UNIX terminals do not support this use of color with the bold font so this should be set appropriately. On all other systems this bit cannot be changed and MS-DOS is currently the only other system to support this.

0x010

If this bit is set then the current system supports the use of fonts (bold, italic, light and underline). Whether these fonts can be successfully utilized depends upon the platform and the system font being used, for UNIX TERMCAP systems it will also depend on the terminal being used. This option is not supported on MS_DOS.

0x020

When this bit is set the cursor is always shown in OSD (main menu) dialogs, this helps to improve navigation of dialogs ion systems with limited colors.

0x080

This bit is set if the current system is a UNIX based system such as LINUX or HPUX. This bit cannot be altered, its use is within macros.

0x100

This bit is set if the current system is a Microsoft based system such as DOS or Windows '95. This bit cannot be altered, its use is within macros.

0x200

If this bit is set then the current system uses the concept of drives (i.e. `c:/` on DOS systems). This bit cannot be altered, its use is within macros.

0x400

If this bit is set then a DOS style `8.3` file naming system should be used (i.e. "`BBBBBBBB.XXX`"), otherwise an unlimited file name length is used. This effects the backup and auto-save file names generated by MicroEmacs, the bit can be altered on systems that support unlimited file name length.

0x800

If this bit is set then the current system supports and uses ipipe-shell-command(2) when required. For systems such as DOS which cannot support ipipes, this bit will be clear and cannot be altered. For systems which do support ipipes, this bit can be cleared to disable their use.

0x1000

If this bit set, the then execution of the tab(2) command (bound to `tab`) always checks and adjusts the indentation of the current line when the current buffer has an indentation method. If the bit is clear then the `tab` may only checks the indentation when the cursor is in column zero depending on the setting of bit 0x200000.

0x2000

If this bit is set the main menu Alt hot-key bindings are enabled. These are dynamic bindings automatically generated from the main menu. Typically the first item in the main menu is "`File`" with a hot key of 'F', with this bit set '`A-f`' will open this menu item. Note that global and local key bindings override these. Also see bit 0x4000.

0x4000

If this bit is set the Alt key acts as a prefix 1 modifier key. By default '`A-n`' is not bound, with this bit set the key is inferred to '`esc n`' which is bound to forward-paragraph. Note that global, local and menu hot-key bindings override these. Also see bit 0x2000.

0x8000

If this bit is set the undo history is kept after a save allowing the undo(2) command to back-up changes beyond the last save. When clear the undo history is discarded after the buffer is saved.

0x10000

Enable box character rendering fix, supported on Win32 and XTerm interfaces only. Windows ANSI fonts and many XTerm ISO-8859-1 fonts do not have well formed box characters which are used by osd(2) and other commands to create a better looking interface. When this bit is enabled MicroEmacs traps the printing of characters with an ASCII value of less than 32 and renders them directly. Following is a table of supported characters, other characters in the range of `0x00` to `0x1f` not listed are rendered as a space:

`0x08`

Special Character; Backspace

`0x09`

Special Character; Tab

`0x0b`

Box Character; Bottom right

`0x0c`

Box Character; Top right

`0x0d`

Box Character; Top left

`0x0e`

Box Character; Bottom left

`0x0f`

Box Character; Center cross

`0x10`

Arrows; Right

`0x11`

Arrows; Left

`0x12`

Box Character; Horizontal line

`0x15`

Box Character; Left Tee

`0x16`

Box Character; Right Tee

`0x17`

Box Character; Bottom Tee

`0x18`

Box Character; Top Tee

`0x19`

Box Character; Vertical Line

`0x1e`

Arrows; Up

`0x1f`

Arrows; Down

0x20000

Enables the client server, default is disabled (UNIX and Win32 NT or Win95+ platforms only). When enabled a hidden "`*server*`" buffer is created which monitors commands written to the server, the socket "`/tmp/mesrv` uid" on UNIX systems and the command input file "$TEMP`/me`$MENAME`.cmd`" on Win32 systems. Commands can be written out using the command ipipe-write(2) while in the "*server*" buffer, the command is written to the same socket on UNIX systems and to the response file and response file "$TEMP`/me`$MENAME`.rsp`" on Win32 systems. This functionality is used by the -m and -o command-line options and by the MicroSoft DevStudio interface.

0x40000

Enables the capture of the Alt space key ("`A-space`"), default is enabled (Win32 platform only). In the Windows environment the Alt Space key is used to activate the main window's pull down menu at the top left. if this bit is set MicroEmacs captures this key and executes it as normal, thereby disabling this standard windows binding.

0x80000

Enables the drawing of visible white spaces, i.e. space, tab and new-line characters. When disabled (default) white spaces are drawn using spaces ('`` ') which means the user cannot distinguish between a tab and spaces or determine the last character of the line by merely looking at the display. When enabled MicroEmacs uses visible characters to draw the white spaces, the characters used are set with the variable $window-chars(5).

0x100000

Enables hiding MicroEmacs generated backup files. On Windows and Dos platforms the Hidden file attribute is used to hide the file, whereas on UNIX the backup file name is prepended with a '`.`'.

0x200000

If this bit set, the then execution of the tab(2) command (bound to `tab`) checks and adjusts the indentation of the current line when the cursor is in column zero and current buffer has an indentation method. The setting of this bit has no effect if bit 0x1000 is set. If this and bit 0x1000 are clear then the `tab` will not check the indentation.

0x400000

When this bit is set the external clipboard (Windows & XTerm platforms) will never be set to empty, if the current yank buffer is the empty string the cut buffer will be set to a space (i.e. " "). This feature has been added to avoid problems with other software (e.g. exceed(1) which can crash if given an empty cut buffer).

0x800000

When this bit is set all use of the external clipboard (Windows & XTerm platforms) is disabled, this means that MicroEmacs will not attempt to retrieve or set the content of the system clipboard.

0x1000000

When this bit is set the `-p` or `-P` option was used on the command line (see me(1)). This bit can be used by macros to determine how to function, see filetype(3f) for an example of its use.

## EXAMPLE

The follow example works out the current buffer's backup file name using $system to determine the naming system being used by MicroEmacs:-

    set-variable #l0 &stat "a" $buffer-fname
    ; Is an 8.3 dos style naming system being used?
    !if &band $system 0x400
        !if &not &set #l1 &sin "." #l0
            set-variable #l1 &cat #l0 ".~~~"
        !elif &gre &set #l1 &sub &len #l0 #l1 2
            set-variable #l1 &cat &lef #l0 &sub &len #l0 1 "~"
        !else
            set-variable #l1 &spr "%s%n" #l0 &sub 3 #l1 "~"
        !endif
    !elif $kept-versions
        set-variable #l1 &cat #l0 ".~0~"
    !else
        set-variable #l1 &cat #l0 "~"
    !endif

The following macro can be used to toggle the visible drawing of white spaces:

    define-macro toggle-visible-white-spaces
        set-variable $system &bxor $system 0x80000
        screen-update
    !emacro

## NOTES

Most of the $system functionality can be set using the $user-setup(3) dialog.

## UNIX X verses Termcap

By default, on X supporting systems MicroEmacs creates a new X window. This feature may be disabled in one of two ways:

- The environment variable `$TERM` is set to "`vt...`", in this case it is assumed that the machine is a server, and the host cannot support X.
- The `-n` option is used on the command line (see me(1)) to disable the windowing interface.

If X is disabled then the termcap interface is used instead, still allowing the use of colors through the ANSI standard, or the use of fonts (see bits 0x004 and 0x008).

X provides the following features over and above a termcap based version of MicroEmacs 2009:

- R,G,B style color creator giving access to up to 256 different colors for the ultimate hilighting schemes (see bit 0x002 and add-color(2)).
- Full mouse support, allowing user definable bindings to every mouse event (see global-bind-key(2)).
- Copy from and pasting to X's selection buffer (see yank(2)).

## SEE ALSO

user-setup(3), $mouse(5), $platform(5), add-color(2), add-color-scheme(2), ipipe-shell-command(2), $global-scheme(5).

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

</HMTL>