annotate lisp/term/internal.el @ 6546:8eb722515c31

(set-visited-file-name): Kill local var vc-mode. Make buffer writable if was read-only due to vc.
author Richard M. Stallman <rms@gnu.org>
date Sun, 27 Mar 1994 19:49:47 +0000
parents e65b4acb9e6a
children da74d15b3571
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5444
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;; internal.el -- setup support for PC keyboards and screens, internal terminal
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1993 Free Software Foundation, Inc.
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: Morten Welinder <terra@diku.dk>
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Version: 1,01
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; any later version.
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; ---------------------------------------------------------------------------
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; screen setup -- that's easy!
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 (standard-display-8bit 127 254)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;; ---------------------------------------------------------------------------
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; keyboard setup -- that's simple!
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 (set-input-mode nil nil 0)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 (define-key global-map [mouse-1] 'mouse-set-point)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 (define-key function-key-map [backspace] "\177") ; Normal behaviour for BS
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 (define-key function-key-map [delete] "\C-d") ; ... and Delete
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 (define-key function-key-map [tab] [?\t])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 (define-key function-key-map [linefeed] [?\n])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 (define-key function-key-map [clear] [11])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 (define-key function-key-map [return] [13])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 (define-key function-key-map [escape] [?\e])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 (define-key function-key-map [M-backspace] [?\M-\d])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 (define-key function-key-map [M-delete] [?\M-\d])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 (define-key function-key-map [M-tab] [?\M-\t])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 (define-key function-key-map [M-linefeed] [?\M-\n])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 (define-key function-key-map [M-clear] [?\M-\013])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 (define-key function-key-map [M-return] [?\M-\015])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 (define-key function-key-map [M-escape] [?\M-\e])
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 (put 'backspace 'ascii-character 127)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 (put 'delete 'ascii-character 127)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 (put 'tab 'ascii-character ?\t)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 (put 'linefeed 'ascii-character ?\n)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 (put 'clear 'ascii-character 12)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 (put 'return 'ascii-character 13)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 (put 'escape 'ascii-character ?\e)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 ;; ---------------------------------------------------------------------------
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; We want to do this when Emacs is started because one day it will depend
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ;; on the country code.
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 (let* ((i 128)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 (modify (function
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 (lambda (ch sy)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 (modify-syntax-entry ch sy text-mode-syntax-table)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 (if (boundp 'tex-mode-syntax-table)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 (modify-syntax-entry ch sy tex-mode-syntax-table))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 (modify-syntax-entry ch sy (standard-syntax-table))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 )))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 (downs (car (standard-case-table)))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 (ups (car (cdr (standard-case-table))))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 (chars "‡€š‚ƒA„Ž…A†ˆE‰EŠE‹IŒII‘’“O”™•O–UĢU˜Y› AĄIĒOĢUĪĨ"))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 (while (< i 256)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 (funcall modify i "_")
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 (setq i (1+ i)))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 (setq i 0)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 (while (< i (length chars))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 (let ((ch1 (aref chars i))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 (ch2 (aref chars (1+ i))))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 (funcall modify ch1 "w")
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 (funcall modify ch2 "w")
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 (aset ups ch1 ch2)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 (if (> ch2 127)
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 (aset downs ch2 ch1))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 (setq i (+ i 2))))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 (let ((table (list downs ups nil nil)))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 (save-excursion
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 (mapcar (lambda (b) (progn (set-buffer b) (set-case-table table)))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 (buffer-list)))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 (set-standard-case-table table))
e65b4acb9e6a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 )