Function: term-insert-spaces

term-insert-spaces is a byte-compiled function defined in term.el.gz.

Signature

(term-insert-spaces COUNT)

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
;; Insert COUNT spaces after point, but do not change any of
;; following screen lines.  Hence we may have to delete characters
;; at the end of this screen line to make room.

(defun term-insert-spaces (count)
  (let ((save-point (point)) (save-eol) (pnt-at-eol))
    (term-vertical-motion 1)
    (when (bolp)
      (backward-char))
    (setq save-eol (point)
          pnt-at-eol (line-end-position))
    (move-to-column (+ (term-start-line-column) (- term-width count)) t)
    ;; If move-to-column extends the current line it will use the face
    ;; from the last character on the line, set the face for the chars
    ;; to default.
    (when (>= (point) pnt-at-eol)
      (put-text-property pnt-at-eol (point) 'font-lock-face 'default))
    (when (> save-eol (point))
      (delete-region (point) save-eol))
    (goto-char save-point)
    (term-insert-char ?  count)
    (goto-char save-point)))