From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112045: * doc-view.el Fix bug#13887. Date: Mon, 18 Mar 2013 20:50:34 +0100 Message-ID: <87vc8o1o8l.fsf@thinkpad.tsdh.de> References: <874ng9cfwl.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363636310 27629 80.91.229.3 (18 Mar 2013 19:51:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Mar 2013 19:51:50 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 18 20:52:16 2013 Return-path: Envelope-to: ged-emacs-devel@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 1UHg6P-0001LD-8Z for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2013 20:52:13 +0100 Original-Received: from localhost ([::1]:46354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHg62-0006iv-9e for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2013 15:51:50 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHg4s-0004xY-QV for emacs-devel@gnu.org; Mon, 18 Mar 2013 15:50:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHg4r-00065j-CB for emacs-devel@gnu.org; Mon, 18 Mar 2013 15:50:38 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHg4r-00065W-4j for emacs-devel@gnu.org; Mon, 18 Mar 2013 15:50:37 -0400 Original-Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 874C32016C for ; Mon, 18 Mar 2013 15:50:36 -0400 (EDT) Original-Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 18 Mar 2013 15:50:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:references:date :in-reply-to:message-id:mime-version:content-type; s=smtpout; bh=Zot0DbfXezmTQwDgd6WL5iiMzfg=; b=ZAeNj+CFVN3fwb8FoWlCntb/KBVr VJU8ochnXia0O2qcj4OttyPr99fls5Jhg+LuLkE+TpYUcIuxJkuplW+7451hcOOi IbH/89cYj9oQBLyiThFLQkIBN/MeC3D8HDi4RfgxAlPh6MDJb9qK0NXo1CY1hP9q kXNzl83LCUC3bXM= X-Sasl-enc: 0HPFOMl9xaPavMobj+fjZzOoUrVAletpTVbnimgtMQa5 1363636236 Original-Received: from thinkpad.tsdh.de (unknown [91.67.10.84]) by mail.messagingengine.com (Postfix) with ESMTPA id EF87AC80E8C for ; Mon, 18 Mar 2013 15:50:35 -0400 (EDT) Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Mon, 18 Mar 2013 09:23:44 -0400") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157930 Archived-At: Stefan Monnier writes: >>>> + ;; We're not already displaying an image, so this is the >>>> + ;; initial window showing the document. >>>> + (run-with-timer nil nil >>>> + (lambda () >>>> + ;; In case a conversion is running, the >>>> + ;; refresh will happen as defined by >>>> + ;; `doc-view-conversion-refresh-interval'. >>>> + (unless doc-view-current-converter-processes >>>> + (with-selected-window (car winprops) >>>> + (doc-view-goto-page 1))))) >>> I don't understand the scenario in which this doc-view-goto-page would >>> be needed. >> This is the case where the document is initially shown in a window. > > I must admit I do not know what you mean precisely with the above > sentence. I mean, the code above runs only when the doc-view buffer is shown for the very first time in some window. >> My change to `doc-view-insert-image' prevents insertion of image data >> if the window isn't shown, > > Do you mean "if the window is not *live*" or "if the *buffer* isn't > shown"? If the window associated with the current doc-view overlay isn't live. See line 1273. >> and here the `doc-view-goto-page' call will do just that. > > But between the moment you checked window-live-p and the moment you run > the above timer, if the buffer ends up displayed, there must have been > an operation that ran window-configuration-change-hook. > > So IIUC this doc-view-goto-page shouldn't be required because the > window-configuration-change-hook should have caused an equivalent > doc-view-goto-page already. window-configuration-change-hook runs image-mode-reapply-winprops, but at that point in time, there's no winprops entry for that window. However, image-mode-reapply-winprops calls image-mode-winprops, and that runs image-mode-new-window-functions because of the missing winprops entry, and now we are in the situation I handle with the code in question. Bye, Tassilo