[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Support for versions of xpdf that require a ":" before the page numb
From: |
Erich Ruff |
Subject: |
Re: Support for versions of xpdf that require a ":" before the page number |
Date: |
Tue, 08 Jun 2021 18:20:13 +0200 |
User-agent: |
mu4e 1.4; emacs 27.2 |
Hi Eduardo,
before you put the new version on ELPA
could you include my hack for mupdf if not already done?
After checkin for bugs ;-))
so one could use mupdf too
http://mupdf.com/
;; ----------------- er mupdf ---------------------------------
(defun find-mupdf-page (fname &optional page &rest rest)
(find-bgprocess (ee-find-mupdf-page fname page)))
(defvar ee-find-mupdf-page-options '())
(defun ee-find-mupdf-page (fname &optional page &rest rest)
`("mupdf"
,@ee-find-mupdf-page-options
,fname
;; ,@(if page `(,(format "--page-label=%d" page)))
,@(if page `(,(format " %s" page)))
))
(find-code-pdfbackend "mupdf-page")
(code-pdfbackend "mupdf-page")
;; (find-code-pdfbackendalias "mupdf" "mupdf-page")
(code-pdfbackendalias "mupdf" "mupdf-page")
;; (find-code-pdfbackendalias "mupdfpage" "mupdf-page")
(code-pdfbackendalias "mupdfpage" "mupdf-page")
;; ----------------- er mupdf end -------------------------
On Di 08 Jun 2021 at 17:58, Eduardo Ochs <eduardoochs@gmail.com> wrote:
> 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