aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTassilo Horn2009-03-05 08:24:26 +0000
committerTassilo Horn2009-03-05 08:24:26 +0000
commitcde4c3f133e7aa85e28383988797e2f9802cf268 (patch)
treef0cb49d2c5b80128067390df81f27ad26ae73ed4
parent067c08294486abf770d5cdc0cfb17350241309e8 (diff)
downloademacs-cde4c3f133e7aa85e28383988797e2f9802cf268.tar.gz
emacs-cde4c3f133e7aa85e28383988797e2f9802cf268.zip
(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.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/doc-view.el18
2 files changed, 25 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5f9a617aa44..1b00c6f0fdc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12009-03-05 Tassilo Horn <tassilo@member.fsf.org>
2
3 * doc-view.el (doc-view-convert-current-doc): Save the current
4 resolution in the cache directory.
5 (doc-view-initiate-display): Restore the saved resolution when
6 using cached image files.
7
12009-03-05 Glenn Morris <rgm@gnu.org> 82009-03-05 Glenn Morris <rgm@gnu.org>
2 9
3 * mail/rmail.el (rmail-perm-variables): rmail-overlay-list needs to be 10 * mail/rmail.el (rmail-perm-variables): rmail-overlay-list needs to be
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index c9ad392a0b7..bfdc40d50b0 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -721,8 +721,16 @@ Those files are saved in the directory given by the function
721 ;; resets during the redisplay). 721 ;; resets during the redisplay).
722 (setq doc-view-pending-cache-flush t) 722 (setq doc-view-pending-cache-flush t)
723 (let ((png-file (expand-file-name "page-%d.png" 723 (let ((png-file (expand-file-name "page-%d.png"
724 (doc-view-current-cache-dir)))
725 (res-file (expand-file-name "resolution.el"
724 (doc-view-current-cache-dir)))) 726 (doc-view-current-cache-dir))))
725 (make-directory (doc-view-current-cache-dir) t) 727 (make-directory (doc-view-current-cache-dir) t)
728 ;; Save the used resolution so that it can be restored when
729 ;; reading the cached files.
730 (let ((res doc-view-resolution))
731 (with-temp-buffer
732 (princ res (current-buffer))
733 (write-file res-file)))
726 (case doc-view-doc-type 734 (case doc-view-doc-type
727 (dvi 735 (dvi
728 ;; DVI files have to be converted to PDF before Ghostscript can process 736 ;; DVI files have to be converted to PDF before Ghostscript can process
@@ -1045,6 +1053,16 @@ If BACKWARD is non-nil, jump to the previous match."
1045 (if (doc-view-already-converted-p) 1053 (if (doc-view-already-converted-p)
1046 (progn 1054 (progn
1047 (message "DocView: using cached files!") 1055 (message "DocView: using cached files!")
1056 ;; Load the saved resolution
1057 (let ((res-file (expand-file-name "resolution.el"
1058 (doc-view-current-cache-dir)))
1059 (res doc-view-resolution))
1060 (with-temp-buffer
1061 (when (file-exists-p res-file)
1062 (insert-file-contents res-file)
1063 (setq res (read (current-buffer)))))
1064 (when (numberp res)
1065 (set (make-local-variable 'doc-view-resolution) res)))
1048 (doc-view-display (current-buffer) 'force)) 1066 (doc-view-display (current-buffer) 'force))
1049 (doc-view-convert-current-doc)) 1067 (doc-view-convert-current-doc))
1050 (message 1068 (message