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 (point))))
    (when (numberp next-line-prefix)
      ;; Set a minimum width for the prefix so it lines up correctly
      ;; with subsequent lines.  Make sure not to do this past the end
      ;; of the line though!  (`fill-match-adaptive-prefix' could
      ;; potentially return a prefix longer than the current line in the
      ;; buffer.)
      (add-display-text-property
       (point) (min (+ (point) (length first-line-prefix))
                     (pos-eol))
       'min-width `((,next-line-prefix . width))))
    (setq next-line-prefix (visual-wrap--adjust-prefix next-line-prefix))
    (put-text-property
     (point) (pos-eol) 'wrap-prefix
     (if (numberp next-line-prefix)
         `(space :align-to (,next-line-prefix . width))
       next-line-prefix))))