From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14435: 24.3.50; Co-operation of doc-view + desktop-save-mode, save-place etc. Date: Sun, 26 May 2013 20:59:18 -0400 Message-ID: References: <87txlv7dyt.fsf@gmail.com> <878v34zkeu.fsf@thinkpad.tsdh.de> <87wqqo6mqz.fsf@thinkpad.tsdh.de> <87ip25tw56.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1369616409 7758 80.91.229.3 (27 May 2013 01:00:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 May 2013 01:00:09 +0000 (UTC) Cc: 14435-done@debbugs.gnu.org, Jambunathan K To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 27 03:00:07 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 1UglnD-0006iH-EU for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 May 2013 03:00:07 +0200 Original-Received: from localhost ([::1]:37591 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UglnC-0006VH-Sl for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 May 2013 21:00:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugln5-0006T0-VM for bug-gnu-emacs@gnu.org; Sun, 26 May 2013 21:00:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uglmz-0002i6-IF for bug-gnu-emacs@gnu.org; Sun, 26 May 2013 20:59:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uglmz-0002hp-FL for bug-gnu-emacs@gnu.org; Sun, 26 May 2013 20:59:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Uglo6-0004Of-DJ for bug-gnu-emacs@gnu.org; Sun, 26 May 2013 21:01:02 -0400 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 May 2013 01:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 14435 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 14435@debbugs.gnu.org, monnier@iro.umontreal.ca, kjambunathan@gmail.com Original-Received: via spool by 14435-done@debbugs.gnu.org id=D14435.136961644316856 (code D ref 14435); Mon, 27 May 2013 01:01:02 +0000 Original-Received: (at 14435-done) by debbugs.gnu.org; 27 May 2013 01:00:43 +0000 Original-Received: from localhost ([127.0.0.1]:35877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uglnn-0004Np-5i for submit@debbugs.gnu.org; Sun, 26 May 2013 21:00:43 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:33192) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uglnk-0004NX-SA for 14435-done@debbugs.gnu.org; Sun, 26 May 2013 21:00:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+Lc3/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFHO+Lc3/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="14537995" Original-Received: from 206-248-183-55.dsl.teksavvy.com (HELO pastel.home) ([206.248.183.55]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 26 May 2013 20:59:18 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 35590631DE; Sun, 26 May 2013 20:59:18 -0400 (EDT) In-Reply-To: <87ip25tw56.fsf@thinkpad.tsdh.de> (Tassilo Horn's message of "Sun, 26 May 2013 20:48:37 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) 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:74587 Archived-At: >> That was my main test case while writing the patch, so "it works for me". >> Could you give a detailed recipe? > Sure. > 1. emacs -Q > 2. C-x C-f some.pdf > conversion is done and I see the first page of the PDF > 3. k > 4. C-x C-f some.pdf > I only see the raw PDF contents > 5. > Now I see the image. Aha! Now I see it, and it seems like it's a long standing bug in image-mode.el. I installed the patch below which seems to fix this problem. It seems to also fix the scroll-bar-mode issue. Stefan --- lisp/image-mode.el 2013-05-24 17:42:23 +0000 +++ lisp/image-mode.el 2013-05-27 00:55:05 +0000 @@ -104,13 +104,16 @@ (defun image-mode-reapply-winprops () ;; When set-window-buffer, set hscroll and vscroll to what they were ;; last time the image was displayed in this window. - (when (and (image-get-display-property) - (listp image-mode-winprops-alist)) + (when (listp image-mode-winprops-alist) + ;; Beware: this call to image-mode-winprops can't be optimized away, + ;; because it not only gets the winprops data but sets it up if needed + ;; (e.g. it's used by doc-view to display the image in a new window). (let* ((winprops (image-mode-winprops nil t)) (hscroll (image-mode-window-get 'hscroll winprops)) (vscroll (image-mode-window-get 'vscroll winprops))) + (when (image-get-display-property) ;Only do it if we display an image! (if hscroll (set-window-hscroll (selected-window) hscroll)) - (if vscroll (set-window-vscroll (selected-window) vscroll))))) + (if vscroll (set-window-vscroll (selected-window) vscroll)))))) (defun image-mode-setup-winprops () ;; Record current scroll settings.