Reputation: 15664
Windows 7 Emacs 24.5
1.Open shell, by M-x shell.
2.Do some commands.
OK. Now I want to clear screen (in Windows consele this is a command "cls").
I want to get the next screen:
How I can do this in Emacs shell?
Upvotes: 1
Views: 797
Reputation: 15664
This also work:
;; clear content of buffer
(defun clear-buffer-permenantly ()
"Clear whole buffer, contents is not added to the kill ring"
(interactive)
(delete-region (point-min) (point-max))
)
(global-set-key (kbd "<f12>")
(lambda ()
(interactive)
(clear-buffer-permenantly)
(process-send-string nil "\n")))
Upvotes: 0
Reputation: 810
Run the emacs function "erase-buffer" to clear the buffer.
You could bind a function key to clear your buffer:
(global-set-key (kbd "<f10>")
(lambda ()
(interactive)
(erase-buffer)
(process-send-string nil "\n")))
Upvotes: 2