branch: externals/transient commit 3e43f1fd90c2c4d2e752481f3955d3699b6f65a7 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient--pixel-width: Move definition --- lisp/transient.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 4f04cb958f..e771e7e7ce 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3416,15 +3416,6 @@ have a history of their own.") (when (= c (1- cs)) (insert ?\n)))))))) -(defun transient--pixel-width (string) - (save-window-excursion - (with-temp-buffer - (insert string) - (set-window-dedicated-p nil nil) - (set-window-buffer nil (current-buffer)) - (car (window-text-pixel-size - nil (line-beginning-position) (point)))))) - (cl-defmethod transient--insert-group ((group transient-subgroups)) (let* ((subgroups (oref group suffixes)) (n (length subgroups))) @@ -3674,6 +3665,15 @@ If the OBJ's `key' is currently unreachable, then apply the face (oset suffix key (truncate-string-to-width (oref suffix key) width nil ?\s)))))) +(defun transient--pixel-width (string) + (save-window-excursion + (with-temp-buffer + (insert string) + (set-window-dedicated-p nil nil) + (set-window-buffer nil (current-buffer)) + (car (window-text-pixel-size + nil (line-beginning-position) (point)))))) + (defun transient-command-summary-or-name (obj) "Return the summary or name of the command represented by OBJ.