emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master c22b735: (string-pixel-width): Rewrite to avoid side effects


From: martin rudalics
Subject: Re: master c22b735: (string-pixel-width): Rewrite to avoid side effects
Date: Sat, 30 Oct 2021 09:50:44 +0200

>>      * src/xdisp.c (Fwindow_text_pixel_size): Allow `window` to be a buffer.
>>      * lisp/emacs-lisp/subr-x.el (string-pixel-width): Simplify accordingly.
>
> Bother: this doesn't make sure w->contents is the current buffer,
> which I think many display routines assume without checking (or barf
> if it isn't true).  So I think this is unsafe.

If WINDOW is a buffer (a not very tasteful and quite confusing idea
IMHO), 'window-text-pixel-size' will make that buffer current.  The
problem is rather that the window that function operates on usually does
not show WINDOW and I have no idea which implications that could have.

martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]