unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Tassilo Horn <tsdh@gnu.org>
Cc: 14435-done@debbugs.gnu.org, Jambunathan K <kjambunathan@gmail.com>
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	[thread overview]
Message-ID: <jwvmwrhb5no.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ip25tw56.fsf@thinkpad.tsdh.de> (Tassilo Horn's message of "Sun, 26 May 2013 20:48:37 +0200")

>> 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. <down>
>      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.






  reply	other threads:[~2013-05-27  0:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  5:58 bug#14435: 24.3.50; Co-operation of doc-view + desktop-save-mode, save-place etc Jambunathan K
2013-05-24 11:28 ` Tassilo Horn
2013-05-24 13:35   ` Jambunathan K
2013-05-24 17:44   ` Stefan Monnier
2013-05-24 22:23     ` Tassilo Horn
2013-05-25  1:55       ` Stefan Monnier
2013-05-26 18:48         ` Tassilo Horn
2013-05-27  0:59           ` Stefan Monnier [this message]
2013-05-27  7:46             ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvmwrhb5no.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=14435-done@debbugs.gnu.org \
    --cc=kjambunathan@gmail.com \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).