Function: comint-truncate-buffer
comint-truncate-buffer is an interactive and byte-compiled function
defined in comint.el.gz.
Signature
(comint-truncate-buffer &optional STRING)
Documentation
Truncate the buffer to comint-buffer-maximum-size.
This function could be on comint-output-filter-functions or bound to a key.
Probably introduced at or before Emacs version 19.29.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint-truncate-buffer (&optional _string)
"Truncate the buffer to `comint-buffer-maximum-size'.
This function could be on `comint-output-filter-functions' or bound to a key."
(interactive)
(save-excursion
(goto-char (process-mark (get-buffer-process (current-buffer))))
(forward-line (- comint-buffer-maximum-size))
(beginning-of-line)
(let ((inhibit-read-only t))
(delete-region (point-min) (point)))))