summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Whatson <whatson@gmail.com>2020-05-27 09:41:20 +1000
committerVedang Manerikar <ved.manerikar@gmail.com>2021-02-21 14:46:53 +0530
commite9b71b628fbd6ca6e4d4a450105fb0f6138a4e42 (patch)
tree38744ddec65881ebff08338736eb0f9fbe381f44
parentc93815c07a4cf325757c692c1212d7a58644212c (diff)
Factor out macros to ensure they're visible in pdf-cache.el
-rw-r--r--lisp/pdf-cache.el1
-rw-r--r--lisp/pdf-macs.el51
-rw-r--r--lisp/pdf-util.el1
-rw-r--r--lisp/pdf-view.el24
4 files changed, 54 insertions, 23 deletions
diff --git a/lisp/pdf-cache.el b/lisp/pdf-cache.el
index 9ed7241..e9a7ca5 100644
--- a/lisp/pdf-cache.el
+++ b/lisp/pdf-cache.el
@@ -23,6 +23,7 @@
;;; Code:
;;
+(require 'pdf-macs)
(require 'pdf-info)
(require 'pdf-util)
diff --git a/lisp/pdf-macs.el b/lisp/pdf-macs.el
new file mode 100644
index 0000000..e4ac6ea
--- /dev/null
+++ b/lisp/pdf-macs.el
@@ -0,0 +1,51 @@
+;;; pdf-macs.el --- Macros for pdf-tools. -*- lexical-binding:t -*-
+
+;; Copyright (C) 2013 Andreas Politz
+
+;; Author: Andreas Politz <politza@fh-trier.de>
+;; Keywords: files, doc-view, pdf
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;;; Code:
+;;
+
+(defmacro pdf-view-current-page (&optional window)
+ ;;TODO: write documentation!
+ `(image-mode-window-get 'page ,window))
+
+(defmacro pdf-view-current-overlay (&optional window)
+ ;;TODO: write documentation!
+ `(image-mode-window-get 'overlay ,window))
+
+(defmacro pdf-view-current-image (&optional window)
+ ;;TODO: write documentation!
+ `(image-mode-window-get 'image ,window))
+
+(defmacro pdf-view-current-slice (&optional window)
+ ;;TODO: write documentation!
+ `(image-mode-window-get 'slice ,window))
+
+(defmacro pdf-view-current-window-size (&optional window)
+ ;;TODO: write documentation!
+ `(image-mode-window-get 'window-size ,window))
+
+(defmacro pdf-view-window-needs-redisplay (&optional window)
+ `(image-mode-window-get 'needs-redisplay ,window))
+
+(provide 'pdf-macs)
+
+;;; pdf-macs.el ends here
diff --git a/lisp/pdf-util.el b/lisp/pdf-util.el
index 0b7b544..c6d996b 100644
--- a/lisp/pdf-util.el
+++ b/lisp/pdf-util.el
@@ -25,6 +25,7 @@
;;; Code:
+(require 'pdf-macs)
(require 'cl-lib)
(require 'format-spec)
(require 'faces)
diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el
index b701652..451946c 100644
--- a/lisp/pdf-view.el
+++ b/lisp/pdf-view.el
@@ -25,6 +25,7 @@
;;; Code:
(require 'image-mode)
+(require 'pdf-macs)
(require 'pdf-util)
(require 'pdf-info)
(require 'pdf-cache)
@@ -222,29 +223,6 @@ regarding display of the region in the later function.")
(defvar-local pdf-view-register-alist nil
"Local, dedicated register for PDF positions.")
-(defmacro pdf-view-current-page (&optional window)
- ;;TODO: write documentation!
- `(image-mode-window-get 'page ,window))
-
-(defmacro pdf-view-current-overlay (&optional window)
- ;;TODO: write documentation!
- `(image-mode-window-get 'overlay ,window))
-
-(defmacro pdf-view-current-image (&optional window)
- ;;TODO: write documentation!
- `(image-mode-window-get 'image ,window))
-
-(defmacro pdf-view-current-slice (&optional window)
- ;;TODO: write documentation!
- `(image-mode-window-get 'slice ,window))
-
-(defmacro pdf-view-current-window-size (&optional window)
- ;;TODO: write documentation!
- `(image-mode-window-get 'window-size ,window))
-
-(defmacro pdf-view-window-needs-redisplay (&optional window)
- `(image-mode-window-get 'needs-redisplay ,window))
-
(defun pdf-view-current-pagelabel (&optional window)
(nth (1- (pdf-view-current-page window)) (pdf-info-pagelabels)))