[ESS] cat a "\n" when ess-eval-visibly-p is nil?

Vitalie Spinu spinuvit.list at gmail.com
Fri Oct 21 11:12:12 CEST 2011


Hi Matt,

> Pardon my extreme ignorance of the inner
> workings of emacs, but do I put this code in my .emacs or where?

Indeed you have to put it after (load "ess-site.el") in your .emacs file.

Vitalie.
>
> Matt
> On 10/20/2011 12:47 PM, Vitalie Spinu wrote:
>>
>> Here is how to do it if you are not using ess-tracebug:
>>
>> (defun inferior-ess-output-filter (proc string)
>>   (let ((pbuf (process-buffer proc))
>>         (pmark (process-mark proc))
>>         (prompt-regexp "^>\\( [>+]\\)*\\( \\)$")
>>         (prompt-replace-regexp "^>\\( [>+]\\)*\\( \\)[^>+\n]"))
>>     (setq string (replace-regexp-in-string prompt-replace-regexp " \n"
>> string nil nil 2))
>>     (with-current-buffer pbuf
>>       (goto-char pmark)
>>       (beginning-of-line)
>>       (when (looking-at prompt-regexp)
>>         (goto-char pmark)
>>         (insert "\n")
>>         (set-marker pmark (point)))
>>       ))
>>   (comint-output-filter proc (inferior-ess-strip-ctrl-g string)))
>>
>> This is R specific and might interfere with other languages.
>>
>> Cheers,
>> Vitalie.
>



More information about the ESS-help mailing list