2

I followed the suggestion here... R: Display a time clock in the R command line to make my R prompt display the last time I entered in a command. But now M-r and M-p are broken because ESS is no longer recognizing my constantly-changing command prompt as the start of a command-line.

Does anybody know what option to change so that for all purposes where a prompt must be detected, instead of matching the whole prompt string, ESS will match just the constant tail end of it, or better yet, a regexp like "^[0-9]{6} [0-9]{2}:[0-9]{2} >"

Thanks.

Community
  • 1
  • 1
bokov
  • 3,444
  • 2
  • 31
  • 49
  • Any idea what `ESS` is currently looking at to identify the prompt? I mean what item inside `R` that is representing the prompt string. – Carl Witthoft Mar 06 '13 at 21:00

1 Answers1

0

My ess/ess-custom.el contains the following lines:

;; does it make sense to customize here, as we currently set this *directly*
;; in the FOO-BAR-cust-alist's ???
;; VS: Right. It only confuses users. It should be set in post-run-hook if
;; desired;  inferior-S-prompt should be customized instead.
(defvar inferior-ess-primary-prompt "> "
  "Regular expression used by `ess-mode' to detect the primary prompt.")

(make-variable-buffer-local 'inferior-ess-primary-prompt)
;; (setq-default inferior-ess-primary-prompt "> ")

(defvar inferior-ess-secondary-prompt nil
  "Regular expression used by ess-mode to detect the secondary prompt.
(This is issued by S to continue an incomplete expression).
Set to nil if language doesn't support secondary prompt.")
;; :group 'ess-proc
;; :type 'string)

(make-variable-buffer-local 'inferior-ess-secondary-prompt)
;; (setq-default inferior-ess-secondary-prompt "+ ")

;; need to recognise  + + + > > >
;; and "+ . + " in tracebug prompt
(defcustom inferior-S-prompt "[]a-zA-Z0-9.[]*\\([>+.] \\)*[+>] "
  "Regexp used in S and R inferior and transcript buffers for prompt navigation.

You can set it to \"[]a-zA-Z0-9.[]*\\(> \\)+\" if you want to
skip secondary prompt when invoking `comint-previous-prompt'.
 "
  :group 'ess-proc
  :type 'string)

So I'd hope that customizing either of these variables will help. Probably starting with the customizable one, i.e. inferior-S-prompt.

MvG
  • 57,380
  • 22
  • 148
  • 276