Function: visual-wrap--apply-to-line

visual-wrap--apply-to-line is a byte-compiled function defined in visual-wrap.el.gz.

Signature

(visual-wrap--apply-to-line)

Documentation

Apply visual-wrapping properties to the logical line starting at point.

Source Code

;; Defined in /usr/src/emacs/lisp/visual-wrap.el.gz
(defun visual-wrap--apply-to-line ()
  "Apply visual-wrapping properties to the logical line starting at point."
  (when-let* ((first-line-prefix (fill-match-adaptive-prefix))
              (next-line-prefix (visual-wrap--content-prefix
                                 first-line-prefix)))
    (put-text-property
     (point) (pos-eol) 'wrap-prefix
     (if (numberp next-line-prefix)
         ;; Whitespace continuation: use a mixed-unit `:align-to' that
         ;; combines the pixel width from `visual-wrap--content-prefix'
         ;; with `visual-wrap-extra-indent' specified by the user in
         ;; canonical character widths.  The display engine resolves
         ;; each unit per the active frame and sums them.  If a large
         ;; negative `visual-wrap-extra-indent' makes the sum negative,
         ;; the display engine clamps the stretch width to zero
         ;; (xdisp.c), so the continuation starts at the left margin.
         `(space :align-to (+ (,next-line-prefix)
                              (,visual-wrap-extra-indent . width)))
       ;; String prefix (e.g. `> ', `;;; '): adjust for extra
       ;; indent in characters, then use the string directly.
       (visual-wrap--adjust-prefix next-line-prefix)))))