Function: eca-chat--string-pixel-width

eca-chat--string-pixel-width is a natively compiled function defined in eca-chat.el.

Signature

(eca-chat--string-pixel-width STRING)

Documentation

Return the rendered pixel width of STRING for mode-line alignment.

Honors display specs (e.g. the context bar's pixel-width spaces) and wide glyphs, unlike length. Uses string-pixel-width when available, falling back to string-width on Emacsen without it.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
(defun eca-chat--string-pixel-width (string)
  "Return the rendered pixel width of STRING for mode-line alignment.
Honors `display' specs (e.g. the context bar's pixel-width spaces) and
wide glyphs, unlike `length'.  Uses `string-pixel-width' when
available, falling back to `string-width' on Emacsen without it."
  (cond
   ((string-empty-p string) 0)
   ((fboundp 'string-pixel-width) (string-pixel-width string))
   (t (string-width string))))