[slime-devel] SLIME-repl input problems

Lynn Quam quam at ai.sri.com
Mon May 24 15:54:38 UTC 2004


I think the following change to the regular-expression in (looking-at
 ...)  fixes the problem:

(defun slime-input-complete-p (start end)
  "Return t if the region from START to END contains a complete sexp."
  (save-excursion
    (goto-char start)
    (cond ((looking-at "\\s *\\((\\|`\\|'\\|\"\\)")
           (ignore-errors
             (save-restriction
               (narrow-to-region start end)
               ;; Keep stepping over blanks and sexps until the end of
               ;; buffer is reached or an error occurs. Tolerate extra
               ;; close parens.
               (loop do (skip-chars-forward " \t\r\n)")
                     until (eobp)
                     do (forward-sexp))
               t)))
          (t t))))

This permits inputs starting with optional whitespace followed by one
of ( ` ' " (left-paren, back-quote, single-quote, double-quote).
There are probably some other constructs that should be handled
too, such as inputs starting with sharpsign reader macros.




More information about the slime-devel mailing list