Function: shr-fill-text

shr-fill-text is a byte-compiled function defined in shr.el.gz.

Signature

(shr-fill-text TEXT)

Source Code

;; Defined in /usr/src/emacs/lisp/net/shr.el.gz
(defun shr-fill-text (text)
  (if (zerop (length text))
      text
    (with-temp-buffer
      (let ((shr-indentation 0)
	    (shr-start nil)
	    (shr-internal-width (- (window-body-width nil t)
                                   (* 2 (frame-char-width))
                                   ;; Adjust the window width for when
                                   ;; the user disables the fringes,
                                   ;; which causes the display engine
                                   ;; to usurp one column for the
                                   ;; continuation glyph.
                                   (if (and (null shr-width)
                                            (not (shr--have-one-fringe-p)))
                                       (* (frame-char-width) 2)
                                     0))))
	(shr-insert text)
	(shr-fill-lines (point-min) (point-max))
	(buffer-string)))))