From e19634539c29c5db8bf84af6555f2ee09386fcf0 Mon Sep 17 00:00:00 2001 From: Patrick Pippen Date: Sun, 23 Mar 2008 19:18:31 -0500 Subject: [PATCH] Remove a couple of fixme's for input.lisp Added an unwind-protect form to read-one-char function. Replace: the map, lambda, with a loop instead within input-insert-string function. --- input.lisp | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/input.lisp b/input.lisp index 2f9d08f..95ac58d 100644 --- a/input.lisp +++ b/input.lisp @@ -133,7 +133,6 @@ (defun input-handle-key-press-event (&rest event-slots &key root code state &allow-other-keys) (declare (ignore event-slots root)) - ;; FIXED: removed cons (list* code state)) (defun input-handle-selection-event (&key window selection property &allow-other-keys) @@ -219,11 +218,11 @@ to return a list of matches." (defun read-one-char (screen) "Read a single character from the user." (grab-keyboard screen) - ;; FIXME: should this be in an unwind-protect to ungrab the kbd? - (prog1 - (let ((k (read-key-no-modifiers))) - (keycode->character (car k) (xlib:make-state-keys (cdr k)))) - (ungrab-keyboard))) + (unwind-protect + (prog1 + (let ((k (read-key-no-modifiers))) + (keycode->character (car k) (xlib:make-state-keys (cdr k)))) + (ungrab-keyboard)))) (defun draw-input-bucket (screen prompt input &optional errorp) "Draw to the screen's input window the contents of input." @@ -313,9 +312,8 @@ to return a list of matches." position. @var{input} must be of type @var{input-line}. Input functions are passed this structure as their first argument." (check-type string string) - ;; FIXME: obviously this is substandard - (map nil (lambda (c) (input-insert-char input c)) - string)) + (loop for c across string + do (input-insert-char input c))) -- 1.5.3.7