| 280 | | When the name of the terminal type contains a hyphen, only the part of |
|---|
| 281 | | the name before the first hyphen is significant in choosing the library |
|---|
| 282 | | name. Thus, terminal types @samp{aaa-48} and @samp{aaa-30-rv} both use |
|---|
| 283 | | the @file{term/aaa} library. If necessary, the library can evaluate |
|---|
| 284 | | @code{(getenv "TERM")} to find the full name of the terminal |
|---|
| 285 | | type.@refill |
|---|
| | 275 | The usual function of a terminal-specific library is to enable |
|---|
| | 276 | special keys to send sequences that Emacs can recognize. It may also |
|---|
| | 277 | need to set or add to @code{function-key-map} if the Termcap or |
|---|
| | 278 | Terminfo entry does not specify all the terminal's function keys. |
|---|
| | 279 | @xref{Terminal Input}. |
|---|
| | 280 | |
|---|
| | 281 | When the name of the terminal type contains a hyphen, and no library |
|---|
| | 282 | is found whose name is identical to the terminal's name, Emacs strips |
|---|
| | 283 | from the terminal's name the last hyphen and everything that follows |
|---|
| | 284 | it, and tries again. This process is repeated until Emacs finds a |
|---|
| | 285 | matching library or until there are no more hyphens in the name (the |
|---|
| | 286 | latter means the terminal doesn't have any library specific to it). |
|---|
| | 287 | Thus, for example, if there are no @samp{aaa-48} and @samp{aaa-30} |
|---|
| | 288 | libraries, Emacs will try the same library @file{term/aaa.el} for |
|---|
| | 289 | terminal types @samp{aaa-48} and @samp{aaa-30-rv}. If necessary, the |
|---|
| | 290 | library can evaluate @code{(getenv "TERM")} to find the full name of |
|---|
| | 291 | the terminal type.@refill |
|---|