diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/subr-x.el | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index f2060814f25..00668d47439 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -446,13 +446,8 @@ is inserted before adjusting the number of empty lines." "Return the width of STRING in pixels." (with-temp-buffer (insert string) - (save-window-excursion - ;; Avoid errors if the selected window is a dedicated one, - ;; and they just want to insert a document into it. - (set-window-dedicated-p nil nil) - (set-window-buffer nil (current-buffer)) - (car (window-text-pixel-size - nil (line-beginning-position) (point)))))) + (car (window-text-pixel-size + (current-buffer) (point-min) (point))))) (provide 'subr-x) |