Mercurial > emacs
comparison lisp/allout.el @ 112388:e5e8faa33346
(allout-institute-keymap): Use fset instead of reapplying defalias.
(allout-hotspot-key-handler): Check for non-control-modified bindings for
hotspot characters if there is no control-modified versions.
author | Ken Manheimer <ken.manheimer@gmail.com> |
---|---|
date | Thu, 20 Jan 2011 16:57:15 -0500 |
parents | ac3e3168aca2 |
children | 744ddded8b6a |
comparison
equal
deleted
inserted
replaced
112387:ac3e3168aca2 | 112388:e5e8faa33346 |
---|---|
167 ;; allout-mode-map-value, which has the actual keymap value. | 167 ;; allout-mode-map-value, which has the actual keymap value. |
168 ;; allout-mode-map's symbol value is just 'allout-mode-map, so it can be | 168 ;; allout-mode-map's symbol value is just 'allout-mode-map, so it can be |
169 ;; used in minor-mode-map-alist to indirect to the actual | 169 ;; used in minor-mode-map-alist to indirect to the actual |
170 ;; allout-mode-map-var value, which can be adjusted and reassigned. | 170 ;; allout-mode-map-var value, which can be adjusted and reassigned. |
171 | 171 |
172 ;; allout-mode-map-value for keymap reference in various places: | |
172 (setq allout-mode-map-value map) | 173 (setq allout-mode-map-value map) |
173 ;; The defalias reexecution is necessary when allout-mode-map-value is | 174 ;; the function value keymap of allout-mode-map is used in |
174 ;; changing from nil, and it doesn't hurt to do it every time, so: | 175 ;; minor-mode-map-alist - update it: |
175 (defalias 'allout-mode-map allout-mode-map-value)) | 176 (fset allout-mode-map allout-mode-map-value)) |
176 ;;;_ * intialize the mode map: | 177 ;;;_ * intialize the mode map: |
177 ;; ensure that allout-mode-map has some setting even if allout-mode hasn't | 178 ;; ensure that allout-mode-map has some setting even if allout-mode hasn't |
178 ;; been invoked: | 179 ;; been invoked: |
179 (allout-compose-and-institute-keymap) | 180 (allout-compose-and-institute-keymap) |
180 ;;;_ = allout-command-prefix | 181 ;;;_ = allout-command-prefix |
3414 (if (and | 3415 (if (and |
3415 ;; exclude control chars and escape: | 3416 ;; exclude control chars and escape: |
3416 (not modified) | 3417 (not modified) |
3417 (<= 33 key-num) | 3418 (<= 33 key-num) |
3418 (setq mapped-binding | 3419 (setq mapped-binding |
3419 ;; translate as a keybinding: | 3420 (or |
3420 (key-binding (vconcat allout-command-prefix | 3421 ;; try control-modified versions of keys: |
3421 (vector | 3422 (key-binding (vconcat allout-command-prefix |
3422 (if (and (<= 97 key-num) ; "a" | 3423 (vector |
3423 (>= 122 key-num)) ; "z" | 3424 (if (and (<= 97 key-num) ; "a" |
3424 (- key-num 96) key-num))) | 3425 (>= 122 key-num)) ; "z" |
3425 t))) | 3426 (- key-num 96) key-num))) |
3427 t) | |
3428 ;; try non-modified versions of keys: | |
3429 (key-binding (vconcat allout-command-prefix | |
3430 (vector key-num)) | |
3431 t)))) | |
3426 ;; Qualified as an allout command -- do hot-spot operation. | 3432 ;; Qualified as an allout command -- do hot-spot operation. |
3427 (setq allout-post-goto-bullet t) | 3433 (setq allout-post-goto-bullet t) |
3428 ;; accept-defaults nil, or else we get allout-item-icon-key-handler. | 3434 ;; accept-defaults nil, or else we get allout-item-icon-key-handler. |
3429 (setq mapped-binding (key-binding (vector key-num)))) | 3435 (setq mapped-binding (key-binding (vector key-num)))) |
3430 | 3436 |