emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14435: closed (24.3.50; Co-operation of doc-view +


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14435: closed (24.3.50; Co-operation of doc-view + desktop-save-mode, save-place etc.)
Date: Mon, 27 May 2013 01:01:02 +0000

Your message dated Sun, 26 May 2013 20:59:18 -0400
with message-id <address@hidden>
and subject line Re: bug#14435: 24.3.50; Co-operation of doc-view + 
desktop-save-mode, save-place etc.
has caused the debbugs.gnu.org bug report #14435,
regarding 24.3.50; Co-operation of doc-view + desktop-save-mode, save-place etc.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14435: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14435
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; Co-operation of doc-view + desktop-save-mode, save-place etc. Date: Wed, 22 May 2013 11:28:34 +0530
1. Enable session management.

    (custom-set-variables
     '(desktop-base-file-name "~/.emacs.desktop")
     '(desktop-save-mode t)
     '(save-place t nil (saveplace))
     '(savehist-mode t))

2. Open a PDF file.  Make sure the conversion goes through and visit
   some arbitrary page.

   The file I have is 102.3MB and has 382 pages.  

3. C-x C-c and start Emacs.

4. Note that doc-view starts with all conversion all over again.

Expected behaviour: doc-view should access the already "cached" pages
and drop me in the same page that I was in the previous session.


In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-05-20 on debian-6.05
Bzr revision: 112643 address@hidden
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t




--- End Message ---
--- Begin Message --- Subject: Re: 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 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
>> 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.



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]