emacs-devel
[Top][All Lists]
Advanced

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

Re: HTML-Info design


From: Lars Ingebrigtsen
Subject: Re: HTML-Info design
Date: Tue, 27 Jan 2015 12:26:48 +1100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

`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")
  font-at(1)
  (progn (insert "foo") (font-at (point-min)))
  (unwind-protect (progn (insert "foo") (font-at (point-min))) (and 
(buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert 
"foo") (font-at (point-min))) (and (buffer-name temp-buffer) (kill-buffer 
temp-buffer))))

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.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



reply via email to

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