Function: transient--string-pixel-width

transient--string-pixel-width is a byte-compiled function defined in transient.el.

Signature

(transient--string-pixel-width STRING)

Source Code

;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
(static-if (fboundp 'string-pixel-width) ; since Emacs 29.1
    (defalias 'transient--string-pixel-width #'string-pixel-width)
  ;; c22b735f0c6 and 61c254cafc9 cannot be backported.  Some later
  ;; commits could be ported, but users should instead update Emacs.
  (defun transient--string-pixel-width (string)
    (with-temp-buffer
      (insert string)
      (save-window-excursion
        (set-window-dedicated-p nil nil)
        (set-window-buffer nil (current-buffer))
        (car (window-text-pixel-size
              nil (line-beginning-position) (point)))))))