26 |
|
|
27 |
;; This mode is intended for use with languages that adds a small |
;; This mode is intended for use with languages that adds a small |
28 |
;; number of extra letters not available on the keyboard. |
;; number of extra letters not available on the keyboard. |
29 |
;; |
;; |
30 |
;; Examples includes Scandinavian and German with an US keyboard. |
;; Examples includes Scandinavian and German with an US keyboard. |
31 |
;; |
;; |
32 |
;; The idea is that certain keys are overloaded. When you press it |
;; The idea is that certain keys are overloaded. When you press it |
34 |
;; string will be replaced by another. This can be used for mapping |
;; string will be replaced by another. This can be used for mapping |
35 |
;; keys on a US keyboard to generate characters according to the local |
;; keys on a US keyboard to generate characters according to the local |
36 |
;; keyboard convention when pressed once, and according to US keyboard |
;; keyboard convention when pressed once, and according to US keyboard |
37 |
;; convention when pressed twice. |
;; convention when pressed twice. |
38 |
;; |
;; |
39 |
;; To use this mode, you must define the variable `double-map' and |
;; To use this mode, you must define the variable `double-map' and |
40 |
;; then enable double mode with `M-x double-mode'. Read the |
;; then enable double mode with `M-x double-mode'. Read the |
75 |
|
|
76 |
(defcustom double-prefix-only t |
(defcustom double-prefix-only t |
77 |
"*Non-nil means that Double mode mapping only works for prefix keys. |
"*Non-nil means that Double mode mapping only works for prefix keys. |
78 |
That is, for any key `X' in `double-map', `X' alone will be mapped |
That is, for any key `X' in `double-map', `X' alone will be mapped |
79 |
but not `C-u X' or `ESC X' since the X is not the prefix key." |
but not `C-u X' or `ESC X' since the X is not the prefix key." |
80 |
:group 'double |
:group 'double |
81 |
:type 'boolean) |
:type 'boolean) |
99 |
(or (boundp 'isearch-mode-map) |
(or (boundp 'isearch-mode-map) |
100 |
(load-library "isearch")) |
(load-library "isearch")) |
101 |
|
|
102 |
(define-key isearch-mode-map [ignore] |
(define-key isearch-mode-map [ignore] |
103 |
(function (lambda () (interactive) (isearch-update)))) |
(function (lambda () (interactive) (isearch-update)))) |
104 |
|
|
105 |
(defun double-translate-key (prompt) |
(defun double-translate-key (prompt) |
117 |
(let ((new (double-read-event prompt)) |
(let ((new (double-read-event prompt)) |
118 |
(entry (assoc double-last-event double-map))) |
(entry (assoc double-last-event double-map))) |
119 |
(if (eq new double-last-event) |
(if (eq new double-last-event) |
120 |
(progn |
(progn |
121 |
(setq unread-command-events |
(setq unread-command-events |
122 |
(append (make-list (1- (length (nth 1 entry))) |
(append (make-list (1- (length (nth 1 entry))) |
123 |
127) |
127) |