Go to the previous, next section.

X Connections

You can close the connection with the X server with the function x-close-current-connection, and open a new one with x-open-connection (perhaps with a different server and display).

Function: x-close-current-connection

This function closes the connection to the X server. It deletes all frames, making Emacs effectively inaccessible to the user; therefore, a Lisp program that closes the connection should open another one.

Function: x-open-connection display &optional resource-string

This function opens a connection to an X server, for use of display display.

The optional argument resource-string is a string of resource names and values, in the same format used in the `.Xresources' file. The values you specify override the resource values recorded in the X server itself. Here's an example of what this string might look like:

"*BorderWidth: 3\n*InternalBorder: 2\n"

Function: x-color-display-p

This returns t if the connected X display has color, and nil otherwise.

Function: x-color-defined-p color

This function reports whether a color name is meaningful and supported on the X display Emacs is using. It returns t if the display supports that color; otherwise, nil.

Black-and-white displays support just two colors, "black" or "white". Color displays support many other colors.

Function: x-synchronize flag

The function x-synchronize enables or disables synchronous communication with the X server. It enables synchronous communication if flag is non-nil, and disables it if flag is nil.

In synchronous mode, Emacs waits for a response to each X protocol command before doing anything else. This is useful for debugging Emacs, because protocol errors are reported right away, which helps you find the erroneous command. Synchronous mode is not the default because it is much slower.

Go to the previous, next section.