emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog doc-view.el


From: Tassilo Horn
Subject: [Emacs-diffs] emacs/lisp ChangeLog doc-view.el
Date: Thu, 05 Mar 2009 08:24:32 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Tassilo Horn <tsdh>     09/03/05 08:24:32

Modified files:
        lisp           : ChangeLog doc-view.el 

Log message:
        (doc-view-convert-current-doc): Save the current
        resolution in the cache directory.
        (doc-view-initiate-display): Restore the saved resolution when
        using cached image files.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15432&r2=1.15433
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/doc-view.el?cvsroot=emacs&r1=1.82&r2=1.83

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15432
retrieving revision 1.15433
diff -u -b -r1.15432 -r1.15433
--- ChangeLog   5 Mar 2009 03:45:51 -0000       1.15432
+++ ChangeLog   5 Mar 2009 08:24:26 -0000       1.15433
@@ -1,3 +1,10 @@
+2009-03-05  Tassilo Horn  <address@hidden>
+
+       * doc-view.el (doc-view-convert-current-doc): Save the current
+       resolution in the cache directory.
+       (doc-view-initiate-display): Restore the saved resolution when
+       using cached image files.
+
 2009-03-05  Glenn Morris  <address@hidden>
 
        * mail/rmail.el (rmail-perm-variables): rmail-overlay-list needs to be

Index: doc-view.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/doc-view.el,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- doc-view.el 2 Mar 2009 08:55:47 -0000       1.82
+++ doc-view.el 5 Mar 2009 08:24:31 -0000       1.83
@@ -721,8 +721,16 @@
   ;; resets during the redisplay).
   (setq doc-view-pending-cache-flush t)
   (let ((png-file (expand-file-name "page-%d.png"
+                                    (doc-view-current-cache-dir)))
+       (res-file (expand-file-name "resolution.el"
                                     (doc-view-current-cache-dir))))
     (make-directory (doc-view-current-cache-dir) t)
+    ;; Save the used resolution so that it can be restored when
+    ;; reading the cached files.
+    (let ((res doc-view-resolution))
+      (with-temp-buffer
+       (princ res (current-buffer))
+       (write-file res-file)))
     (case doc-view-doc-type
       (dvi
        ;; DVI files have to be converted to PDF before Ghostscript can process
@@ -1045,6 +1053,16 @@
        (if (doc-view-already-converted-p)
            (progn
              (message "DocView: using cached files!")
+             ;; Load the saved resolution
+             (let ((res-file (expand-file-name "resolution.el"
+                                               (doc-view-current-cache-dir)))
+                   (res doc-view-resolution))
+               (with-temp-buffer
+                 (when (file-exists-p res-file)
+                   (insert-file-contents res-file)
+                   (setq res (read (current-buffer)))))
+               (when (numberp res)
+                 (set (make-local-variable 'doc-view-resolution) res)))
              (doc-view-display (current-buffer) 'force))
          (doc-view-convert-current-doc))
        (message




reply via email to

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