Now it works in "emacs -Q", but not with my configuration. To be honest I don't think it's worth coding something final on top of current image-mode's API - it looks under-developed at several points. a) Is all the "window t" stuff necessary? Does anyone really care what is "shown" in a buffer unless it's displayed in a window? b) If yes, should "window t" be passed to a public hook? c) Does (image-get-display-property) have any business asking what buffer is currently selected in the window? d) Why data is sometimes retrieved from the the buffer (as in ( image-get-display-property)), and sometimes from image-mode-winprops-alist (as in (image-mode-winprops))? Is the complexity justified, or is one of the methods "legacy"? I use image viewers, so I could try re-factoring it, adding H/V centering, improving zooming options, and extending the API. Evgeni On Thu, Mar 14, 2013 at 9:42 PM, Tassilo Horn wrote: > Tassilo Horn writes: > > Hi again, > > >> With this patch I don't get an overlay in the initial window, and > >> sometimes after splitting. > > > > Gosh, indeed! I'll look into that later. > > Ok, now I really think I've fixed it (revno 112045), although I had to > add some obscure code in `doc-view-new-window-function' which adds > functions doing a display refresh to a timer. If I execute the code of > these functions directly in `doc-view-new-window-function', I get Lisp > nesting exceeds `max-lisp-eval-depth' errors. > > Bye, > Tassilo >