From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#13887: 24.3; doc-view will render blurry images when image-magick is available Date: Mon, 11 Mar 2013 21:27:16 +0100 Message-ID: <87zjy9vg0r.fsf@thinkpad.tsdh.de> References: <8762153qc8.fsf@thinkpad.tsdh.de> <8762143co6.fsf@thinkpad.tsdh.de> <877glkgvqj.fsf@thinkpad.tsdh.de> <87txonw6ev.fsf@thinkpad.tsdh.de> <87sj46493q.fsf@thinkpad.tsdh.de> <877gle1etb.fsf@thinkpad.tsdh.de> <838v5tx4av.fsf@gnu.org> <87txohx0g0.fsf@thinkpad.tsdh.de> <831ubllqr0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363033702 5318 80.91.229.3 (11 Mar 2013 20:28:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Mar 2013 20:28:22 +0000 (UTC) Cc: 13887@debbugs.gnu.org, esabof@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 11 21:28:42 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UF9Kl-0006ER-OF for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Mar 2013 21:28:35 +0100 Original-Received: from localhost ([::1]:33983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF9KP-0006vK-Hv for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Mar 2013 16:28:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF9KL-0006u7-E6 for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2013 16:28:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UF9KI-0006eU-Hn for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2013 16:28:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF9KI-0006eM-Du for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2013 16:28:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UF9LC-0000DT-0G for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2013 16:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2013 20:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13887-submit@debbugs.gnu.org id=B13887.1363033700782 (code B ref 13887); Mon, 11 Mar 2013 20:29:01 +0000 Original-Received: (at 13887) by debbugs.gnu.org; 11 Mar 2013 20:28:20 +0000 Original-Received: from localhost ([127.0.0.1]:46845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF9KU-0000CY-W9 for submit@debbugs.gnu.org; Mon, 11 Mar 2013 16:28:19 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52145) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF9KR-0000CO-GG for 13887@debbugs.gnu.org; Mon, 11 Mar 2013 16:28:16 -0400 Original-Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id E7B6520E4D; Mon, 11 Mar 2013 16:27:18 -0400 (EDT) Original-Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 11 Mar 2013 16:27:18 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:references:date :in-reply-to:message-id:mime-version:content-type; s=smtpout; bh=LopOLboUdVPsSX/3R5qWvrQrl3A=; b=IYf1wOhu8KYUiszEO4t9rsm5NRI+ rPY0QiRfjXZkdtg7a+3YNMm15KV6vwm7eCD84c7sqBWFkfksz3PmlrkL9mPHM3au qRezvbNcqdhf7ratOKpVugafd8d/wOpO1qXcigNNV/7f+3TkryTnrhneyK8viPcN oEqEFUI+874TPew= X-Sasl-enc: ceWn6FgvZE27SOQtr5ktILkZus9E9o2TQVNM5Vd/V+jH 1363033638 Original-Received: from thinkpad.tsdh.de (unknown [91.67.10.84]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D5AC20114F; Mon, 11 Mar 2013 16:27:17 -0400 (EDT) In-Reply-To: <831ubllqr0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Mar 2013 20:45:39 +0200") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72337 Archived-At: Eli Zaretskii writes: >> From: Tassilo Horn >> Cc: esabof@gmail.com, monnier@iro.umontreal.ca, 13887@debbugs.gnu.org >> Date: Mon, 11 Mar 2013 19:20:47 +0100 >> >> > doc-view-new-window-function seems to be run from a >> > window-configuration-change-hook, right? >> >> No, from `image-mode-new-window-functions'. The functions in there >> are run by `image-mode-winprops' if (and only if) there are no >> winprops set for the image and the current window. > > Maybe I'm missing something, but in image-mode.el: > > . image-mode-winprops is called by image-mode-reapply-winprops > > . image-mode-reapply-winprops is added by image-mode-setup-winprops > to window-configuration-change-hook > > Doesn't that mean what I said? Nearly, except that `image-mode-new-window-functions' are only run when they don't have an entry in `image-mode-winprops-alist'. >> Basically, this should only ever happen when there's a new window >> showing the buffer with the image. > > How's that ensured? Can you walk us through the relevant code? That's line 72 in image-mode.el: (let ((winprops (assq window image-mode-winprops-alist))) ;; For new windows, set defaults from the latest. (unless winprops (setq winprops (cons window (copy-alist (cdar image-mode-winprops-alist)))) (run-hook-with-args 'image-mode-new-window-functions winprops)) However, whenever the doc-view window is split (e.g., when a completion buffer pops up), the doc-view buffer is indeed shown in a new window. That's why `doc-view-new-window-function' is run more often than I expected originally. That also explains why there are often multiple overlays in the doc-view buffer. There's one overlay per window that has shown the buffer at least once. This allows that you can have 2 windows displaying the same doc-view buffer: one showing page X, and in the other you can switch to other pages without changing the other window. So the multiple overlays thingy is actually intended. But somewhere the logic goes wonky and we're acting on the wrong overlay. Bye, Tassilo