Next: , Previous: , Up: Starting Up   [Contents][Index]


58.1.3 Terminal-Specific Initialization

Each terminal type can have its own Lisp library that SXEmacs loads when run on that type of terminal. For a terminal type named termtype, the library is called term/termtype. SXEmacs finds the file by searching the load-path directories as it does for other files, and trying the ‘.elc’ and ‘.el’ suffixes. Normally, terminal-specific Lisp library is located in sxemacs/lisp/term, a subdirectory of the sxemacs/lisp directory in which most SXEmacs Lisp libraries are kept.

The library’s name is constructed by concatenating the value of the variable term-file-prefix and the terminal type. Normally, term-file-prefix has the value "term/"; changing this is not recommended.

The usual function of a terminal-specific library is to enable special keys to send sequences that SXEmacs can recognize. It may also need to set or add to function-key-map if the Termcap entry does not specify all the terminal’s function keys. See Terminal Input.

When the name of the terminal type contains a hyphen, only the part of the name before the first hyphen is significant in choosing the library name. Thus, terminal types ‘aaa-48’ and ‘aaa-30-rv’ both use the term/aaa library. If necessary, the library can evaluate (getenv "TERM") to find the full name of the terminal type.

Your init.el file can prevent the loading of the terminal-specific library by setting the variable term-file-prefix to nil. This feature is useful when experimenting with your own peculiar customizations.

You can also arrange to override some of the actions of the terminal-specific library by setting the variable term-setup-hook. This is a normal hook which SXEmacs runs using run-hooks at the end of SXEmacs initialization, after loading both your init.el file and any terminal-specific libraries. You can use this variable to define initializations for terminals that do not have their own libraries. See Hooks.

Variable: term-file-prefix

If the term-file-prefix variable is non-nil, SXEmacs loads a terminal-specific initialization file as follows:

(load (concat term-file-prefix (getenv "TERM")))

You may set the term-file-prefix variable to nil in your init.el file if you do not wish to load the terminal-initialization file. To do this, put the following in your init.el file: (setq term-file-prefix nil).

Variable: term-setup-hook

This variable is a normal hook that SXEmacs runs after loading your init.el file, the default initialization file (if any) and the terminal-specific Lisp file.

You can use term-setup-hook to override the definitions made by a terminal-specific file.

Variable: window-setup-hook

This variable is a normal hook which SXEmacs runs after loading your init.el file and the default initialization file (if any), after loading terminal-specific Lisp code, and after running the hook term-setup-hook.


Next: , Previous: , Up: Starting Up   [Contents][Index]