branch: elpa/geiser-racket commit 0be179750132152e4f04354d28fc8376c6011f1f Author: Jose Antonio Ortega Ruiz <j...@gnu.org> Commit: Jose Antonio Ortega Ruiz <j...@gnu.org>
A better solution to the funky filename problem So, the problem was that our regexp for a Racket prompt didn't take into account that filenames could contain white spaces: "@[^ ]*> ". A simple solution was accepting them: "@[^>]+> " won't work because '>' is also a valid character in filenames, so we went for "@.*> ". The drawback is that finding the beginning of the prompt (e.g. in C-a) fails when you're writing things like: racket@foo bar.rkt> (> 2 3) because here comint believes that the prompt is "racket@foo bar.rkt> (> " And that could have side-effects elsewhere. So what i've done is simply changing the way white-space is (not) printed in the prompt, substituting it by underscores. That way, whe can go back to the initial regexp, comint doesn't get confused, and users can easily infer that "@foo_bar.rkt>" is actually referring to their "foo bar.rkt" file. --- elisp/geiser-racket.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index 1c36877..24712bd 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -97,7 +97,7 @@ This function uses `geiser-racket-init-file' if it exists." ,@(and init-file (file-readable-p init-file) (list "-f" init-file)) "-f" ,(expand-file-name "geiser/startup.rkt" rackdir)))) -(defconst geiser-racket--prompt-regexp "\\(mzscheme\\|racket\\)@.*> ") +(defconst geiser-racket--prompt-regexp "\\(mzscheme\\|racket\\)@[^ ]*> ") (defun geiser-racket--startup (remote) (if geiser-image-cache-dir