summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/subr-x.el3
1 files changed, 1 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index f336799040f..b2dae564c2b 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -446,8 +446,7 @@ is inserted before adjusting the number of empty lines."
"Return the width of STRING in pixels."
(with-temp-buffer
(insert string)
- (car (window-text-pixel-size
- (current-buffer) (point-min) (point)))))
+ (car (buffer-text-pixel-size nil nil t))))
;;;###autoload
(defun string-glyph-split (string)