Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Next: , Previous: Init Examples, Up: Init File


57.6.3 Terminal-specific Initialization

Each terminal type can have a Lisp library to be loaded into Emacs when it is run on that type of terminal. For a terminal type named termtype, the library is called term/termtype and it is found by searching the directories load-path as usual and trying the suffixes ‘.elc’ and ‘.el’. Normally it appears in the subdirectory term of the directory where most Emacs libraries are kept.

The usual purpose of the terminal-specific library is to map the escape sequences used by the terminal's function keys onto more meaningful names, using function-key-map. See the file term/lk201.el for an example of how this is done. Many function keys are mapped automatically according to the information in the Termcap data base; the terminal-specific library needs to map only the function keys that Termcap does not specify.

When 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 library term/aaa. The code in the library can use (getenv "TERM") to find the full terminal type name.

The library's name is constructed by concatenating the value of the variable term-file-prefix and the terminal type. Your .emacs file can prevent the loading of the terminal-specific library by setting term-file-prefix to nil.

Emacs runs the hook term-setup-hook at the end of initialization, after both your .emacs file and any terminal-specific library have been read in. Add hook functions to this hook if you wish to override part of any of the terminal-specific libraries and to define initializations for terminals that do not have a library. See Hooks.


 
 
  Published under the terms of the GNU General Public License Design by Interspire