changeset 66440:5a126d3f6688

(blackbox-mode-map): Move init into declaration. (blackbox-redefine-key): Add argument `map'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 25 Oct 2005 15:28:00 +0000
parents 52c79134b5d5
children 90aa3875974e
files lisp/ChangeLog lisp/play/blackbox.el
diffstat 2 files changed, 27 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 25 15:26:41 2005 +0000
+++ b/lisp/ChangeLog	Tue Oct 25 15:28:00 2005 +0000
@@ -1,3 +1,11 @@
+2005-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* play/blackbox.el (blackbox-mode-map): Move init into declaration.
+	(blackbox-redefine-key): Add argument `map'.
+
+	* jit-lock.el (jit-lock-fontify-now): Be careful not to skip multiline
+	regions when moving the jit-lock-context-unfontify-pos boundary.
+
 2005-10-25  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* net/browse-url.el (browse-url-of-buffer): Add ".html" to
--- a/lisp/play/blackbox.el	Tue Oct 25 15:26:41 2005 +0000
+++ b/lisp/play/blackbox.el	Tue Oct 25 15:28:00 2005 +0000
@@ -51,11 +51,11 @@
 ;; 		   2   H 4       H
 ;;
 ;; Rays which enter and exit are numbered.  You can see that rays 1 & 5 pass
-;; thru the box undisturbed. Ray 2 is deflected by the northwesternmost
+;; thru the box undisturbed.  Ray 2 is deflected by the northwesternmost
 ;; ball.  Likewise rays 3 and 4. Rays which hit balls and are absorbed are
 ;; marked with H.  The bottom of the left and the right of the bottom hit
 ;; the southeastern ball directly.  Rays may also hit balls after being
-;; reflected. Consider the H on the bottom next to the 4.  It bounces off
+;; reflected.  Consider the H on the bottom next to the 4.  It bounces off
 ;; the NW-ern most ball and hits the central ball.  A ray shot from above
 ;; the right side 5 would hit the SE-ern most ball.  The R beneath the 5
 ;; is because the ball is returned instantly.  It is not allowed into
@@ -69,8 +69,6 @@
 
 ;;; Code:
 
-(defvar blackbox-mode-map nil "")
-
 (defvar bb-board nil
   "Blackbox board.")
 
@@ -93,22 +91,24 @@
 ;; blackbox-specific bindings in blackbox-mode-map.  This is so that
 ;; users who prefer non-default key bindings for cursor motion don't
 ;; lose that when they play Blackbox.
-(defun blackbox-redefine-key (oldfun newfun)
+(defun blackbox-redefine-key (map oldfun newfun)
   "Redefine keys that run the function OLDFUN to run NEWFUN instead."
-  (define-key blackbox-mode-map (vector 'remap oldfun) newfun))
+  (define-key map (vector 'remap oldfun) newfun))
+
 
-(unless blackbox-mode-map
-  (setq blackbox-mode-map (make-keymap))
-  (suppress-keymap blackbox-mode-map t)
-  (blackbox-redefine-key 'backward-char 'bb-left)
-  (blackbox-redefine-key 'forward-char 'bb-right)
-  (blackbox-redefine-key 'previous-line 'bb-up)
-  (blackbox-redefine-key 'next-line 'bb-down)
-  (blackbox-redefine-key 'move-end-of-line 'bb-eol)
-  (blackbox-redefine-key 'move-beginning-of-line 'bb-bol)
-  (define-key blackbox-mode-map " " 'bb-romp)
-  (define-key blackbox-mode-map [insert] 'bb-romp)
-  (blackbox-redefine-key 'newline 'bb-done))
+(defvar blackbox-mode-map 
+  (let ((map (make-keymap)))
+    (suppress-keymap map t)
+    (blackbox-redefine-key map 'backward-char 'bb-left)
+    (blackbox-redefine-key map 'forward-char 'bb-right)
+    (blackbox-redefine-key map 'previous-line 'bb-up)
+    (blackbox-redefine-key map 'next-line 'bb-down)
+    (blackbox-redefine-key map 'move-end-of-line 'bb-eol)
+    (blackbox-redefine-key map 'move-beginning-of-line 'bb-bol)
+    (define-key map " " 'bb-romp)
+    (define-key map [insert] 'bb-romp)
+    (blackbox-redefine-key map 'newline 'bb-done)
+    map))
 
 ;; Blackbox mode is suitable only for specially formatted data.
 (put 'blackbox-mode 'mode-class 'special)
@@ -434,5 +434,5 @@
 
 (provide 'blackbox)
 
-;;; arch-tag: 6c474c62-5617-4b10-9b44-ac430168c0e2
+;; arch-tag: 6c474c62-5617-4b10-9b44-ac430168c0e2
 ;;; blackbox.el ends here