[Top][All Lists]

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

Re: HTML-Info design

From: Eli Zaretskii
Subject: Re: HTML-Info design
Date: Tue, 27 Jan 2015 20:15:42 +0200

> From: Lars Ingebrigtsen <address@hidden>
> Cc: address@hidden
> Date: Tue, 27 Jan 2015 12:26:48 +1100
> `font-at' doesn't seem to like to be called in buffers that aren't
> displayed in a window:
>   (with-temp-buffer
>     (insert (propertize "foo" 'face 'variable-pitch))
>     (font-at (point-min)))
> =>
> Debugger entered--Lisp error: (error "Specified window is not displaying the 
> current buffer")

Yes, you need to arrange for the buffer to be current and displayed in
the window you pass to the function.  See the function's doc string.

> shr uses temporary buffers to format various bits, so this doesn't seem
> to be a practical approach when determining the pixel widths of text.

You can invoke font-at on a string instead of buffer.

reply via email to

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