189 |
(aset encoded-kbd-iso2022-invocations 2 nil) |
(aset encoded-kbd-iso2022-invocations 2 nil) |
190 |
(setq unread-command-events (cons char unread-command-events)))) |
(setq unread-command-events (cons char unread-command-events)))) |
191 |
|
|
192 |
(defun encoded-kbd-self-insert-iso2022-8bit () |
(defun encoded-kbd-self-insert-iso2022-8bit (arg) |
193 |
(interactive) |
(interactive "p") |
194 |
(cond |
(cond |
195 |
((= last-command-char ?\216) ; SS2 (Single Shift 2) |
((= last-command-char ?\216) ; SS2 (Single Shift 2) |
196 |
(aset encoded-kbd-iso2022-invocations 2 2)) |
(aset encoded-kbd-iso2022-invocations 2 2)) |
197 |
((= last-command-char ?\217) ; SS3 (Single Shift 3) |
((= last-command-char ?\217) ; SS3 (Single Shift 3) |
198 |
(aset encoded-kbd-iso2022-invocations 2 3)) |
(aset encoded-kbd-iso2022-invocations 2 3)) |
199 |
(t |
(t |
200 |
(let* ((charset (aref encoded-kbd-iso2022-designations |
(let* ((charset (aref encoded-kbd-iso2022-designations |
201 |
(or (aref encoded-kbd-iso2022-invocations 2) |
(or (aref encoded-kbd-iso2022-invocations 2) |
202 |
(aref encoded-kbd-iso2022-invocations 1)))) |
(aref encoded-kbd-iso2022-invocations 1)))) |
203 |
(char (if (= (charset-dimension charset) 1) |
(char (if (= (charset-dimension charset) 1) |
204 |
(make-char charset last-command-char) |
(make-char charset last-command-char) |
205 |
(make-char charset last-command-char |
(make-char charset last-command-char |
206 |
(read-char-exclusive))))) |
(read-char-exclusive))))) |
207 |
(aset encoded-kbd-iso2022-invocations 2 nil) |
(aset encoded-kbd-iso2022-invocations 2 nil) |
208 |
(setq unread-command-events (cons char unread-command-events)))))) |
;; As simply setting unread-command-events may result in |
209 |
|
;; infinite-loop for characters 160..255, this is a temporary |
210 |
|
;; workaround until we found a better solution. |
211 |
|
(let ((last-command-char char)) |
212 |
|
(self-insert-command arg)))))) |
213 |
|
|
214 |
(defun encoded-kbd-self-insert-sjis () |
(defun encoded-kbd-self-insert-sjis () |
215 |
(interactive) |
(interactive) |
315 |
(setq encoded-kbd-mode nil) |
(setq encoded-kbd-mode nil) |
316 |
(error "No coding system for keyboard input is set")) |
(error "No coding system for keyboard input is set")) |
317 |
|
|
318 |
((eq (coding-system-type coding) 'sjis) |
((eq (coding-system-type coding) 'shift-jis) |
319 |
(set-input-mode |
(set-input-mode |
320 |
(nth 0 saved-input-mode) (nth 1 saved-input-mode) |
(nth 0 saved-input-mode) (nth 1 saved-input-mode) |
321 |
'use-8th-bit (nth 3 saved-input-mode)) |
'use-8th-bit (nth 3 saved-input-mode)) |