diff options
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/play/blackbox.el | 40 |
2 files changed, 28 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c342460f41..ad7114b59d5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2005-10-25 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * play/blackbox.el (blackbox-mode-map): Move init into declaration. | ||
| 4 | (blackbox-redefine-key): Add argument `map'. | ||
| 5 | |||
| 6 | * jit-lock.el (jit-lock-fontify-now): Be careful not to skip multiline | ||
| 7 | regions when moving the jit-lock-context-unfontify-pos boundary. | ||
| 8 | |||
| 1 | 2005-10-25 Reiner Steib <Reiner.Steib@gmx.de> | 9 | 2005-10-25 Reiner Steib <Reiner.Steib@gmx.de> |
| 2 | 10 | ||
| 3 | * net/browse-url.el (browse-url-of-buffer): Add ".html" to | 11 | * net/browse-url.el (browse-url-of-buffer): Add ".html" to |
diff --git a/lisp/play/blackbox.el b/lisp/play/blackbox.el index f6194bda5f9..fb0474d1460 100644 --- a/lisp/play/blackbox.el +++ b/lisp/play/blackbox.el | |||
| @@ -51,11 +51,11 @@ | |||
| 51 | ;; 2 H 4 H | 51 | ;; 2 H 4 H |
| 52 | ;; | 52 | ;; |
| 53 | ;; Rays which enter and exit are numbered. You can see that rays 1 & 5 pass | 53 | ;; Rays which enter and exit are numbered. You can see that rays 1 & 5 pass |
| 54 | ;; thru the box undisturbed. Ray 2 is deflected by the northwesternmost | 54 | ;; thru the box undisturbed. Ray 2 is deflected by the northwesternmost |
| 55 | ;; ball. Likewise rays 3 and 4. Rays which hit balls and are absorbed are | 55 | ;; ball. Likewise rays 3 and 4. Rays which hit balls and are absorbed are |
| 56 | ;; marked with H. The bottom of the left and the right of the bottom hit | 56 | ;; marked with H. The bottom of the left and the right of the bottom hit |
| 57 | ;; the southeastern ball directly. Rays may also hit balls after being | 57 | ;; the southeastern ball directly. Rays may also hit balls after being |
| 58 | ;; reflected. Consider the H on the bottom next to the 4. It bounces off | 58 | ;; reflected. Consider the H on the bottom next to the 4. It bounces off |
| 59 | ;; the NW-ern most ball and hits the central ball. A ray shot from above | 59 | ;; the NW-ern most ball and hits the central ball. A ray shot from above |
| 60 | ;; the right side 5 would hit the SE-ern most ball. The R beneath the 5 | 60 | ;; the right side 5 would hit the SE-ern most ball. The R beneath the 5 |
| 61 | ;; is because the ball is returned instantly. It is not allowed into | 61 | ;; is because the ball is returned instantly. It is not allowed into |
| @@ -69,8 +69,6 @@ | |||
| 69 | 69 | ||
| 70 | ;;; Code: | 70 | ;;; Code: |
| 71 | 71 | ||
| 72 | (defvar blackbox-mode-map nil "") | ||
| 73 | |||
| 74 | (defvar bb-board nil | 72 | (defvar bb-board nil |
| 75 | "Blackbox board.") | 73 | "Blackbox board.") |
| 76 | 74 | ||
| @@ -93,22 +91,24 @@ | |||
| 93 | ;; blackbox-specific bindings in blackbox-mode-map. This is so that | 91 | ;; blackbox-specific bindings in blackbox-mode-map. This is so that |
| 94 | ;; users who prefer non-default key bindings for cursor motion don't | 92 | ;; users who prefer non-default key bindings for cursor motion don't |
| 95 | ;; lose that when they play Blackbox. | 93 | ;; lose that when they play Blackbox. |
| 96 | (defun blackbox-redefine-key (oldfun newfun) | 94 | (defun blackbox-redefine-key (map oldfun newfun) |
| 97 | "Redefine keys that run the function OLDFUN to run NEWFUN instead." | 95 | "Redefine keys that run the function OLDFUN to run NEWFUN instead." |
| 98 | (define-key blackbox-mode-map (vector 'remap oldfun) newfun)) | 96 | (define-key map (vector 'remap oldfun) newfun)) |
| 99 | 97 | ||
| 100 | (unless blackbox-mode-map | 98 | |
| 101 | (setq blackbox-mode-map (make-keymap)) | 99 | (defvar blackbox-mode-map |
| 102 | (suppress-keymap blackbox-mode-map t) | 100 | (let ((map (make-keymap))) |
| 103 | (blackbox-redefine-key 'backward-char 'bb-left) | 101 | (suppress-keymap map t) |
| 104 | (blackbox-redefine-key 'forward-char 'bb-right) | 102 | (blackbox-redefine-key map 'backward-char 'bb-left) |
| 105 | (blackbox-redefine-key 'previous-line 'bb-up) | 103 | (blackbox-redefine-key map 'forward-char 'bb-right) |
| 106 | (blackbox-redefine-key 'next-line 'bb-down) | 104 | (blackbox-redefine-key map 'previous-line 'bb-up) |
| 107 | (blackbox-redefine-key 'move-end-of-line 'bb-eol) | 105 | (blackbox-redefine-key map 'next-line 'bb-down) |
| 108 | (blackbox-redefine-key 'move-beginning-of-line 'bb-bol) | 106 | (blackbox-redefine-key map 'move-end-of-line 'bb-eol) |
| 109 | (define-key blackbox-mode-map " " 'bb-romp) | 107 | (blackbox-redefine-key map 'move-beginning-of-line 'bb-bol) |
| 110 | (define-key blackbox-mode-map [insert] 'bb-romp) | 108 | (define-key map " " 'bb-romp) |
| 111 | (blackbox-redefine-key 'newline 'bb-done)) | 109 | (define-key map [insert] 'bb-romp) |
| 110 | (blackbox-redefine-key map 'newline 'bb-done) | ||
| 111 | map)) | ||
| 112 | 112 | ||
| 113 | ;; Blackbox mode is suitable only for specially formatted data. | 113 | ;; Blackbox mode is suitable only for specially formatted data. |
| 114 | (put 'blackbox-mode 'mode-class 'special) | 114 | (put 'blackbox-mode 'mode-class 'special) |
| @@ -434,5 +434,5 @@ a reflection." | |||
| 434 | 434 | ||
| 435 | (provide 'blackbox) | 435 | (provide 'blackbox) |
| 436 | 436 | ||
| 437 | ;;; arch-tag: 6c474c62-5617-4b10-9b44-ac430168c0e2 | 437 | ;; arch-tag: 6c474c62-5617-4b10-9b44-ac430168c0e2 |
| 438 | ;;; blackbox.el ends here | 438 | ;;; blackbox.el ends here |