annotate man/term.texi @ 826:6728e641994e

[xemacs-hg @ 2002-05-05 11:30:15 by ben] syntax cache, 8-bit-format, lots of code cleanup README.packages: Update info about --package-path. i.c: Create an inheritable event and pass it on to XEmacs, so that ^C can be handled properly. Intercept ^C and signal the event. "Stop Build" in VC++ now works. bytecomp-runtime.el: Doc string changes. compat.el: Some attempts to redo this to make it truly useful and fix the "multiple versions interacting with each other" problem. Not yet done. Currently doesn't work. files.el: Use with-obsolete-variable to avoid warnings in new revert-buffer code. xemacs.mak: Split up CFLAGS into a version without flags specifying the C library. The problem seems to be that minitar depends on zlib, which depends specifically on libc.lib, not on any of the other C libraries. Unless you compile with libc.lib, you get errors -- specifically, no _errno in the other libraries, which must make it something other than an int. (#### But this doesn't seem to obtain in XEmacs, which also uses zlib, and can be linked with any of the C libraries. Maybe zlib is used differently and doesn't need errno, or maybe XEmacs provides an int errno; ... I don't understand. Makefile.in.in: Fix so that packages are around when testing. abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, callint.c, casefiddle.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.h, console-stream.c, console-x.c, console.c, console.h, data.c, device-msw.c, device.c, device.h, dialog-msw.c, dialog-x.c, dired-msw.c, dired.c, doc.c, doprnt.c, dumper.c, editfns.c, elhash.c, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, events.h, extents.c, extents.h, faces.c, file-coding.c, file-coding.h, fileio.c, fns.c, font-lock.c, frame-gtk.c, frame-msw.c, frame-x.c, frame.c, frame.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-msw.h, glyphs-x.c, glyphs.c, glyphs.h, gui-msw.c, gui-x.c, gui.h, gutter.h, hash.h, indent.c, insdel.c, intl-win32.c, intl.c, keymap.c, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-ccl.c, mule-charset.c, mule-coding.c, mule-wnnfns.c, nas.c, objects-msw.c, objects-x.c, opaque.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, process.h, profile.c, rangetab.c, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-x.c, redisplay.c, redisplay.h, regex.c, regex.h, scrollbar-msw.c, search.c, select-x.c, specifier.c, specifier.h, symbols.c, symsinit.h, syntax.c, syntax.h, syswindows.h, tests.c, text.c, text.h, tooltalk.c, ui-byhand.c, ui-gtk.c, unicode.c, win32.c, window.c: Another big Ben patch. -- FUNCTIONALITY CHANGES: add partial support for 8-bit-fixed, 16-bit-fixed, and 32-bit-fixed formats. not quite done yet. (in particular, needs functions to actually convert the buffer.) NOTE: lots of changes to regex.c here. also, many new *_fmt() inline funs that take an Internal_Format argument. redo syntax cache code. make the cache per-buffer; keep the cache valid across calls to functions that use it. also keep it valid across insertions/deletions and extent changes, as much as is possible. eliminate the junky regex-reentrancy code by passing in the relevant lisp info to the regex routines as local vars. add general mechanism in extents code for signalling extent changes. fix numerous problems with the case-table implementation; yoshiki never properly transferred many algorithms from old-style to new-style case tables. redo char tables to support a default argument, so that mapping only occurs over changed args. change many chartab functions to accept Lisp_Object instead of Lisp_Char_Table *. comment out the code in font-lock.c by default, because font-lock.el no longer uses it. we should consider eliminating it entirely. Don't output bell as ^G in console-stream when not a TTY. add -mswindows-termination-handle to interface with i.c, so we can properly kill a build. add more error-checking to buffer/string macros. add some additional buffer_or_string_() funs. -- INTERFACE CHANGES AFFECTING MORE CODE: switch the arguments of write_c_string and friends to be consistent with write_fmt_string, which must have printcharfun first. change BI_* macros to BYTE_* for increased clarity; similarly for bi_* local vars. change VOID_TO_LISP to be a one-argument function. eliminate no-longer-needed CVOID_TO_LISP. -- char/string macro changes: rename MAKE_CHAR() to make_emchar() for slightly less confusion with make_char(). (The former generates an Emchar, the latter a Lisp object. Conceivably we should rename make_char() -> wrap_char() and similarly for make_int(), make_float().) Similar changes for other *CHAR* macros -- we now consistently use names with `emchar' whenever we are working with Emchars. Any remaining name with just `char' always refers to a Lisp object. rename macros with XSTRING_* to string_* except for those that reference actual fields in the Lisp_String object, following conventions used elsewhere. rename set_string_{data,length} macros (the only ones to work with a Lisp_String_* instead of a Lisp_Object) to set_lispstringp_* to make the difference clear. try to be consistent about caps vs. lowercase in macro/inline-fun names for chars and such, which wasn't the case before. we now reserve caps either for XFOO_ macros that reference object fields (e.g. XSTRING_DATA) or for things that have non-function semantics, e.g. directly modifying an arg (BREAKUP_EMCHAR) or evaluating an arg (any arg) more than once. otherwise, use lowercase. here is a summary of most of the macros/inline funs changed by all of the above changes: BYTE_*_P -> byte_*_p XSTRING_BYTE -> string_byte set_string_data/length -> set_lispstringp_data/length XSTRING_CHAR_LENGTH -> string_char_length XSTRING_CHAR -> string_emchar INTBYTE_FIRST_BYTE_P -> intbyte_first_byte_p INTBYTE_LEADING_BYTE_P -> intbyte_leading_byte_p charptr_copy_char -> charptr_copy_emchar LEADING_BYTE_* -> leading_byte_* CHAR_* -> EMCHAR_* *_CHAR_* -> *_EMCHAR_* *_CHAR -> *_EMCHAR CHARSET_BY_ -> charset_by_* BYTE_SHIFT_JIS* -> byte_shift_jis* BYTE_BIG5* -> byte_big5* REP_BYTES_BY_FIRST_BYTE -> rep_bytes_by_first_byte char_to_unicode -> emchar_to_unicode valid_char_p -> valid_emchar_p Change intbyte_strcmp -> qxestrcmp_c (duplicated functionality). -- INTERFACE CHANGES AFFECTING LESS CODE: use DECLARE_INLINE_HEADER in various places. remove '#ifdef emacs' from XEmacs-only files. eliminate CHAR_TABLE_VALUE(), which duplicated the functionality of get_char_table(). add BUFFER_TEXT_LOOP to simplify iterations over buffer text. define typedefs for signed and unsigned types of fixed sizes (INT_32_BIT, UINT_32_BIT, etc.). create ALIGN_FOR_TYPE as a higher-level interface onto ALIGN_SIZE; fix code to use it. add charptr_emchar_len to return the text length of the character pointed to by a ptr; use it in place of charcount_to_bytecount(..., 1). add emchar_len to return the text length of a given character. add types Bytexpos and Charxpos to generalize Bytebpos/Bytecount and Charbpos/Charcount, in code (particularly, the extents code and redisplay code) that works with either kind of index. rename redisplay struct params with names such as `charbpos' to e.g. `charpos' when they are e.g. a Charxpos, not a Charbpos. eliminate xxDEFUN in place of DEFUN; no longer necessary with changes awhile back to doc.c. split up big ugly combined list of EXFUNs in lisp.h on a file-by-file basis, since other prototypes are similarly split. rewrite some "*_UNSAFE" macros as inline funs and eliminate the _UNSAFE suffix. move most string code from lisp.h to text.h; the string code and text.h code is now intertwined in such a fashion that they need to be in the same place and partially interleaved. (you can't create forward references for inline funs) automated/lisp-tests.el, automated/symbol-tests.el, automated/test-harness.el: Fix test harness to output FAIL messages to stderr when in batch mode. Fix up some problems in lisp-tests/symbol-tests that were causing spurious failures.
author ben
date Sun, 05 May 2002 11:33:57 +0000
parents 5596b330879a
children 0f9686ac3ce7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 @\input texinfo @c -*-texinfo-*-
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 @setfilename ../info/term.info
696
5596b330879a [xemacs-hg @ 2001-12-15 19:25:19 by adrian]
adrian
parents: 428
diff changeset
3 @settitle XEmacs Terminal Emulator Mode
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 @titlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 @sp 6
696
5596b330879a [xemacs-hg @ 2001-12-15 19:25:19 by adrian]
adrian
parents: 428
diff changeset
7 @center @titlefont(XEmacs Terminal Emulator Mode)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 @end titlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 @ifinfo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 @dircategory XEmacs Editor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 @direntry
696
5596b330879a [xemacs-hg @ 2001-12-15 19:25:19 by adrian]
adrian
parents: 428
diff changeset
13 * Term mode: (term). XEmacs Terminal Emulator Mode.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 @end direntry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 @node Top, , (DIR)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 @top Terminal emulator mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 @end ifinfo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 This is some notes about the term Emacs mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 * term mode::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 @node term mode
696
5596b330879a [xemacs-hg @ 2001-12-15 19:25:19 by adrian]
adrian
parents: 428
diff changeset
27 @chapter XEmacs Terminal Emulator Mode
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 * Overview::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 * Connecting to remote computers::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 * Paging::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 * Terminal escapes::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 The @code{term} package includes the major modes @code{term},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 @code{shell}, and @code{gud} (for running gbd or another debugger).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 It is a replacement for the comint mode of Emacs 19,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 as well as shell, gdb, terminal, and telnet modes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 The package works best with recent releases of Emacs 19,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 but will also work reasonably well with Emacs 18 as well as Lucid Emacs 19.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 The file @code{nshell.el} is a wrapper to use unless term mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 is built into Emacs. If works around some of the missing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 in older Emacs versions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 To use it, edit the paths in @code{nshell.el}, appropriately,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 and then @code{M-x load-file nshell.el RET}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 This will also load in replacement shell and gud modes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 @node Overview
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 @section Overview
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 The @code{term} mode is used to control a program (an "inferior process").
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 It sends most keyboard input characters to the program,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 and displays output from the program in the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 This is similar to the traditional comint mode, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 modes derived from it (such as shell and gdb modes).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 You can do with the new term-based shell the same sort
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 of things you could do with the old shell mode,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 using more or less the same interface. However, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 new mode is more flexible, and works somewhat differently.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 * Output from the inferior::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 * subbuffer:: The sub-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 * altsubbuffer:: The alternate sub-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 * Input to the inferior::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 @node Output from the inferior
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 @subsection Output from the inferior
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 In typical usage, output from the inferior is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 added to the end of the buffer. If needed, the window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 will be scrolled, just like a regular terminal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 (Only one line at a time will be scrolled, just like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 regular terminals, and in contrast to the old shell mode.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 Thus the buffer becomes a log of your interaction with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 inferior, just like the old shell mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 Like a real terminal, term maintains a "cursor position."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 This is the @code{process-mark} of the inferior process.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 If the process-mark is not at the end of the buffer, output from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 the inferior will overwrite existing text in the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 This is like a real terminal, but unlike the old shell mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 (which inserts the output, instead of overwriting).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 Some programs (such as Emacs itself) need to control the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 appearance on the screen in detail. They do this by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 sending special control codes. The exact control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 codes needed from terminal to terminal, but nowadays
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 most terminals and terminal emulators (including xterm)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 understand the so-called "ANSI escape sequences" (first
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 popularized by the Digital's VT100 family of terminal).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 The term mode also understands these escape sequences,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 and for each control code does the appropriate thing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 to change the buffer so that the appearance of the window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 will match what it would be on a real terminal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 (In contrast, the old shell mode doesn't handle
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 terminal control codes at all.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 See <...> for the specific control codes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 @node subbuffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 @subsection The sub-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 A program that talks to terminal expects the terminal to have a fixed size.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 If the program is talking a terminal emulator program such as @code{xterm},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 that size can be changed (if the xterm window is re-sized), but programs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 still assume a logical terminal that has a fixed size independent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 of the amount of output transmitted by the programs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 To programs that use it, the Emacs terminal emulator acts as if it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 too has a fixed size. The @dfn{sub-buffer} is the part of a @code{term}-mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 buffer that corresponds to a "normal" terminal. Most of the time
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 (unless you explicitly scroll the window displaying the buffer),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 the sub-buffer is the part of the buffer that is displayed in a window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 The sub-buffer is defined in terms of three buffer-local-variable:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 @defvar term-height
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 The height of the sub-buffer, in screen lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 @defvar term-width
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 The width of the sub-buffer, in screen columns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 @defvar term-home-marker
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 The "home" position, that is the top left corner of the sub-buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 The sub-buffer is assumed to be the end part of the buffer;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 the @code{term-home-marker} should never be more than
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 @code{term-height} screen lines from the end of the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 @node altsubbuffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 @subsection The alternate sub-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 When a "graphical" program finishes, it is nice to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 restore the screen state to what it was before the program started.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 Many people are used to this behavior from @code{xterm}, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 its also offered by the @code{term} emulator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 @defun term-switch-to-alternate-sub-buffer set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 If @var{set} is true, and we're not already using the alternate sub-buffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 switch to it. What this means is that the @code{term-home-marker}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 is saved (in the variable @code{term-saved-home-marker}), and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 @code{term-home-marker} is set to the end of the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 If @var{set} is false and we're using the alternate sub-buffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 switch back to the saved sub-buffer. What this means is that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 (current, alternate) sub-buffer is deleted (using
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 @code{(delete-region term-home-marker (point-max))}), and then the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 @code{term-home-marker} is restored (from @code{term-saved-home-marker}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 @node Input to the inferior
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 @subsection Input to the inferior
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 Characters typed by the user are sent to the inferior.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 How this is done depends on whether the @code{term} buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 is in "character" mode or "line" mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 (A @code{term} buffer can also be in "pager" mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 This is discussed <later>.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 Which of these is currently active is specified in the mode line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 The difference between them is the key-bindings available.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 In character mode, one character (by default @key{C-c}) is special,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 and is a prefix for various commands. All other characters are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 sent directly to the inferior process, with no interpretation by Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 Character mode looks and feels like a real terminal, or a conventional
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 terminal emulator such as xterm.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 In line mode, key commands mostly have standard Emacs actions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 Regulars characters insert themselves into the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 When return is typed, the entire current line of the buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 (except possibly the prompt) is sent to the inferior process.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 Line mode is basically the original shell mode from earlier Emacs versions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 To switch from line mode to character mode type @kbd{C-c c}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 To switch from character mode to line mode type @kbd{C-c l}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 In either mode, "echoing" of user input is handled by the inferior.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 Therefor, in line mode after an input line at the end of the buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 is sent to the inferior, it is deleted from the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 This is so that the inferior can echo the input, if it wishes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 (which it normally does).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 @node Connecting to remote computers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 @section Connecting to remote computers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 If you want to login to a remove computer, you can do that just as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 you would expect, using whatever commands you would normally use.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 (This is worth emphasizing, because earlier versions of @code{shell}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 mode would not work properly if you tried to log in to some other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 computer, because of the way echoing was handled. That is why
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 there was a separate @code{telnet} mode to partially compensate for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 these problems. The @code{telnet} mode is no longer needed, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 is basically obsolete.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 A program that asks you for a password will normally suppress
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 echoing of the password, so the password will not show up in the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 This will happen just as if you were using a real terminal, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 the buffer is in char mode. If it is in line mode, the password
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 will be temporarily visible, but will be erased when you hit return.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 (This happens automatically; there is no special password processing.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 When you log in to a different machine, you need to specify the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 type of terminal your using. If you are talking to a Bourne-compatible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 shell, and your system understands the @code{TERMCAP} variable,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 you can use the command @kbd{M-x shell-send-termcap}, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 sends a string specifying the terminal type and size.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 (This command is also useful after the window has changed size.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 If you need to specify the terminal type manually, you can try the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 terminal types "ansi" or "vt100".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 You can of course run gdb on that remote computer. One useful
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 trick: If you invoke gdb with the @code{--fullname} option,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 it will send special commands to Emacs that will cause Emacs to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 pop up the source files you're debugging. This will work
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 whether or not gdb is running on a different computer than Emacs,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 assuming can access the source files specified by gdb.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 @node Paging
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 @section Paging
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 When the pager is enabled, Emacs will "pause" after each screenful
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 of output (since the last input sent to the inferior).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 It will enter "pager" mode, which feels a lot like the "more"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 program: Typing a space requests another screenful of output.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 Other commands request more or less output, or scroll backwards
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 in the @code{term} buffer. In pager mode, type @kbd{h} or @kbd{?}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 to display a help message listing all the available pager mode commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 In either character or line mode, type @kbd{C-c p} to enable paging,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 and @kbd{C-c D} to disable it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 @node Terminal escapes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 @section Terminal Escape sequences
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 A program that does "graphics" on a terminal controls the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 terminal by sending strings called @dfn{terminal escape sequences}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 that the terminal (or terminal emulator) interprets as special commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 The @code{term} mode includes a terminal emulator that understands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 standard ANSI escape sequences, originally popularized by VT100 terminals,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 and now used by the @code{xterm} program and most modern terminal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 emulator software.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 * Cursor motion:: Escape sequences to move the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 * Erasing:: Escape commands for erasing text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 * Inserting and deleting:: Escape sequences to insert and delete text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 * Scrolling:: Escape sequences to scroll part of the visible window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 * Command hook::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 * Miscellaneous escapes::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 printing chars
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 tab
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 LF
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 @node Cursor motion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 @subsection Escape sequences to move the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 @item RETURN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 Moves to the beginning of the current screen line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 @item C-b
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 Moves backwards one column. (Tabs are broken up if needed.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 @comment Line wrap FIXME
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 @item Esc [ R ; C H
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 Move to screen row R, screen column C, where (R=1) is the top row,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 and (C=1) is the leftmost column. Defaults are R=1 and C=1.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 @item Esc [ N A
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 Move N (default 1) screen lines up.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 @item Esc [ N B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 Move N (default 1) screen lines down.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 @item Esc [ N C
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 Move N (default 1) columns right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 @item Esc [ N D
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 Move N (default 1) columns left.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 @node Erasing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 @subsection Escape commands for erasing text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 These commands "erase" part of the sub-buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 Erasing means replacing by white space; it is not the same as deleting.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 The relative screen positions of things that are not erased remain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 unchanged with each other, as does the relative cursor position.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 @item E [ J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 Erase from cursor to end of screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 @item E [ 0 J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 Same as E [ J.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 @item E [ 1 J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 Erase from home position to point.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 @item E [ 2 J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 Erase whole sub-buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 @item E [ K
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 Erase from point to end of screen line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 @item E [ 0 K
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 Same as E [ K.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 @item E [ 1 K
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 Erase from beginning of screen line to point.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 @item E [ 2 K
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 Erase whole screen line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 @node Inserting and deleting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 @subsection Escape sequences to insert and delete text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 @item Esc [ N L
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 Insert N (default 1) blank lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 @item Esc [ N M
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 Delete N (default 1) lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 @item Esc [ N P
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 Delete N (default 1) characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 @item Esc [ N @@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 Insert N (default 1) spaces.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 @node Scrolling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 @subsection Escape sequences to scroll part of the visible window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 @item Esc D
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 Scroll forward one screen line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 @item Esc M
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 Scroll backwards one screen line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 @item Esc [ T ; B r
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 Set the scrolling region to be from lines T down to line B inclusive,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 where line 1 is the topmost line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 @node Command hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 @subsection Command hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 If @kbd{C-z} is seen, any text up to a following @key{LF} is scanned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 The text in between (not counting the initial C-z or the final LF)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 is passed to the function that is the value of @code{term-command-hook}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 The default value of the @code{term-command-hook} variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 is the function @code{term-command-hook}, which handles the following:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 @item C-z C-z FILENAME:LINENUMBER:IGNORED LF
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 Set term-pending-frame to @code{(cons "FILENAME" LINENUMBER)}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 When the buffer is displayed in the current window, show
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 the FILENAME in the other window, and show an arrow at LINENUMBER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 Gdb emits these strings when invoked with the flag --fullname.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 This is used by gdb mode; you can also invoke gdb with this flag
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 from shell mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 @item C-z / DIRNAME LF
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 Set the directory of the term buffer to DIRNAME
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 @item C-z ! LEXPR LF
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 Read and evaluate LEXPR as a Lisp expression.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 The result is ignored.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 @node Miscellaneous escapes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 @subsection Miscellaneous escapes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 @item C-g (Bell)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 Calls @code{(beep t)}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 @item Esc 7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 Save cursor.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 @item Esc 8
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 Restore cursor.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 @item Esc [ 47 h
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 Switch to the alternate sub-buffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 @item Esc [ 47 l
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 Switch back to the regular sub-buffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 @bye