Next: , Previous: , Up: X Server   [Contents][Index]


59.2.1 Resources

Function: default-x-device

This function return the default X device for resourcing. This is the first-created X device that still exists.

Function: x-get-resource name class type &optional locale device noerror

This function retrieves a resource value from the X resource manager.

The resource names passed to this function are looked up relative to the locale.

If you want to search for a subresource, you just need to specify the resource levels in name and class. For example, name could be ‘"modeline.attributeFont"’, and class"Face.AttributeFont"’.

Specifically,

  1. If locale is a buffer, a call
        (x-get-resource "foreground" "Foreground" 'string some-buffer)
    

    is an interface to a C call something like

        XrmGetResource (db, "sxemacs.buffer.buffer-name.foreground",
                            "Emacs.EmacsLocaleType.EmacsBuffer.Foreground",
                            "String");
    
  2. If locale is a frame, a call
        (x-get-resource "foreground" "Foreground" 'string some-frame)
    

    is an interface to a C call something like

        XrmGetResource (db, "sxemacs.frame.frame-name.foreground",
                            "Emacs.EmacsLocaleType.EmacsFrame.Foreground",
                            "String");
    
  3. If locale is a device, a call
        (x-get-resource "foreground" "Foreground" 'string some-device)
    

    is an interface to a C call something like

        XrmGetResource (db, "sxemacs.device.device-name.foreground",
                            "Emacs.EmacsLocaleType.EmacsDevice.Foreground",
                            "String");
    
  4. If locale is the symbol global, a call
        (x-get-resource "foreground" "Foreground" 'string 'global)
    

    is an interface to a C call something like

        XrmGetResource (db, "sxemacs.foreground",
                            "Emacs.Foreground",
                            "String");
    

Note that for global, no prefix is added other than that of the application itself; thus, you can use this locale to retrieve arbitrary application resources, if you really want to.

The returned value of this function is nil if the queried resource is not found. If type is string, a string is returned, and if it is integer, an integer is returned. If type is boolean, then the returned value is the list (t) for true, (nil) for false, and is nil to mean “unspecified”.

Function: x-put-resource resource-line &optional device

This function adds a resource to the resource database for device. resource-line specifies the resource to add and should be a standard resource specification.

Variable: x-emacs-application-class

This variable holds The X application class of the SXEmacs process. This controls, among other things, the name of the “app-defaults” file that SXEmacs will use. For changes to this variable to take effect, they must be made before the connection to the X server is initialized, that is, this variable may only be changed before SXEmacs is dumped, or by setting it in the file lisp/term/x-win.el.

By default, this variable is nil at startup. When the connection to the X server is first initialized, the X resource database will be consulted and the value will be set according to whether any resources are found for the application class “SXEmacs”.


Next: , Previous: , Up: X Server   [Contents][Index]