summaryrefslogtreecommitdiff
path: root/lisp/doc-view.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-01-27 17:10:13 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-27 17:10:13 +0100
commit77b4e06f8ad3d7ea399f38b2211e0eebc5dbfaa8 (patch)
treeb4ba74acfe1650fd305b9c8903da00c6e2f00cc1 /lisp/doc-view.el
parentd633db5189f335873a03544f9f41dcaf77c8e31d (diff)
downloademacs-77b4e06f8ad3d7ea399f38b2211e0eebc5dbfaa8.tar.gz
Move some of the doc-view variables around to fix load errors
Diffstat (limited to 'lisp/doc-view.el')
-rw-r--r--lisp/doc-view.el52
1 files changed, 26 insertions, 26 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 4cc560755e4..ee6aa055172 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -226,6 +226,32 @@ are available (see Info node `(emacs)Document View')"
Higher values result in larger images."
:type 'number)
+(defvar doc-view-doc-type nil
+ "The type of document in the current buffer.
+Can be `dvi', `pdf', `ps', `djvu', `odf', 'epub', `cbz', `fb2',
+`'xps' or `oxps'.")
+
+;; FIXME: The doc-view-current-* definitions below are macros because they
+;; map to accessors which we want to use via `setf' as well!
+(defmacro doc-view-current-page (&optional win)
+ `(image-mode-window-get 'page ,win))
+(defmacro doc-view-current-info () '(image-mode-window-get 'info))
+(defmacro doc-view-current-overlay () '(image-mode-window-get 'overlay))
+(defmacro doc-view-current-image () '(image-mode-window-get 'image))
+(defmacro doc-view-current-slice () '(image-mode-window-get 'slice))
+
+(defvar-local doc-view--current-cache-dir nil
+ "Only used internally.")
+
+(defun doc-view-custom-set-epub-font-size (option-name new-value)
+ (set-default option-name new-value)
+ (dolist (x (buffer-list))
+ (with-current-buffer x
+ (when (eq doc-view-doc-type 'epub)
+ (delete-directory doc-view--current-cache-dir t)
+ (doc-view-initiate-display)
+ (doc-view-goto-page (doc-view-current-page))))))
+
(defcustom doc-view-epub-font-size nil
"Font size in points for EPUB layout."
:type 'integer
@@ -371,9 +397,6 @@ of the page moves to the previous page."
(defvar-local doc-view--current-timer nil
"Only used internally.")
-(defvar-local doc-view--current-cache-dir nil
- "Only used internally.")
-
(defvar-local doc-view--current-search-matches nil
"Only used internally.")
@@ -388,11 +411,6 @@ files inside an archive it is a temporary copy of
the (uncompressed, extracted) file residing in
`doc-view-cache-directory'.")
-(defvar doc-view-doc-type nil
- "The type of document in the current buffer.
-Can be `dvi', `pdf', `ps', `djvu', `odf', 'epub', `cbz', `fb2',
-`'xps' or `oxps'.")
-
(defvar doc-view-single-page-converter-function nil
"Function to call to convert a single page of the document to a bitmap file.
May operate on the source document or on some intermediate (typically PDF)
@@ -586,24 +604,6 @@ Typically \"page-%s.png\".")
;;;; Navigation Commands
-;; FIXME: The doc-view-current-* definitions below are macros because they
-;; map to accessors which we want to use via `setf' as well!
-(defmacro doc-view-current-page (&optional win)
- `(image-mode-window-get 'page ,win))
-(defmacro doc-view-current-info () '(image-mode-window-get 'info))
-(defmacro doc-view-current-overlay () '(image-mode-window-get 'overlay))
-(defmacro doc-view-current-image () '(image-mode-window-get 'image))
-(defmacro doc-view-current-slice () '(image-mode-window-get 'slice))
-
-(defun doc-view-custom-set-epub-font-size (option-name new-value)
- (set-default option-name new-value)
- (dolist (x (buffer-list))
- (with-current-buffer x
- (when (eq doc-view-doc-type 'epub)
- (delete-directory doc-view--current-cache-dir t)
- (doc-view-initiate-display)
- (doc-view-goto-page (doc-view-current-page))))))
-
(defun doc-view-last-page-number ()
(length doc-view--current-files))