[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: entries and guile-gui
From: |
Neil Jerram |
Subject: |
Re: entries and guile-gui |
Date: |
Thu, 22 Feb 2007 21:28:55 +0000 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Neil Jerram <address@hidden> writes:
> I'm still seeing some weirdness with the up and down arrows, which
> should go back and forwards through the history, but that might not be
> a regression. Do you see this too, and can you comment on whether
> it's a new problem?
Please try out the patches below (which include the one I posted
before). It seems I made the (if x y) mistake almost everywhere I
used `if', and there was also a fairly obvious mistake in the history
handling, not initializing `position' when starting a new read.
With these patches, all seems to be working well for me.
Regards,
Neil
--- /home/neil/guile-gui-0.2/entry-port.scm 2001-03-09 21:23:23.000000000
+0000
+++ /home/neil/guile-gui-head/entry-port.scm 2007-02-22 21:21:33.164867384
+0000
@@ -26,7 +26,8 @@
(begin
(gtk-entry-select-region entry 0 0)
(gtk-entry-set-position entry saved-pos)
- (set! saved-pos #f)))
+ (set! saved-pos #f))
+ #f)
#f)))
;; This handler runs after insertion and checks whether the last
@@ -46,10 +47,14 @@
(begin
(set! saved-pos pos)
(if (memq 'move-cursor
paren-matching-style)
- (gtk-entry-set-position
entry open-pos))
+ (gtk-entry-set-position
entry open-pos)
+ #f)
(if (memq 'highlight-region
paren-matching-style)
- (gtk-entry-select-region
entry open-pos pos))
- (gtk-timeout-add 500
restore-text))))))))
+ (gtk-entry-select-region
entry open-pos pos)
+ #f)
+ (gtk-timeout-add 500
restore-text))
+ #f))
+ #f))))
;; This handler restores the entry contents early in the event of
;; a key press occurring before the above timer pops.
@@ -67,7 +72,8 @@
(or (>= position 0)
(set! non-history-line (gtk-entry-get-text entry)))
(set! position (+ position 1))
- (gtk-entry-set-text entry (list-ref history position)))))
+ (gtk-entry-set-text entry (list-ref history position)))
+ #f))
(define (history-down)
(if (>= position 0)
@@ -76,7 +82,8 @@
(gtk-entry-set-text entry
(if (>= position 0)
(list-ref history position)
- non-history-line)))))
+ non-history-line)))
+ #f))
(gtk-signal-connect entry
"key-press-event"
@@ -91,7 +98,8 @@
history-down)
(else #f)))
(if callback
- (gtk-signal-emit-stop-by-name entry
"key-press-event")))))
+ (gtk-signal-emit-stop-by-name entry
"key-press-event")
+ #f))))
(add-hook! (entry-new-read-hook entry)
(lambda ()
@@ -100,6 +108,7 @@
(- (length history) position)
position))
(saved-non-history-line non-history-line))
+ (set! position -1)
(set! handler
(lambda ()
(set! handler saved-handler)
--- /home/neil/guile-gui-0.2/event-loop.scm 2001-03-09 13:15:14.000000000
+0000
+++ /home/neil/guile-gui-head/event-loop.scm 2007-02-22 21:21:27.608712048
+0000
@@ -10,7 +10,7 @@
(define (event-loop)
(let ((c callback))
(set! callback #f)
- (if c (c)))
+ (if c (c) #f))
(gtk-main-iteration)
(event-loop))
- Re: entries and guile-gui, (continued)
- Re: entries and guile-gui, Kevin Ryde, 2007/02/21
- Re: entries and guile-gui, Kevin Ryde, 2007/02/21
- Re: entries and guile-gui, Neil Jerram, 2007/02/22
- Re: entries and guile-gui, Neil Jerram, 2007/02/22
- Re: entries and guile-gui, Neil Jerram, 2007/02/22
- Re: entries and guile-gui, Neil Jerram, 2007/02/24
- Re: entries and guile-gui, Kevin Ryde, 2007/02/25
- Re: entries and guile-gui, Neil Jerram, 2007/02/26
- Re: entries and guile-gui, Kevin Ryde, 2007/02/26
- Re: entries and guile-gui, Neil Jerram, 2007/02/28
- Re: entries and guile-gui,
Neil Jerram <=