Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs ESS version of Clear Console

Tags:

Is there an ESS version of the Clear Console command that can be found in the RGui(Ctrl-L)?

I want to have a blank * R * buffer.

like image 299
Nathaniel Saxe Avatar asked Aug 10 '10 09:08

Nathaniel Saxe


2 Answers

From the EmacsWiki, this Elisp function works well for me:

(defun clear-shell ()
   (interactive)
   (let ((old-max comint-buffer-maximum-size))
     (setq comint-buffer-maximum-size 0)
     (comint-truncate-buffer)
     (setq comint-buffer-maximum-size old-max))) 

Put this in your ~/.emacs.d/init.el and execute with M-x clear-shell, or bind it to a key in your init.el with something like:

(global-set-key (kbd "\C-x c") 'clear-shell)

like image 59
Vince Avatar answered Oct 30 '22 21:10

Vince


Execute M-x comint-clear-buffer which is bound to C-c M-o

like image 41
mirkhosro Avatar answered Oct 30 '22 23:10

mirkhosro