Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
8bed5e3d
Commit
8bed5e3d
authored
Aug 21, 1996
by
Richard M. Stallman
Browse files
(keyboard-translate): Use a char-table.
(keyboard-translate-table): Add char-table-extra-slots property.
parent
d7b43eaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
lisp/subr.el
lisp/subr.el
+5
-12
No files found.
lisp/subr.el
View file @
8bed5e3d
...
...
@@ -213,22 +213,15 @@ a string or vector of length 1."
(
setq
inserted
t
)))
(
setq
tail
(
cdr
tail
)))))
(
put
'keyboard-translate-table
'char-table-extra-slots
0
)
(
defun
keyboard-translate
(
from
to
)
"Translate character FROM to TO at a low level.
This function creates a `keyboard-translate-table' if necessary
and then modifies one entry in it."
(
or
(
arrayp
keyboard-translate-table
)
(
setq
keyboard-translate-table
""
))
(
if
(
or
(
>
from
(
length
keyboard-translate-table
))
(
>
to
(
length
keyboard-translate-table
)))
(
progn
(
let*
((
i
(
length
keyboard-translate-table
))
(
table
(
concat
keyboard-translate-table
(
make-string
(
-
256
i
)
0
))))
(
while
(
<
i
256
)
(
aset
table
i
i
)
(
setq
i
(
1+
i
)))
(
setq
keyboard-translate-table
table
))))
(
or
(
char-table-p
keyboard-translate-table
)
(
setq
keyboard-translate-table
(
make-char-table
'keyboard-translate-table
nil
)))
(
aset
keyboard-translate-table
from
to
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment