[ESS] cat a "\n" when ess-eval-visibly-p is nil?
Matthew Landis
landis at isciences.com
Thu Oct 20 22:49:03 CEST 2011
Thanks for this Vitalie, and Feng for suggesting it. It has also been
bugging me for a long time. Pardon my extreme ignorance of the inner
workings of emacs, but do I put this code in my .emacs or where?
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