aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2019-07-24 22:02:59 -0400
committerNoam Postavsky2019-07-25 18:23:55 -0400
commit7f42277b96130861967de3936defb0ef5bf07fbb (patch)
tree5988b85207b0c9da77973f09120cefbda91bb07c
parent16a529e215331626f66160194701b74248cb9fa5 (diff)
downloademacs-7f42277b96130861967de3936defb0ef5bf07fbb.tar.gz
emacs-7f42277b96130861967de3936defb0ef5bf07fbb.zip
Mention term.el's \032 dir tracking in commentary (Bug#19524)
* lisp/term.el: Mention both forms of directory tracking in commentary. Remove obsolete ChangeLog comments. Move more relevant summary comments to the top.
-rw-r--r--lisp/term.el143
1 files changed, 52 insertions, 91 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 9785ce30249..fb624e4b7a8 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -33,6 +33,21 @@
33 33
34;;; Commentary: 34;;; Commentary:
35 35
36;; This file defines a general command-interpreter-in-a-buffer package
37;; (term mode). The idea is that you can build specific process-in-a-buffer
38;; modes on top of term mode -- e.g., lisp, shell, scheme, T, soar, ....
39;; This way, all these specific packages share a common base functionality,
40;; and a common set of bindings, which makes them easier to use (and
41;; saves code, implementation time, etc., etc.).
42
43;; If, instead of `term', you call `ansi-term', you get multiple term
44;; buffers, after every new call ansi-term opens a new
45;; "*ansi-term*<xx>" window, where <xx> is, as usual, a number...
46
47;; For hints on converting existing process modes (e.g., tex-mode,
48;; background, dbx, gdb, kermit, prolog, telnet) to use term-mode
49;; instead of shell-mode, see the notes at the end of this file.
50
36;; Speed considerations and a few caveats 51;; Speed considerations and a few caveats
37;; -------------------------------------- 52;; --------------------------------------
38;; 53;;
@@ -85,13 +100,6 @@
85;; # By default nobody can't do anything 100;; # By default nobody can't do anything
86;; deny root * 101;; deny root *
87;; 102;;
88;;
89;; ----------------------------------------
90;;
91;; If, instead of 'term', you call 'ansi-term', you get multiple term
92;; buffers, after every new call ansi-term opens a new *ansi-term*<xx> window,
93;; where <xx> is, as usual, a number...
94;;
95;; ---------------------------------------- 103;; ----------------------------------------
96;; 104;;
97;; With the term-buffer-maximum-size you can finally decide how many 105;; With the term-buffer-maximum-size you can finally decide how many
@@ -100,7 +108,6 @@
100;; 108;;
101;; ---------------------------------------- 109;; ----------------------------------------
102;; 110;;
103;;
104;; ANSI colorization should work well, I've decided to limit the interpreter 111;; ANSI colorization should work well, I've decided to limit the interpreter
105;; to five outstanding commands (like ESC [ 01;04;32;41;07m. 112;; to five outstanding commands (like ESC [ 01;04;32;41;07m.
106;; You shouldn't need more, if you do, tell me and I'll increase it. It's 113;; You shouldn't need more, if you do, tell me and I'll increase it. It's
@@ -115,38 +122,6 @@
115;; - Add hooks to allow raw-mode keys to be configurable 122;; - Add hooks to allow raw-mode keys to be configurable
116;; - Which keys are better ? \eOA or \e[A ? 123;; - Which keys are better ? \eOA or \e[A ?
117;; 124;;
118;;
119;; Changes:
120;;
121;; V4.0 January 1997
122;;
123;; - Huge reworking of the faces code: now we only have roughly 20-30
124;; faces for everything so we're even faster than the old md-term.el !
125;; - Finished removing all the J-Shell code.
126;;
127;; V3.0 January 1997
128;;
129;; - Now all the supportable ANSI commands work well.
130;; - Reworked a little the code: much less jsh-inspired stuff
131;;
132;; V2.3 November
133;;
134;; - Now all the faces are accessed through an array: much cleaner code.
135;;
136;; V2.2 November 4 1996
137;;
138;; - Implemented ANSI output colorization ( a bit rough but enough for
139;; color_ls )
140;;
141;; - Implemented a maximum limit for the scroll buffer (stolen from
142;; comint.el)
143;;
144;; v2.1 October 28 1996, first public release
145;;
146;; - Some new keybindings for term-char mode ( notably home/end/...)
147;; - Directory, hostname and username tracking via ange-ftp
148;; - Multi-term capability via the ansi-term call
149;;
150;; ---------------------------------------------------------------- 125;; ----------------------------------------------------------------
151;; You should/could have something like this in your .emacs to take 126;; You should/could have something like this in your .emacs to take
152;; full advantage of this package 127;; full advantage of this package
@@ -160,7 +135,6 @@
160;; (auto-fill-mode -1) 135;; (auto-fill-mode -1)
161;; (setq tab-width 8 )))) 136;; (setq tab-width 8 ))))
162;; 137;;
163;;
164;; ---------------------------------------- 138;; ----------------------------------------
165;; 139;;
166;; If you want to use color ls the best setup is to have a different file 140;; If you want to use color ls the best setup is to have a different file
@@ -171,7 +145,6 @@
171;; 145;;
172;; ---------------------------------------- 146;; ----------------------------------------
173;; 147;;
174;;
175;; # Configuration file for the color ls utility 148;; # Configuration file for the color ls utility
176;; # This file goes in the /etc directory, and must be world readable. 149;; # This file goes in the /etc directory, and must be world readable.
177;; # You can copy this file to .dir_colors in your $HOME directory to 150;; # You can copy this file to .dir_colors in your $HOME directory to
@@ -228,17 +201,23 @@
228;; .xbm 01;35 201;; .xbm 01;35
229;; .xpm 01;35 202;; .xpm 01;35
230;; 203;;
231;;
232;; ---------------------------------------- 204;; ----------------------------------------
233;; 205;;
234;; Notice: for directory/host/user tracking you need to have something 206;; There are actually two methods for directory tracking, one
235;; like this in your shell startup script (this is for a POSIXish shell 207;; implemented in `term-command-hook' which sets the directory
236;; like Bash but should be quite easy to port to other shells). 208;; according to an escape sequence of the form "\032<directory>\n".
209;; Some shells like bash will already send this escape sequence when
210;; they detect they are running in Emacs. This can be configured or
211;; disabled on the Emacs side by setting `term-command-hook' to
212;; a different function.
237;; 213;;
238;; For troubleshooting in Bash, you can check the definition of the 214;; The second method is in `term-handle-ansi-terminal-messages' which
239;; custom functions with the "type" command. e.g. "type cd". If you 215;; sets user, host, and directory according to escape sequences of the
240;; do not see the expected definition from the config below, then the 216;; form "\033AnSiTc <directory>\n" (replace the "c" with "u" and "h"
241;; directory tracking will not work. 217;; for user and host, respectively). If the user and host don't
218;; match, it will set directory to a remote one, so it is important to
219;; set user and host correctly first. See the example bash
220;; configuration below.
242;; 221;;
243;; ---------------------------------------- 222;; ----------------------------------------
244;; 223;;
@@ -262,42 +241,24 @@
262;; 241;;
263;; # The \033 stands for ESC. 242;; # The \033 stands for ESC.
264;; # There is a space between "AnSiT?" and $whatever. 243;; # There is a space between "AnSiT?" and $whatever.
244;; printf '\033AnSiTh %s\n' "$HOSTNAME"
245;; printf '\033AnSiTu %s\n' "$USER"
246;; printf '\033AnSiTc %s\n' "$PWD"
265;; 247;;
266;; cd() { command cd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } 248;; cd() { command cd "$@"; printf '\033AnSiTc %s\n' "$PWD"; }
267;; pushd() { command pushd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } 249;; pushd() { command pushd "$@"; printf '\033AnSiTc %s\n' "$PWD"; }
268;; popd() { command popd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } 250;; popd() { command popd "$@"; printf '\033AnSiTc %s\n' "$PWD"; }
269;; 251;;
270;; printf '\033AnSiTc %s\n' "$PWD"
271;; printf '\033AnSiTh %s\n' "$HOSTNAME"
272;; printf '\033AnSiTu %s\n' "$USER"
273;;
274;; # Use custom dircolors in term buffers. 252;; # Use custom dircolors in term buffers.
275;; # eval $(dircolors $HOME/.emacs_dircolors) 253;; # eval $(dircolors $HOME/.emacs_dircolors)
276;; esac 254;; esac
277;; 255;;
278;; # ... 256;; # ...
279;; 257;;
280;; 258;; For troubleshooting in Bash, you can check the definition of the
281 259;; custom functions with the "type" command. e.g. "type cd". If you
282;;; Original Commentary: 260;; do not see the expected definition from the config below, then the
283;; --------------------- 261;; directory tracking will not work.
284
285;; The changelog is at the end of this file.
286
287;; Please send me bug reports, bug fixes, and extensions, so that I can
288;; merge them into the master source.
289;; - Per Bothner (bothner@cygnus.com)
290
291;; This file defines a general command-interpreter-in-a-buffer package
292;; (term mode). The idea is that you can build specific process-in-a-buffer
293;; modes on top of term mode -- e.g., lisp, shell, scheme, T, soar, ....
294;; This way, all these specific packages share a common base functionality,
295;; and a common set of bindings, which makes them easier to use (and
296;; saves code, implementation time, etc., etc.).
297
298;; For hints on converting existing process modes (e.g., tex-mode,
299;; background, dbx, gdb, kermit, prolog, telnet) to use term-mode
300;; instead of shell-mode, see the notes at the end of this file.
301 262
302 263
303;; Brief Command Documentation: 264;; Brief Command Documentation:
@@ -305,21 +266,21 @@
305;; Term Mode Commands: (common to all derived modes, like cmushell & cmulisp 266;; Term Mode Commands: (common to all derived modes, like cmushell & cmulisp
306;; mode) 267;; mode)
307;; 268;;
308;; m-p term-previous-input Cycle backwards in input history 269;; M-p term-previous-input Cycle backwards in input history
309;; m-n term-next-input Cycle forwards 270;; M-n term-next-input Cycle forwards
310;; m-r term-previous-matching-input Previous input matching a regexp 271;; M-r term-previous-matching-input Previous input matching a regexp
311;; m-s comint-next-matching-input Next input that matches 272;; M-s comint-next-matching-input Next input that matches
312;; return term-send-input 273;; return term-send-input
313;; c-c c-a term-bol Beginning of line; skip prompt. 274;; C-c C-a term-bol Beginning of line; skip prompt.
314;; c-d term-delchar-or-maybe-eof Delete char unless at end of buff. 275;; C-d term-delchar-or-maybe-eof Delete char unless at end of buff.
315;; c-c c-u term-kill-input ^u 276;; C-c C-u term-kill-input ^u
316;; c-c c-w backward-kill-word ^w 277;; C-c C-w backward-kill-word ^w
317;; c-c c-c term-interrupt-subjob ^c 278;; C-c C-c term-interrupt-subjob ^c
318;; c-c c-z term-stop-subjob ^z 279;; C-c C-z term-stop-subjob ^z
319;; c-c c-\ term-quit-subjob ^\ 280;; C-c C-\ term-quit-subjob ^\
320;; c-c c-o term-kill-output Delete last batch of process output 281;; C-c C-o term-kill-output Delete last batch of process output
321;; c-c c-r term-show-output Show last batch of process output 282;; C-c C-r term-show-output Show last batch of process output
322;; c-c c-h term-dynamic-list-input-ring List input history 283;; C-c C-h term-dynamic-list-input-ring List input history
323;; 284;;
324;; Not bound by default in term-mode 285;; Not bound by default in term-mode
325;; term-send-invisible Read a line w/o echo, and send to proc 286;; term-send-invisible Read a line w/o echo, and send to proc
@@ -329,8 +290,8 @@
329;; term-replace-by-expanded-filename Expand and complete filename at point; 290;; term-replace-by-expanded-filename Expand and complete filename at point;
330;; replace with expanded/completed name. 291;; replace with expanded/completed name.
331;; term-kill-subjob No mercy. 292;; term-kill-subjob No mercy.
332;; term-show-maximum-output Show as much output as possible. 293;; term-show-maximum-output Show as much output as possible.
333;; term-continue-subjob Send CONT signal to buffer's process 294;; term-continue-subjob Send CONT signal to buffer's process
334;; group. Useful if you accidentally 295;; group. Useful if you accidentally
335;; suspend your process (with C-c C-z). 296;; suspend your process (with C-c C-z).
336 297