Function: erc-fill--wrap-indent-prompt

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

Signature

(erc-fill--wrap-indent-prompt)

Documentation

Recompute the line-prefix of the prompt.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-fill.el.gz
(defun erc-fill--wrap-indent-prompt ()
  "Recompute the `line-prefix' of the prompt."
  ;; Clear an existing `line-prefix' before measuring (bug#64971).
  (remove-text-properties erc-insert-marker erc-input-marker
                          '(line-prefix nil wrap-prefix nil))
  ;; Restoring window configuration seems to prevent unwanted
  ;; recentering reminiscent of `scrolltobottom'-related woes.
  (let ((c (and (get-buffer-window) (current-window-configuration)))
        (len (erc-fill--wrap-measure erc-insert-marker erc-input-marker)))
    (when c
      (set-window-configuration c))
    (put-text-property erc-insert-marker erc-input-marker
                       'line-prefix
                       `(space :width (- erc-fill--wrap-value ,len)))))