aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1992-07-21 04:09:28 +0000
committerJim Blandy1992-07-21 04:09:28 +0000
commit151bdc833ef6611acf656aef027513d578b44592 (patch)
treeda1b882779041aa7d7d30c58224673c92cd611f3
parent0b0ef30f7987eb125e05d0a653036cd7f58a6c43 (diff)
downloademacs-151bdc833ef6611acf656aef027513d578b44592.tar.gz
emacs-151bdc833ef6611acf656aef027513d578b44592.zip
*** empty log message ***
-rw-r--r--lisp/frame.el6
-rw-r--r--lisp/play/blackbox.el49
-rw-r--r--src/lread.c4
3 files changed, 28 insertions, 31 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 4d0165f5bc9..c3e28eaaeea 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -245,15 +245,15 @@ configuration, and other parameters set as specified in CONFIGURATION."
245;;;; Convenience functions for accessing and interactively changing 245;;;; Convenience functions for accessing and interactively changing
246;;;; frame parameters. 246;;;; frame parameters.
247 247
248(defun frame-width (&optional frame) 248(defun frame-height (&optional frame)
249 "Return number of lines available for display on FRAME. 249 "Return number of lines available for display on FRAME.
250If FRAME is omitted, describe the currently selected frame." 250If FRAME is omitted, describe the currently selected frame."
251 (cdr (assq 'width (frame-parameters frame)))) 251 (cdr (assq 'height (frame-parameters frame))))
252 252
253(defun frame-width (&optional frame) 253(defun frame-width (&optional frame)
254 "Return number of columns available for display on FRAME. 254 "Return number of columns available for display on FRAME.
255If FRAME is omitted, describe the currently selected frame." 255If FRAME is omitted, describe the currently selected frame."
256 (cdr (assq 'height (frame-parameters frame)))) 256 (cdr (assq 'width (frame-parameters frame))))
257 257
258(defun set-frame-height (h) 258(defun set-frame-height (h)
259 (interactive "NHeight: ") 259 (interactive "NHeight: ")
diff --git a/lisp/play/blackbox.el b/lisp/play/blackbox.el
index cc4e2066690..acca97d2335 100644
--- a/lisp/play/blackbox.el
+++ b/lisp/play/blackbox.el
@@ -81,27 +81,20 @@
81 (define-key blackbox-mode-map "\C-e" 'bb-eol) 81 (define-key blackbox-mode-map "\C-e" 'bb-eol)
82 (define-key blackbox-mode-map "\C-a" 'bb-bol) 82 (define-key blackbox-mode-map "\C-a" 'bb-bol)
83 (define-key blackbox-mode-map " " 'bb-romp) 83 (define-key blackbox-mode-map " " 'bb-romp)
84 (define-key blackbox-mode-map [insert] 'bb-romp)
84 (define-key blackbox-mode-map "\C-m" 'bb-done) 85 (define-key blackbox-mode-map "\C-m" 'bb-done)
86 (define-key blackbox-mode-map [kp-enter] 'bb-done)
85 87
86 ;; This is a kluge. What we really want is a general 88 ;; This is a kluge. What we really want is a general
87 ;; feature for reminding terminal keys to the functions 89 ;; feature for reminding terminal keys to the functions
88 ;; corresponding to them in local maps 90 ;; corresponding to them in local maps.
89 (if (featurep 'keypad) 91 (mapcar (function
90 (let (keys) 92 (lambda (funk)
91 (if (setq keys (function-key-sequence ?u)) ; Up Arrow 93 (mapcar (function
92 (define-key blackbox-mode-map keys 'bb-up)) 94 (lambda (key)
93 (if (setq keys (function-key-sequence ?d)) ; Down Arrow 95 (define-key blackbox-mode-map key funk)))
94 (define-key blackbox-mode-map keys 'bb-down)) 96 (where-is-internal funk))))
95 (if (setq keys (function-key-sequence ?l)) ; Left Arrow 97 '(previous-line next-line backward-character forward-character)))
96 (define-key blackbox-mode-map keys 'bb-left))
97 (if (setq keys (function-key-sequence ?r)) ; Right Arrow
98 (define-key blackbox-mode-map keys 'bb-right))
99 (if (setq keys (function-key-sequence ?e)) ; Enter
100 (define-key blackbox-mode-map keys 'bb-done))
101 (if (setq keys (function-key-sequence ?I)) ; Insert
102 (define-key blackbox-mode-map keys 'bb-romp))
103 )))
104
105 98
106;; Blackbox mode is suitable only for specially formatted data. 99;; Blackbox mode is suitable only for specially formatted data.
107(put 'blackbox-mode 'mode-class 'special) 100(put 'blackbox-mode 'mode-class 'special)
@@ -139,9 +132,10 @@ your score.
139 132
140Overview of play: 133Overview of play:
141 134
142To play blackbox, call the function `blackbox'. An optional prefix 135\\<blackbox-mode-map>\
143argument specifies the number of balls to be hidden in the box; the 136To play blackbox, type \\[blackbox]. An optional prefix argument
144default is four. 137specifies the number of balls to be hidden in the box; the default is
138four.
145 139
146The cursor can be moved around the box with the standard cursor 140The cursor can be moved around the box with the standard cursor
147movement keys. 141movement keys.
@@ -150,14 +144,14 @@ To shoot a ray, move the cursor to the edge of the box and press SPC.
150The result will be determined and the playfield updated. 144The result will be determined and the playfield updated.
151 145
152You may place or remove balls in the box by moving the cursor into the 146You may place or remove balls in the box by moving the cursor into the
153box and pressing \\<bb-romp>. 147box and pressing \\[bb-romp].
154 148
155When you think the configuration of balls you have placed is correct, 149When you think the configuration of balls you have placed is correct,
156press \\<bb-done>. You will be informed whether you are correct or not, and 150press \\[bb-done]. You will be informed whether you are correct or
157be given your score. Your score is the number of letters and numbers 151not, and be given your score. Your score is the number of letters and
158around the outside of the box plus five for each incorrectly placed 152numbers around the outside of the box plus five for each incorrectly
159ball. If you placed any balls incorrectly, they will be indicated 153placed ball. If you placed any balls incorrectly, they will be
160with `x', and their actual positions indicated with `o'. 154indicated with `x', and their actual positions indicated with `o'.
161 155
162Details: 156Details:
163 157
@@ -408,7 +402,8 @@ a reflection."
408 (bb-update-board c) 402 (bb-update-board c)
409 (1+ (bb-show-bogus-balls-2 (cdr list-1) list-2 c))))) 403 (1+ (bb-show-bogus-balls-2 (cdr list-1) list-2 c)))))
410 404
411;; blackbox.el ends here 405(defun bb-outside-box (x y)
406 (or (= x -1) (= x 8) (= y -1) (= y 8)))
412 407
413(defun bb-goto (pos) 408(defun bb-goto (pos)
414 (goto-char (+ (* (car pos) 2) (* (cdr pos) 22) 26))) 409 (goto-char (+ (* (car pos) 2) (* (cdr pos) 22) 26)))
diff --git a/src/lread.c b/src/lread.c
index db0ff297783..279f64a81b7 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1049,8 +1049,10 @@ isfloat_string (cp)
1049 } 1049 }
1050 return (*cp == 0 1050 return (*cp == 0
1051 && (state == (LEAD_INT|DOT_CHAR|TRAIL_INT) 1051 && (state == (LEAD_INT|DOT_CHAR|TRAIL_INT)
1052 || state == (DOT_CHAR|TRAIL_INT)
1052 || state == (LEAD_INT|E_CHAR|EXP_INT) 1053 || state == (LEAD_INT|E_CHAR|EXP_INT)
1053 || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT))); 1054 || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT)
1055 || state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT)));
1054} 1056}
1055#endif /* LISP_FLOAT_TYPE */ 1057#endif /* LISP_FLOAT_TYPE */
1056 1058