[climacs-cvs] CVS update: climacs/gui.lisp climacs/packages.lisp climacs/pane.lisp

Matthieu Villeneuve mvilleneuve at common-lisp.net
Sun Jan 30 22:17:33 UTC 2005


Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv30608

Modified Files:
	gui.lisp packages.lisp pane.lisp 
Log Message:
Fixed bad isearch behaviour when searching after a failure
Date: Sun Jan 30 14:17:31 2005
Author: mvilleneuve

Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.104 climacs/gui.lisp:1.105
--- climacs/gui.lisp:1.104	Sun Jan 30 11:56:53 2005
+++ climacs/gui.lisp	Sun Jan 30 14:17:30 2005
@@ -1031,7 +1031,8 @@
           (list (make-instance 'isearch-state
                                :search-string ""
                                :search-mark (clone-mark point)
-                               :search-forward-p forwardp)))
+                               :search-forward-p forwardp
+                               :search-success-p t)))
     (simple-command-loop 'isearch-climacs-table
                          (isearch-mode pane)
                          ((setf (isearch-mode pane) nil)))))
@@ -1047,18 +1048,19 @@
                              mark2
                              string
                              :test #'object-equal)))
-      (cond (success
-             (setf (offset point) (offset mark2)
-                   (offset mark) (if forwardp
-                                     (- (offset mark2) (length string))
-                                     (+ (offset mark2) (length string))))
-             (push (make-instance 'isearch-state
-                                  :search-string string
-                                  :search-mark mark
-                                  :search-forward-p forwardp)
-                   (isearch-states pane)))
-            (t
-             (beep))))))
+      (when success
+        (setf (offset point) (offset mark2)
+              (offset mark) (if forwardp
+                                (- (offset mark2) (length string))
+                                (+ (offset mark2) (length string)))))
+      (push (make-instance 'isearch-state
+                           :search-string string
+                           :search-mark mark
+                           :search-forward-p forwardp
+                           :search-success-p success)
+            (isearch-states pane))
+      (unless success
+        (beep)))))
 
 (define-named-command com-isearch-mode-forward ()
   (isearch-command-loop (current-window) t))
@@ -1084,6 +1086,9 @@
            (beep))
           (t
            (pop (isearch-states pane))
+           (loop until (endp (rest (isearch-states pane)))
+                 until (search-success-p (first (isearch-states pane)))
+                 do (pop (isearch-states pane)))
            (let ((state (first (isearch-states pane))))
              (setf (offset (point pane))
                    (if (search-forward-p state)


Index: climacs/packages.lisp
diff -u climacs/packages.lisp:1.43 climacs/packages.lisp:1.44
--- climacs/packages.lisp:1.43	Sun Jan 30 11:56:53 2005
+++ climacs/packages.lisp	Sun Jan 30 14:17:31 2005
@@ -111,7 +111,8 @@
            #:tab-space-count
            #:indent-tabs-mode
            #:auto-fill-mode #:auto-fill-column
-           #:isearch-state #:search-string #:search-mark #:search-forward-p
+           #:isearch-state #:search-string #:search-mark
+           #:search-forward-p #:search-success-p
            #:isearch-mode #:isearch-states #:isearch-previous-string
            #:query-replace-state #:string1 #:string2
            #:query-replace-mode


Index: climacs/pane.lisp
diff -u climacs/pane.lisp:1.15 climacs/pane.lisp:1.16
--- climacs/pane.lisp:1.15	Wed Jan 26 14:49:47 2005
+++ climacs/pane.lisp	Sun Jan 30 14:17:31 2005
@@ -142,7 +142,8 @@
 (defclass isearch-state ()
   ((search-string :initarg :search-string :accessor search-string)
    (search-mark :initarg :search-mark :accessor search-mark)
-   (search-forward-p :initarg :search-forward-p :accessor search-forward-p)))
+   (search-forward-p :initarg :search-forward-p :accessor search-forward-p)
+   (search-success-p :initarg :search-success-p :accessor search-success-p)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;




More information about the Climacs-cvs mailing list