summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Politz <politza@hochschule-trier.de>2018-04-21 18:56:40 +0200
committerAndreas Politz <politza@hochschule-trier.de>2018-04-21 18:56:40 +0200
commit04184f3f53d32a8a431d4c4bd3591cf018978144 (patch)
tree1269f960d8c13af5eda3aaafa22c3cac80e1ea5b
parent9ee74aa7ff2eb85d395712ddef25e8b2c4df7dc1 (diff)
parent11efb071eda9fb0ad519387a424c8f989cb5338e (diff)
Merge branch 'next'
-rw-r--r--README.org55
-rw-r--r--lisp/pdf-cache.el2
-rw-r--r--lisp/pdf-outline.el8
-rw-r--r--lisp/pdf-tools.el6
4 files changed, 36 insertions, 35 deletions
diff --git a/README.org b/README.org
index 5b28b12..a74f962 100644
--- a/README.org
+++ b/README.org
@@ -130,9 +130,18 @@
or likewise within Emacs using `setenv`.
After that, compilation should proceed as normal.
-**** Compiling on FreeBSD
+**** FreeBSD
Although not officially supported, it has been reported that
- pdf-tools work well on FreeBSD. Install the dependencies with
+ pdf-tools work well on FreeBSD. Instead of building pdf-tools, you
+ can install one of the OS packages with, e.g.
+#+BEGIN_SRC sh
+ $ pkg install pdf-tools-emacs25
+#+END_SRC
+ To see the current list of pdf-tools packages for FreeBSD visit
+ [[https://repology.org/metapackages/?search=pdf-tools&inrepo=freebsd][the Repology list]].
+
+ To build pdf-tools from either melpa or directly from the source
+ repository, install the dependencies with
#+BEGIN_SRC sh
$ pkg install autotools gmake poppler-glib
#+END_SRC
@@ -156,20 +165,10 @@
emacs. This includes the standard binaries provided by the GNU
project, those available as MSYS2 packages and numerous third-party
binaries. It has been tested with emacs 25.1. Instructions are
- provided under [[Compilation and installation on Windows]], below.
-**** Compiling on Cygwin
- On [[https://www.cygwin.com/][Cygwin]] the following dependencies are needed.
-
- - libpoppler-devel (*Lib* category)
- - libpoppler-glib-devel (*Lib* category)
- - libpng-devel (*Devel* category)
- - make (*Devel* category)
- - gcc-core (*Devel* category)
- - gcc-g++ (*Devel* category)
- - autoconf (*Devel* category)
- - automake (*Devel* category)
- - perl (*Perl* category)
- - emacs-w32 (*Editors* category)
+ provided under [[#compilation-and-installation-on-windows][Compilation and installation on Windows]], below.
+ PDF Tools will successfully compile using Cygwin, but it will not be
+ able to open PDFs properly due to the way binaries compiled with Cygwin
+ handle file paths.
*** Compilation
:PROPERTIES:
@@ -204,28 +203,28 @@
2. Update and install dependencies, skipping any you already have
#+BEGIN_SRC sh
- pacman -Syu
- pacman -S base-devel
- pacman -S mingw-w64-x86_64-toolchain
- pacman -S mingw-w64-x86_64-zlib
- pacman -S mingw-w64-x86_64-libpng
- pacman -S mingw-w64-x86_64-poppler
- pacman -S mingw-w64-x86_64-imagemagick
+ $ pacman -Syu
+ $ pacman -S base-devel
+ $ pacman -S mingw-w64-x86_64-toolchain
+ $ pacman -S mingw-w64-x86_64-zlib
+ $ pacman -S mingw-w64-x86_64-libpng
+ $ pacman -S mingw-w64-x86_64-poppler
+ $ pacman -S mingw-w64-x86_64-imagemagick
#+END_SRC
3. Install PDF tools in Emacs, but do not try to compile the
server. Instead, get a separate copy of the source somewhere
else.
#+BEGIN_SRC sh
- git clone https://github.com/politza/pdf-tools
+ $ git clone https://github.com/politza/pdf-tools
#+END_SRC
- 4. Open mingw64 shell
+ 4. Open mingw64 shell (*Note:* You must use mingw64.exe and not msys2.exe)
5. Compile pdf-tools
#+BEGIN_SRC sh
- cd pdf-tools/build
- make -s
+ $ cd /path/to/pdf-tools
+ $ make -s
#+END_SRC
6. This should produce a file ~server/epdfinfo.exe~. Copy this file
@@ -250,7 +249,7 @@
#+BEGIN_SRC emacs-lisp
(setenv "PATH" (concat "C:\\msys64\\mingw64\\bin;" (getenv "PATH")))
- #+END_SRC
+ #+END_SRC
*** ELisp Prerequisites
This package depends on the following Elisp packages, which should
diff --git a/lisp/pdf-cache.el b/lisp/pdf-cache.el
index 84b9740..49b86d7 100644
--- a/lisp/pdf-cache.el
+++ b/lisp/pdf-cache.el
@@ -349,6 +349,8 @@ See also `pdf-info-renderpage-highlight' and
(pdf-cache-prefetch-minor-mode
(pdf-util-assert-pdf-buffer)
(add-hook 'pre-command-hook 'pdf-cache--prefetch-stop nil t)
+ ;; FIXME: Disable the time when the buffer is killed or it's
+ ;; major-mode changes.
(setq pdf-cache--prefetch-timer
(run-with-idle-timer (or pdf-cache-prefetch-delay 1)
t 'pdf-cache--prefetch-start (current-buffer))))
diff --git a/lisp/pdf-outline.el b/lisp/pdf-outline.el
index 077c0fb..e141ca8 100644
--- a/lisp/pdf-outline.el
+++ b/lisp/pdf-outline.el
@@ -166,10 +166,10 @@ additionally quit the Outline.
rebound to their respective last character.
\\{pdf-outline-buffer-mode-map}"
- (setq outline-regexp "\\( *\\)."
- outline-level
- (lambda nil (1+ (/ (length (match-string 1))
- pdf-outline-buffer-indent))))
+ (setq-local outline-regexp "\\( *\\).")
+ (setq-local outline-level
+ (lambda nil (1+ (/ (length (match-string 1))
+ pdf-outline-buffer-indent))))
(toggle-truncate-lines 1)
(setq buffer-read-only t)
diff --git a/lisp/pdf-tools.el b/lisp/pdf-tools.el
index a9bc5a9..805614c 100644
--- a/lisp/pdf-tools.el
+++ b/lisp/pdf-tools.el
@@ -263,11 +263,11 @@ Returns always nil, unless `system-type' equals windows-nt."
(defun pdf-tools-find-bourne-shell ()
"Locate a usable sh."
- (or (executable-find "sh")
- (and (eq system-type 'windows-nt)
+ (or (and (eq system-type 'windows-nt)
(let* ((directory (pdf-tools-msys2-directory)))
(when directory
- (expand-file-name "usr/bin/bash.exe" directory))))))
+ (expand-file-name "usr/bin/bash.exe" directory))))
+ (executable-find "sh")))
(defun pdf-tools-build-server (target-directory
&optional