Function: erc-fill--wrap-measure

erc-fill--wrap-measure is a byte-compiled function defined in erc-fill.el.gz.

Signature

(erc-fill--wrap-measure BEG END)

Documentation

Return display spec width for inserted region between BEG and END.

Ignore any invisible props that may be present when figuring. Expect the target region to be free of line-prefix and wrap-prefix properties, and expect display-line-numbers-mode(var)/display-line-numbers-mode(fun) to be disabled.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-fill.el.gz
(defun erc-fill--wrap-measure (beg end)
  "Return display spec width for inserted region between BEG and END.
Ignore any `invisible' props that may be present when figuring.
Expect the target region to be free of `line-prefix' and
`wrap-prefix' properties, and expect `display-line-numbers-mode'
to be disabled."
  (if (fboundp 'buffer-text-pixel-size)
      ;; `buffer-text-pixel-size' can move point!
      (save-excursion
        (save-restriction
          (narrow-to-region beg end)
          (let* ((buffer-invisibility-spec)
                 (rv (car (buffer-text-pixel-size))))
            (if erc-fill-wrap-use-pixels
                (if (zerop rv) 0 (list rv))
              (/ rv (frame-char-width))))))
    (- end beg)))