[ESS-bugs] ess-mode 5.3.0; comint-prompt-regexp follow-up

A.J. Rossini blindglobe at gmail.com
Mon Dec 10 17:21:51 CET 2007


On 12/10/07, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
> >>>>> "t" == tyler  <tyler.smith at mail.mcgill.ca>
> >>>>>     on Mon, 10 Dec 2007 14:02:59 -0400 writes:
>
>    t> This is a follow up to a previous message. Since I can't
>    t> subscribe to the mailing list, there appears to be no way
>    t> of replying to a particular message.
>
> well, you could (and should) have replied to Tony's answer which *was* CC'ed
> to you...
>
>    t> I don't know how Emacs communicates with inferior
>    t> processes, so I don't know how to implement the changes
>    t> that were suggested by Tony Rossini. However, I read
>    t> through the info files regarding debug and browser
>    t> commands in ESS, and it appears that comint-prompt-regexp
>    t> needs to match lines like:
>
>    t> Browser[1]>
>
> In R, that's   "Browse[1]> "  but that's not important
>
> The really important thing I have found out in the mean time
> (since my last e-mail on this, less than an hour ago):
> When you are inside the debugger i.e., browser,
> the "prompt" option is *not* modified,
> and hence the whole idea of Tony --- which I've finished
> implementing in the mean time --- of looking up
> options("prompt") and options("continue") dynamically,
> breaks down as soon as you are debug()ging a function, something
> I (and Kurt, I assume) do quite frequently.
>
> ==> Indeed,
>  1) "Browse[1]> " needs to be matched by the regexp
>  2) it cannot be determined via options("prompt")
>
> Hence I think we have to "bury"  Tony's proposal
> and go with (a version of) Tyler's proposed amendment below.
>
> One alternative might be to
> add "Browse\[[0-9]+\]" explicitly to the options("prompt")
> result, but I think that's a kludge we'd not really prefer...
>
> What do you think, Tony?
>
>    t> as well as the usual:
>    >>
>    t> +
>
>    t> The current value of comint-regexp-prompt generated for R
>    t> processes will match all of these, but as designed will
>    t> also match:
>
>    t> Browser[1]Browser[1]Browser[1]>
>
>
>    t> Is this necessary? If not, changing comint-regexp-prompt to
>
>    t> "^\\(\\([A-Z][][A-Za-z0-9.]*\\)?> \\|+ ?\\)"
>    t>                                ^
>    t> Will match all three possible expressions, and doesn't hang on long
>    t> output. If duplicated prefix strings do occur, perhaps the search
>    t> could be limited with a \{0,N\} construct in place of the first ?, with
>    t> N set to some reasonable upper limit.
>
> That's a good suggestion.  What do others think?
>
>    t> I don't know if it makes any differences to the efficiency of the
>    t> regexp, but as far as I can tell the outermost grouping is not used,
>    t> so the regexp could be reduced to
>
>    t> "^\\([A-Z][][A-Za-z0-9.]*\\)?> \\|+ ?"
>
> Are you sure?  Would this really match "^+ ?" as well ?
> I'd rather keep that part just for clarity.
>
>
>    t> The relevant line in the source code is L79 of essd-r.el:
>    t> (inferior-ess-primary-prompt     . "\\([A-Z][][A-Za-z0-9.]*\\)*> ")
>
>    t> Please let me know if this is helpful. I enjoy working with regexps,
>    t> and I'm eager to learn more elisp, so if I'm pointed in the right
>    t> direction I'm happy to contribute.
>
> Thanks;
> you *have* already contributed.
>
>
> ESS-core,  what about  letting  Tyler subscribe to ESS-bugs
> (which has been a closed list, open to ESS-core only till now),
> so he could contribute even more ?


My answer might've been zapped by the bad email address, tyler never
got the first version.

I'd be very happy to subscribe tyler to ESS-core.  Nothing like a
solid contrib to justify access (eh, Stephen and Rodney?).

Give a person ESS, satisfy him for a while.  Give him write access to
the repo, frustrate him forever.

Nice bit of work, folks -- I'm not clear on the right way, R-style to
handle the prompt.  My suggestion was based on intuition, not hard
facts, but both of you have done a nice job following through on it.
Maybe I'm becoming a half-decent manager.

best,
-tony

blindglobe at gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we
can easily roll-back your mistakes" (AJR, 4Jan05).

Drink Coffee:  Do stupid things faster with more energy!



More information about the ESS-bugs mailing list