Как заставить ESS распознавать динамическую подсказку в R?

Я последовал предложению здесь... R: Показать time clock в командной строке R, чтобы в приглашении R отображалось время последнего ввода команды. Но теперь M-r и M-p не работают, потому что ESS больше не распознает мою постоянно меняющуюся командную строку как начало командной строки.

Кто-нибудь знает, какую опцию изменить, чтобы для всех целей, где должно быть обнаружено приглашение, вместо того, чтобы сопоставлять всю строку приглашения, ESS сопоставлялся только с константой в конце или, что еще лучше, с регулярным выражением, например "^[0- 9]{6} [0-9]{2}:[0-9]{2} >"

Спасибо.


person bokov    schedule 06.03.2013    source источник
comment
Есть идеи, на что в данный момент смотрит ESS, чтобы идентифицировать подсказку? Я имею в виду, какой элемент внутри R представляет строку приглашения.   -  person Carl Witthoft    schedule 07.03.2013


Ответы (1)


Мой ess/ess-custom.el содержит следующие строки:

;; 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)

Поэтому я надеюсь, что настройка любой из этих переменных поможет. Вероятно, начиная с настраиваемого, то есть inferior-S-prompt.

person MvG    schedule 06.03.2013