[mcclim-cvs] CVS mcclim/Drei
thenriksen
thenriksen at common-lisp.net
Wed Apr 30 21:27:46 UTC 2008
Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv7853/Drei
Modified Files:
drei-clim.lisp input-editor.lisp
Log Message:
Really Fix dead keys.
Now integrated with the gesture reading machinery in
standard-extended-input-steeam, so it can be circumvented if you
really don't want it by handling events manually.
--- /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp 2008/04/29 20:52:02 1.43
+++ /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp 2008/04/30 21:27:46 1.44
@@ -392,6 +392,10 @@
(declare (ignore args))
(display-drei-area drei))
+(defmethod execute-drei-command ((drei drei-area) command)
+ (let ((*standard-input* (or *minibuffer* *standard-input*)))
+ (call-next-method)))
+
;;; Implementation of the displayed-output-record and region protocol
;;; for Drei areas. The redisplay-related stuff is in
;;; drei-redisplay.lisp.
--- /project/mcclim/cvsroot/mcclim/Drei/input-editor.lisp 2008/02/08 13:24:48 1.46
+++ /project/mcclim/cvsroot/mcclim/Drei/input-editor.lisp 2008/04/30 21:27:46 1.47
@@ -565,32 +565,37 @@
(old-buffer-contents (buffer-sequence buffer 0 (size buffer))))
(with-bound-drei-special-variables (drei :prompt "M-x ")
(update-drei-buffer stream)
- ;; Commands are permitted to signal immediate rescans, but
- ;; we may need to do some stuff first.
- (unwind-protect
- (accepting-from-user (drei)
- ;; We narrow the buffer to the last object before
- ;; input-position, so the user will not be able to
- ;; delete arguments prompts or other things.
- (drei-core:with-narrowed-buffer (drei
- (loop for index from
- (1- (input-position stream)) above 0
- when (typep (buffer-object buffer index)
- 'noise-string)
- return (1+ index)
- finally (return 0))
- t t)
- (handler-case (process-gestures-or-command drei)
- (unbound-gesture-sequence (c)
- (display-message "~A is unbound" (gesture-name (gestures c))))
- (abort-gesture (c)
- (if (member (abort-gesture-event c)
- *abort-gestures*
- :test #'event-matches-gesture-name-p)
- (signal 'abort-gesture :event (abort-gesture-event c))
- (when was-directly-processing
- (display-message "Aborted")))))))
- (update-drei-buffer stream))
+ ;; Since we have an unread gesture in the encapsulated stream,
+ ;; we should use that for further input. *standard-input* is
+ ;; bound back to the minibuffer (maybe) when an actual command
+ ;; is executed.
+ (let ((*standard-input* (encapsulating-stream-stream stream)))
+ ;; Commands are permitted to signal immediate rescans, but
+ ;; we may need to do some stuff first.
+ (unwind-protect
+ (accepting-from-user (drei)
+ ;; We narrow the buffer to the last object before
+ ;; input-position, so the user will not be able to
+ ;; delete arguments prompts or other things.
+ (drei-core:with-narrowed-buffer (drei
+ (loop for index from
+ (1- (input-position stream)) above 0
+ when (typep (buffer-object buffer index)
+ 'noise-string)
+ return (1+ index)
+ finally (return 0))
+ t t)
+ (handler-case (process-gestures-or-command drei)
+ (unbound-gesture-sequence (c)
+ (display-message "~A is unbound" (gesture-name (gestures c))))
+ (abort-gesture (c)
+ (if (member (abort-gesture-event c)
+ *abort-gestures*
+ :test #'event-matches-gesture-name-p)
+ (signal 'abort-gesture :event (abort-gesture-event c))
+ (when was-directly-processing
+ (display-message "Aborted")))))))
+ (update-drei-buffer stream)))
(let ((first-mismatch (buffer-array-mismatch buffer old-buffer-contents)))
(display-drei drei :redisplay-minibuffer t)
(cond ((null first-mismatch)
More information about the Mcclim-cvs
mailing list