Function: term-erase-in-display

term-erase-in-display is a byte-compiled function defined in term.el.gz.

Signature

(term-erase-in-display KIND)

Documentation

Erase (that is blank out) part of the window.

If KIND is 0, erase from point to point-max; if KIND is 1, erase from home to point; else erase from home to point-max.

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
(defun term-erase-in-display (kind)
  "Erase (that is blank out) part of the window.
If KIND is 0, erase from point to point-max;
if KIND is 1, erase from home to point; else erase from home to point-max."
  (term-handle-deferred-scroll)
  (cond ((eq kind 0)
	 (let ((need-unwrap (bolp)))
	   (delete-region (point) (point-max))
	   (when need-unwrap (term-unwrap-line))))
	((let ((row (term-current-row))
	      (col (term-horizontal-column))
	      (start-region term-home-marker)
	      (end-region (if (eq kind 1) (point) (point-max))))
	   (delete-region start-region end-region)
	   (term-unwrap-line)
	   (when (eq kind 1)
	     (term-insert-char ?\n row))
	   (setq term-current-column nil)
	   (setq term-current-row nil)
	   (term-goto row col)))))