Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.1052
diff -u -r1.1052 slime.el
--- slime.el	23 Oct 2008 21:28:12 -0000	1.1052
+++ slime.el	26 Oct 2008 14:48:17 -0000
@@ -3402,11 +3402,14 @@
   "Return the regexp for the navigation commands."
   (cond ((slime-repl-history-search-in-progress-p)
          slime-repl-history-pattern)
-        (use-current-input
-         (let ((str (slime-repl-current-input)))
-           (cond ((string-match "^[ \n]*$" str) nil)
-                 (t (concat "^" (regexp-quote str))))))
-        (t nil)))
+        ((not use-current-input) nil)
+        ((<= (point) slime-repl-input-start-mark)
+         (slime-repl-current-input))
+        (t
+         (let ((str (buffer-substring-no-properties
+                     slime-repl-input-start-mark (point))))
+              (cond ((string-match "^[ \n]*$" str) nil)
+                    (t (concat "^" (regexp-quote str))))))))
 
 (defun slime-repl-delete-from-input-history (string)
   "Delete STRING from the repl input history. 
