branch: externals/auctex commit 5276f35d9dc7b37cfb0881ddcaf11c05783aac15 Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Add PDF Tools support * tex.el (TeX-pdf-tools-sync-view): New function to use PDF Tools `pdf-view-mode' as a viewer. (TeX-view-program-list-builtin): Add PDF Tools entry calling `TeX-pdf-tools-sync-view'. --- ChangeLog | 7 +++++++ tex.el | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 169f5d3..cc381f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-02-05 Tassilo Horn <t...@gnu.org> + + * tex.el (TeX-pdf-tools-sync-view): New function to use PDF Tools + `pdf-view-mode' as a viewer. + (TeX-view-program-list-builtin): Add PDF Tools entry calling + `TeX-pdf-tools-sync-view'. + 2015-02-04 Tassilo Horn <t...@gnu.org> * Makefile.in (STYLESRC): Add new style. diff --git a/tex.el b/tex.el index a17b8b4..3aace79 100644 --- a/tex.el +++ b/tex.el @@ -1098,6 +1098,20 @@ search are checked, too." (defvar url-unreserved-chars) +(defun TeX-pdf-tools-sync-view () + "Focus the focused page/paragraph in `pdf-view-mode'. Used by +default for the PDF Tools viewer entry in +`TeX-view-program-list-builtin'." + (unless (featurep 'pdf-tools) + (error "PDF Tools are not installed!")) + (let ((doc (concat file "." (TeX-output-extension)))) + (unless (get-file-buffer doc) + (find-file-noselect doc)) + (if (and TeX-source-correlate-mode + (fboundp 'pdf-sync-display-pdf)) + (pdf-sync-display-pdf) + (pop-to-buffer doc)))) + (defun TeX-evince-sync-view () "Focus the focused page/paragraph in Evince with the position of point in emacs by using Evince's DBUS API. Used by default @@ -1164,7 +1178,8 @@ the requirements are met." " -i %(outpage)" " -p %(outpage)")) " %o")) "evince") ("Okular" ("okular --unique %o" (mode-io-correlate "#src:%n%a")) "okular") - ("xdg-open" "xdg-open %o" "xdg-open")))) + ("xdg-open" "xdg-open %o" "xdg-open") + ("PDF Tools" TeX-pdf-tools-sync-view)))) "Alist of built-in viewer specifications. This variable should not be changed by the user who can use `TeX-view-program-list' to add new viewers or overwrite the