[climacs-devel] Isearch feedback

John Q Splittist splittist at yahoo.com
Sun May 1 17:41:01 UTC 2005


Hi,

To celebrate getting climacs to run (openmcl 0.14.3, clx) I had a go at 
adding some minibuffer feedback for the Isearch functions. A diff is 
attached.

Some questions:

1. Is this actually a useful thing for me to do?

2. Is this the right form of diff?

3. Is (display-message ..) the way to go for this kind of thing? (It 
almost seems too easy...)

Loading an edited gui file into a running climacs and seeing the changes 
instantly (or as close to instantly as climacs gets, these days) is very 
cool!

cheers,
JQS

--- gui.lisp.~1.128.~   Sat Mar 19 22:08:31 2005
+++ gui.lisp    Sun May  1 17:23:22 2005
@@ -1086,6 +1086,7 @@
                (offset mark) (if forwardp
                                  (- (offset mark2) (length string))
                                  (+ (offset mark2) (length string)))))
+      (display-message "~:[Failing ~;~]Isearch~:[ backward~;~]: ~A" 
success forwardp string)
        (push (make-instance 'isearch-state
                             :search-string string
                             :search-mark mark
@@ -1096,9 +1097,11 @@
          (beep)))))

  (define-named-command com-isearch-mode-forward ()
+  (display-message "Isearch: ")
    (isearch-command-loop (current-window) t))

  (define-named-command com-isearch-mode-backward ()
+  (display-message "Isearch backward: ")
    (isearch-command-loop (current-window) nil))

  (define-named-command com-isearch-append-char ()
@@ -1116,7 +1119,8 @@
  (define-named-command com-isearch-delete-char ()
    (let* ((pane (current-window)))
      (cond ((null (second (isearch-states pane)))
-           (beep))
+           (display-message "Isearch: ")
+          (beep))
            (t
             (pop (isearch-states pane))
             (loop until (endp (rest (isearch-states pane)))
@@ -1128,7 +1132,10 @@
                         (+ (offset (search-mark state))
                            (length (search-string state)))
                         (- (offset (search-mark state))
-                          (length (search-string state))))))))))
+                          (length (search-string state)))))
+            (display-message "Isearch~:[ backward~;~]: ~A"
+                             (search-forward-p state)
+                             (search-string state)))))))

  (define-named-command com-isearch-forward ()
    (let* ((pane (current-window))





More information about the climacs-devel mailing list