[ESS-bugs] ess-mode 5.3.0; comint-prompt-regexp follow-up
tyler
tyler.smith at mail.mcgill.ca
Mon Dec 10 19:02:59 CET 2007
This is a follow up to a previous message. Since I can't subscribe to
the mailing list, there appears to be no way of replying to a
particular message.
I don't know how Emacs communicates with inferior processes, so I
don't know how to implement the changes that were suggested by Tony
Rossini. However, I read through the info files regarding debug and
browser commands in ESS, and it appears that comint-prompt-regexp
needs to match lines like:
Browser[1]>
as well as the usual:
>
+
The current value of comint-regexp-prompt generated for R processes
will match all of these, but as designed will also match:
Browser[1]Browser[1]Browser[1]>
Is this necessary? If not, changing comint-regexp-prompt to
"^\\(\\([A-Z][][A-Za-z0-9.]*\\)?> \\|+ ?\\)"
^
Will match all three possible expressions, and doesn't hang on long
output. If duplicated prefix strings do occur, perhaps the search
could be limited with a \{0,N\} construct in place of the first ?, with
N set to some reasonable upper limit.
I don't know if it makes any differences to the efficiency of the
regexp, but as far as I can tell the outermost grouping is not used,
so the regexp could be reduced to
"^\\([A-Z][][A-Za-z0-9.]*\\)?> \\|+ ?"
The relevant line in the source code is L79 of essd-r.el:
(inferior-ess-primary-prompt . "\\([A-Z][][A-Za-z0-9.]*\\)*> ")
Please let me know if this is helpful. I enjoy working with regexps,
and I'm eager to learn more elisp, so if I'm pointed in the right
direction I'm happy to contribute.
Thanks,
Tyler
Emacs : GNU Emacs 22.1.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2007-11-03 on pacem, modified by Debian
Package: ess-mode 5.3.0
current state:
==============
(setq
ess-language "S"
ess-dialect "R"
ess-ask-for-ess-directory t
ess-ask-about-transfile nil
ess-directory nil
ess-keep-dump-files "always"
ess-source-directory "/tmp/"
)
[ess-site.el]: ess-customize-alist=nil
[ess-site.el _2_]: ess-customize-alist=nil
(S): ess-s-versions-create making M-x defuns for (R): ess-r-versions-create making M-x defuns for [ess-site.el]: ess-customize-alist=nil
[ess-site.el _2_]: ess-customize-alist=nil
(S): ess-s-versions-create making M-x defuns for (R): ess-r-versions-create making M-x defuns for
(R): ess-dialect=nil, buf=*scratch*, start-arg=nil
current-prefix-arg=nil
(inferior-ess 0): ess-start-args=--no-readline
ess-setq-vars-default 0: ess-language=Initial, -dialect=nil, buf=nil, comint..echoes=nil, comint..sender=comint-simple-send
ess-setq-vars-default 1: ess-language=S, -dialect=R, buf=nil, comint..echoes=nil, comint..sender=comint-simple-send
(inf-ess 1): lang=S, dialect=R, tmp-dialect=R, buf=*scratch*
(inf-ess 1.1): procname=R temp-dialect=R, buf-name=*R*
(inferior-ess) Method #3 start=/home/tyler/rworkingdirectory/ buf=*R*
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=nil, comint..sender=comint-simple-send
(inf-ess 2.1): ess-language=S, ess-dialect=R buf=*R*
(inf-ess 2.2): start args = --no-readline , inf-ess-start-args=--no-readline
(inf-ess finish [S(R), R(nil,nil)]
(ess-multi 0): inf-ess-start-args=--no-readline , comint-..echoes=nil
(i-ess 1): buf=*R*, lang=S, comint..echo=nil, comint..sender=comint-simple-send,
(i-ess 2): buf=*R*, lang=S, comint..echo=t, comint..sender=inferior-R-input-sender,
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=inferior-R-input-sender
(i-ess 3): curr-buf=*R*, comint..echo=t, comint..sender=inferior-R-input-sender,
(ess-multi post inf-ess: start-args=--no-readline , comint-echoes=t
(ess-multi 1): start-args=--no-readline
Making Process...Buf *R*, Proc R, Prog R
Start File=nil, Args= --no-readline .
(R): inferior-ess-language-start=options(STERM='iESS', editor='emacsclient')
More information about the ESS-bugs
mailing list