Windows 7 Emacs 24.5
1.通过M-x shell打开外壳。
2.做一些命令。
答案 0 :(得分:1)
运行emacs功能" erase-buffer"清除缓冲区。
您可以绑定一个功能键来清除缓冲区:
(global-set-key (kbd "<f10>")
(lambda ()
(interactive)
(erase-buffer)
(process-send-string nil "\n")))
答案 1 :(得分:0)
这也有效:
;; 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")))