Skip to content

julia-mode: Add space to prompt regexp#15135

Merged
yuyichao merged 1 commit intoJuliaLang:masterfrom
justbur:julia-mode-fix-prompt
Feb 18, 2016
Merged

julia-mode: Add space to prompt regexp#15135
yuyichao merged 1 commit intoJuliaLang:masterfrom
justbur:julia-mode-fix-prompt

Conversation

@justbur
Copy link
Copy Markdown
Contributor

@justbur justbur commented Feb 18, 2016

Fixes #14002

@yuyichao
Copy link
Copy Markdown
Contributor

LGTM, is there a way to test this other than checking for the content of julia-prompt-regexp?

@justbur
Copy link
Copy Markdown
Contributor Author

justbur commented Feb 18, 2016

I looked into the problem from that bug report a bit and the issue is related to emacs repositioning the cursor to the wrong place. For M-p to work the point has to be at the end of the buffer (after the space inserted by the command prompt), but the regexp used was telling comint that there is no space after the prompt. If you move the point one char to the right M-p works again because the point is in the right place.

Besides simulating the problem, I don't see an easy way to test this at the moment. We just want the output from the process, which does have the extra space, to be consistent with the regexp.

@justbur
Copy link
Copy Markdown
Contributor Author

justbur commented Feb 18, 2016

fwiw ess-julia uses this regexp "^\\w*> "

@yuyichao
Copy link
Copy Markdown
Contributor

I think julia-mode currently doesn't really support other REPL mode (help?>, shell>, etc) but using "^\\w*> " should be better anyway.

@justbur
Copy link
Copy Markdown
Contributor Author

justbur commented Feb 18, 2016

ok, let me change it

On Thu, Feb 18, 2016 at 12:48 PM Yichao Yu notifications@github.com wrote:

I think julia-mode currently doesn't really support other REPL mode (
help?>, shell>, etc) but using "^\w*> " should be better anyway.


Reply to this email directly or view it on GitHub
#15135 (comment).

Fixes JuliaLang#14002

The primary problem was the lack of a space at the end of the regexp,
which didn't match the output of the shell process (does have a space).
This meant that emacs sometimes placed the point one character before
the end of the buffer, which prevented M-p from working.

This new regexp also allows for other prompts, such as "shell> "
@justbur justbur force-pushed the julia-mode-fix-prompt branch from 970242f to 400710c Compare February 18, 2016 17:55
@justbur
Copy link
Copy Markdown
Contributor Author

justbur commented Feb 18, 2016

ok, I fixed it. I just amended the commit. Hope that's ok

On Thu, Feb 18, 2016 at 12:49 PM Justin Burkett justin@burkett.cc wrote:

ok, let me change it

On Thu, Feb 18, 2016 at 12:48 PM Yichao Yu notifications@github.com
wrote:

I think julia-mode currently doesn't really support other REPL mode (
help?>, shell>, etc) but using "^\w*> " should be better anyway.


Reply to this email directly or view it on GitHub
#15135 (comment).

@yuyichao
Copy link
Copy Markdown
Contributor

I just amended the commit

Yep, this is the preferred way of updating a pull request.

yuyichao added a commit that referenced this pull request Feb 18, 2016
julia-mode: Add space to prompt regexp
@yuyichao yuyichao merged commit 7220389 into JuliaLang:master Feb 18, 2016
@yuyichao
Copy link
Copy Markdown
Contributor

Verified locally that this works. If someone can come up with an easy way to test this against the output of the julia REPL we can always add it later =).

@justbur
Copy link
Copy Markdown
Contributor Author

justbur commented Feb 18, 2016

Sounds good. Thanks

On Thu, Feb 18, 2016 at 1:01 PM Yichao Yu notifications@github.com wrote:

Verified locally that this works. If someone can come up with an easy way
to test this against the output of the julia REPL we can always add it
later =).


Reply to this email directly or view it on GitHub
#15135 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants