annotate lisp/term/vt100.el @ 1658:452ba03935d7

* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify, Expose, ExposeWindow, or UnmapWindow, set f->async_visible, not f->visible. (x_do_pending_expose, x_raise_frame, x_lower_frame, x_make_frame_invisible, x_make_frame_visible, x_iconify_frame): Test and set f->async_visible and f->async_iconified, not f->visible or f->async_iconified.
author Jim Blandy <jimb@redhat.com>
date Sun, 06 Dec 1992 22:22:09 +0000
parents c2dbf1fe0506
children 505f87093028
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 ;;;; Define VT100 function key escape sequences in function-key-map.
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 ;;; CSI sequences - those that start with "\e[".
494
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
5 (define-prefix-command 'vt100-CSI-prefix)
466
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 (define-key function-key-map "\e[" 'vt100-CSI-prefix)
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7
494
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
8 (define-key vt100-CSI-prefix "A" [up])
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
9 (define-key vt100-CSI-prefix "B" [down])
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
10 (define-key vt100-CSI-prefix "C" [right])
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
11 (define-key vt100-CSI-prefix "D" [left])
466
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 (defun enable-arrow-keys ()
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 "Enable the use of the VT100 arrow keys for cursor motion.
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 Because of the nature of the VT100, this unavoidably breaks
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 the standard Emacs command ESC [; therefore, it is not done by default,
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 but only if you give this command."
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 (interactive)
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 (global-unset-key "\e["))
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 ;;; SS3 sequences - those that start with "\eO".
494
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
24 (define-prefix-command 'vt100-SS3-prefix)
466
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 (define-key function-key-map "\eO" 'vt100-SS3-prefix)
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
494
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
27 (define-key vt100-SS3-prefix "A" [up])
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
28 (define-key vt100-SS3-prefix "B" [down]) ; down-arrow
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
29 (define-key vt100-SS3-prefix "C" [right]) ; right-arrow
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
30 (define-key vt100-SS3-prefix "D" [left]) ; left-arrow
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
31 (define-key vt100-SS3-prefix "M" [kp-enter]) ; Enter
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
32 (define-key vt100-SS3-prefix "P" [kp-f1]) ; PF1
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
33 (define-key vt100-SS3-prefix "Q" [kp-f2]) ; PF2
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
34 (define-key vt100-SS3-prefix "R" [kp-f3]) ; PF3
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
35 (define-key vt100-SS3-prefix "S" [kp-f4]) ; PF4
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
36 (define-key vt100-SS3-prefix "l" [kp-separator]) ; ,
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
37 (define-key vt100-SS3-prefix "m" [kp-subtract]) ; -
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
38 (define-key vt100-SS3-prefix "n" [kp-period]) ; .
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
39 (define-key vt100-SS3-prefix "p" [kp-0]) ; 0
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
40 (define-key vt100-SS3-prefix "q" [kp-1]) ; 1
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
41 (define-key vt100-SS3-prefix "r" [kp-2]) ; 2
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
42 (define-key vt100-SS3-prefix "s" [kp-3]) ; 3
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
43 (define-key vt100-SS3-prefix "t" [kp-4]) ; 4
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
44 (define-key vt100-SS3-prefix "u" [kp-5]) ; 5
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
45 (define-key vt100-SS3-prefix "v" [kp-6]) ; 6
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
46 (define-key vt100-SS3-prefix "w" [kp-7]) ; 7
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
47 (define-key vt100-SS3-prefix "x" [kp-8]) ; 8
393e90d2071b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 466
diff changeset
48 (define-key vt100-SS3-prefix "y" [kp-9]) ; 9
466
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 ;;; Controlling the screen width.
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 494
diff changeset
52 (defconst vt100-wide-mode (= (frame-width) 132)
466
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 "t if vt100 is in 132-column mode.")
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 (defun vt100-wide-mode (&optional arg)
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 "Toggle 132/80 column mode for vt100s."
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 (interactive "P")
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 (setq vt100-wide-mode
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 (if (null arg) (not vt100-wide-mode)
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 (> (prefix-numeric-value arg) 0)))
a5749ca987d0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l"))
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 494
diff changeset
62 (set-frame-width (if vt100-wide-mode 132 80)))