Mercurial > emacs
comparison lisp/term/README @ 83524:673d62ad74b5
Fix and/or simplify terminal initialization files.
* lisp/faces.el (tty-create-frame-with-faces): Set up faces and
background mode only after the terminal has been initialized.
(frame-set-background-mode): Handle the 'background-mode terminal
parameter.
(tty-run-terminal-initialization): Add type option.
* lisp/term/README: Update.
* lisp/term/rxvt.el: Simplify.
* lisp/term/xterm.el: Simplify and fix.
* lisp/term/*.el: Simplify and fix.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-564
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 20 May 2006 17:02:47 +0000 |
parents | af1c58687bdd |
children | 07774e5c3ff5 |
comparison
equal
deleted
inserted
replaced
83523:6ce7108f7eef | 83524:673d62ad74b5 |
---|---|
1 This directory contains files of elisp that customize Emacs for certain | 1 This directory contains files of elisp that customize Emacs for certain |
2 terminal types. | 2 terminal types. |
3 | 3 |
4 When Emacs starts, it checks the TERM environment variable to see what type | 4 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 | 5 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 | 6 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 | 7 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 | 8 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 | 9 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 | 10 terminal type is `aaa-48-foo', Emacs will try first `term/aaa-48-foo.el', then |
11 `term/aaa.el'. Each terminal specific file should contain a function | 11 `term/aaa-48.el' and finally `term/aaa.el'. Emacs stops searching at the |
12 named terminal-init-TERMINALNAME (eg terminal-init-aaa-48 for | 12 first file found, and will not load more than one file for any terminal. Note |
13 term/aaa-48.el) that Emacs will call in order to initialize the | 13 that it is not an error if Emacs is unable to find a terminal initialization |
14 terminal. The terminal files should not contain any top level forms | 14 file; in that case, it will simply proceed with the next step without loading |
15 that are executed when the file is loaded, all the initialization | 15 any files. |
16 actions are performed by the terminal-init-TERMINALNAME functions. | 16 |
17 Once the file has been loaded (or the search failed), Emacs tries to call a | |
18 function named `terminal-init-TERMINALNAME' (eg `terminal-init-aaa-48' for the | |
19 `aaa-48' terminal) in order to initialize the terminal. Once again, if the | |
20 function is not found, Emacs strips the last component of the name and tries | |
21 again using the shorter name. This search is independent of the previous file | |
22 search, so that you can have terminal initialization functions for a family of | |
23 terminals collected in a single file named after the family name, and users | |
24 may put terminal initialization functions directly in their .emacs files. | |
25 | |
26 Note that an individual terminal file is loaded only once in an Emacs | |
27 session; if the same terminal type is opened again, Emacs will simply call the | |
28 initialization function without reloading the file. Therefore, all the actual | |
29 initialization actions should be collected in terminal-init-* functions; the | |
30 file should not contain any top-level form that is not a function or variable | |
31 declaration. Simply loading the file should not have any side effect. | |
32 | |
33 Similarly, the terminal initialization function is called only once on any | |
34 given terminal, when the first frame is created on it. The function is not | |
35 called for subsequent frames on the same terminal. Therefore, terminal-init-* | |
36 functions should only modify terminal-local variables (such as | |
37 `local-function-key-map') and terminal parameters. For example, it is not | |
38 correct to modify frame parameters, since the modifications will only be | |
39 applied for the first frame opened on the terminal. | |
40 | |
17 | 41 |
18 When writing terminal packages, there are some things it is good to keep in | 42 When writing terminal packages, there are some things it is good to keep in |
19 mind. | 43 mind. |
20 | 44 |
21 First, about keycap names. Your terminal package can create any keycap | 45 First, about keycap names. Your terminal package can create any keycap |