Function: term--unwrap-visible-long-lines

term--unwrap-visible-long-lines is a byte-compiled function defined in term.el.gz.

Signature

(term--unwrap-visible-long-lines WIDTH)

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
(defun term--unwrap-visible-long-lines (width)
  ;; Unwrap lines longer than width using fake newlines.  Only do it
  ;; for lines that are currently visible (i.e. following the home
  ;; marker).  Invisible lines don't have to be unwrapped since they
  ;; are unreachable using the cursor movement anyway.  Not having to
  ;; unwrap the entire buffer means the runtime of this function is
  ;; bounded by the size of the screen instead of the buffer size.

  (save-excursion
    ;; We will just assume that our accounting for the home marker is
    ;; correct, i.e. programs will not try to reach any position
    ;; earlier than this marker.
    (goto-char term-home-marker)

    (move-to-column width)
    (while (not (eobp))
      (if (eolp)
          (forward-char)
        (let ((inhibit-read-only t))
          (term-unwrap-line)))
      (move-to-column width))))