comparison lisp/term/README @ 5430:6e27daf7cbc9

Use GNU version which is GPLv3 or later.
author Mats Lidell <matsl@xemacs.org>
date Sun, 07 Nov 2010 00:13:17 +0100
parents 376386a54a3c
children
comparison
equal deleted inserted replaced
5429:4d771ba66557 5430:6e27daf7cbc9
1 Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
2 Free Software Foundation, Inc.
3 See the end of the file for license conditions.
4
5
1 This directory contains files of elisp that customize Emacs for certain 6 This directory contains files of elisp that customize Emacs for certain
2 terminal types. 7 terminal types.
3 8
4 When Emacs starts, it checks the TERM environment variable to see what type 9 When Emacs opens a new terminal, it checks the TERM environment variable to
5 of terminal the user is running on, checks for an elisp file named 10 see what type of terminal the user is running on, searches for an elisp file
6 "term/${TERM}.el", and if one exists, loads it. If that doesn't yield a file 11 named "term/${TERM}.el", and if one exists, loads it. If Emacs finds no
7 that exists, the last hyphen and what follows it is stripped. If that doesn't 12 suitable file, then it strips the last hyphen and what follows it from TERM,
8 yield a file that exists, the previous hyphen is stripped, and so on until all 13 and tries again. If that still doesn't yield a file, then the previous hyphen
9 hyphens are gone. For example, if the terminal type is `aaa-48-foo', Emacs 14 is stripped, and so on until all hyphens are gone. For example, if the
10 will try first `term/aaa-48-foo.el', then `term/aaa-48.el' and finally 15 terminal type is `aaa-48-foo', Emacs will try first `term/aaa-48-foo.el', then
11 `term/aaa.el'. 16 `term/aaa-48.el' and finally `term/aaa.el'. Emacs stops searching at the
17 first file found, and will not load more than one file for any terminal. Note
18 that it is not an error if Emacs is unable to find a terminal initialization
19 file; in that case, it will simply proceed with the next step without loading
20 any files.
21
22 Once the file has been loaded (or the search failed), Emacs tries to call a
23 function named `terminal-init-TERMINALNAME' (eg `terminal-init-aaa-48' for the
24 `aaa-48' terminal) in order to initialize the terminal. Once again, if the
25 function is not found, Emacs strips the last component of the name and tries
26 again using the shorter name. This search is independent of the previous file
27 search, so that you can have terminal initialization functions for a family of
28 terminals collected in a single file named after the family name, and users
29 may put terminal initialization functions directly in their .emacs files.
30
31 Note that an individual terminal file is loaded only once in an Emacs
32 session; if the same terminal type is opened again, Emacs will simply call the
33 initialization function without reloading the file. Therefore, all the actual
34 initialization actions should be collected in terminal-init-* functions; the
35 file should not contain any top-level form that is not a function or variable
36 declaration. Simply loading the file should not have any side effect.
37
38 Similarly, the terminal initialization function is called only once on any
39 given terminal, when the first frame is created on it. The function is not
40 called for subsequent frames on the same terminal. Therefore, terminal-init-*
41 functions should only modify terminal-local variables (such as
42 `local-function-key-map') and terminal parameters. For example, it is not
43 correct to modify frame parameters, since the modifications will only be
44 applied for the first frame opened on the terminal.
45
12 46
13 When writing terminal packages, there are some things it is good to keep in 47 When writing terminal packages, there are some things it is good to keep in
14 mind. 48 mind.
15 49
16 First, about keycap names. Your terminal package can create any keycap 50 First, about keycap names. Your terminal package can create any keycap
34 that set, try to pattern them on the standard terminfo variable names for 68 that set, try to pattern them on the standard terminfo variable names for
35 clarity; also, for a fighting chance that your binding may be useful to someone 69 clarity; also, for a fighting chance that your binding may be useful to someone
36 else someday. 70 else someday.
37 71
38 For example, if your terminal has a `find' key, observe that terminfo 72 For example, if your terminal has a `find' key, observe that terminfo
39 supports a key_find capability and call your cookie [key-find]. 73 supports a key_find capability and call your cookie [find].
40 74
41 Here is a complete list, with corresponding X keysyms. 75 Here is a complete list, with corresponding X keysyms.
42 76
43 ----------------------------------------------------------------------------- 77 -----------------------------------------------------------------------------
44 Variable name cap X Keysym Description 78 Variable name cap X Keysym Description
210 (enable-foo-arrow-keys), where `foo' becomes the terminal name, and leave 244 (enable-foo-arrow-keys), where `foo' becomes the terminal name, and leave
211 it up to the user's .emacs file whether to call it. 245 it up to the user's .emacs file whether to call it.
212 246
213 Before writing a terminal-support package, it's a good idea to read the 247 Before writing a terminal-support package, it's a good idea to read the
214 existing ones and learn the common conventions. 248 existing ones and learn the common conventions.
249
250
251 This file is part of GNU Emacs.
252
253 GNU Emacs is free software: you can redistribute it and/or modify
254 it under the terms of the GNU General Public License as published by
255 the Free Software Foundation, either version 3 of the License, or
256 (at your option) any later version.
257
258 GNU Emacs is distributed in the hope that it will be useful,
259 but WITHOUT ANY WARRANTY; without even the implied warranty of
260 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
261 GNU General Public License for more details.
262
263 You should have received a copy of the GNU General Public License
264 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.