[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Support for versions of xpdf that require a ":" before the page number
From: |
Eduardo Ochs |
Subject: |
Support for versions of xpdf that require a ":" before the page number |
Date: |
Tue, 8 Jun 2021 12:58:26 -0300 |
Hi Erich,
I found an elegant way to support both the newer and the older
versions of xpdf. The new code is this, and the new version should be
in ELPA in a few hours...
(defvar ee-find-xpdf-colon "")
(defun ee-find-xpdf-colon ()
"Return \":\" or \"\" according to the version of xpdf.
Some versions of xpdf need a \":\" before the page number -
they need be called as \"xpdf foo.pdf :42\" instead of as
\"xpdf foo.pdf 42\". In the future this function will try
to guess correctly if the \":\" is needed or not, but this
version just returns the value of the variable
`ee-find-xpdf-colon'.")
(defvar ee-find-xpdf-page-options '("-fullscreen"))
(defun ee-find-xpdf-page (fname &optional page &rest rest)
`("xpdf"
,@ee-find-xpdf-page-options
,fname
,@(if page `(,(format "%s%d" (ee-find-xpdf-colon) page)))
))
You will need to add this to your .emacs:
;; Tests:
;; (setq ee-find-xpdf-colon "")
;; (setq ee-find-xpdf-colon ":")
;; (ee-find-xpdf-page "~/Coetzee99.pdf" (+ -110 114))
;; (find-xpdf-page "~/Coetzee99.pdf" (+ -110 114))
;;
(setq ee-find-xpdf-colon ":")
Cheers =),
Eduardo
- Support for versions of xpdf that require a ":" before the page number,
Eduardo Ochs <=