Function: visual-wrap--content-prefix

visual-wrap--content-prefix is a byte-compiled function defined in visual-wrap.el.gz.

Signature

(visual-wrap--content-prefix PREFIX)

Documentation

Get the next-line prefix for the specified first-line PREFIX.

This returns a string prefix to use for subsequent lines; a number, indicating the pixel width to use for whitespace alignment; or nil if PREFIX was empty.

Source Code

;; Defined in /usr/src/emacs/lisp/visual-wrap.el.gz
(defun visual-wrap--content-prefix (prefix)
  "Get the next-line prefix for the specified first-line PREFIX.

This returns a string prefix to use for subsequent lines; a number,
indicating the pixel width to use for whitespace alignment; or nil if
PREFIX was empty."
  (cond
   ((string= prefix "")
    nil)
   ((or (and adaptive-fill-first-line-regexp
             (string-match adaptive-fill-first-line-regexp prefix))
        (and comment-start-skip
             (string-match comment-start-skip prefix)))
    ;; If we want to repeat the first-line prefix on subsequent lines,
    ;; return its string value.  However, we remove any `wrap-prefix'
    ;; property that might have been added earlier.  Otherwise, we end
    ;; up with a string containing a `wrap-prefix' string containing a
    ;; `wrap-prefix' string...
    (remove-text-properties 0 (length prefix) '(wrap-prefix) prefix)
    prefix)
   (t
    ;; Whitespace continuation: return the natural pixel width of the
    ;; first-line prefix.  Using `string-pixel-width' (rather than a
    ;; character count) accounts for any display transformation applied
    ;; to the prefix: invisibility, `display' replacements (e.g. icons,
    ;; `display ""'), text scaling, proportional fonts.  Continuation
    ;; lines then align with whatever line 1 actually renders.
    (string-pixel-width prefix (current-buffer)))))