2013-03-06 30 views
2

我按照這裏的建議... R: Display a time clock in the R command line使我的R提示符顯示上一次輸入命令時。但是現在M-rM-p被破壞,因爲ESS不再識別我作爲命令行開始的不斷變化的命令提示符。如何讓ESS識別R中的動態提示?

是否有人知道要更改什麼選項,以便對於必須檢測到提示而不是匹配整個提示字符串的所有目的,ESS將匹配它的常量尾部,或更好地匹配「^[0-9] {6} [0-9] {2}:[0-9] {2}>「

謝謝。

+0

任何想法什麼'ESS'目前正在尋找以確定提示?我的意思是'R'裏代表提示字符串的項目。 – 2013-03-06 21:00:44

回答

0

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