auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 51e3aa878ab2337a76b0e


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 51e3aa878ab2337a76b0e912bff089568c63d08d
Date: Sat, 07 Feb 2015 20:22:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  51e3aa878ab2337a76b0e912bff089568c63d08d (commit)
      from  cc9c060a47f014dbada65e3c90ab74c2a234251d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 51e3aa878ab2337a76b0e912bff089568c63d08d
Author: Tassilo Horn <address@hidden>
Date:   Sat Feb 7 21:21:49 2015 +0100

    Adapt to PDF Tool changes
    
    * tex.el (TeX-pdf-tools-sync-view)
    (TeX-source-correlate-handle-TeX-region)
    (TeX-source-correlate-sync-source, TeX-PDF-mode): Adapt PDF Tools
    forward/backward search to latest PDF Tools changes.

diff --git a/ChangeLog b/ChangeLog
index 0213b41..a02e9b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-07  Tassilo Horn  <address@hidden>
+
+       * tex.el (TeX-pdf-tools-sync-view)
+       (TeX-source-correlate-handle-TeX-region)
+       (TeX-source-correlate-sync-source, TeX-PDF-mode): Adapt PDF Tools
+       forward/backward search to latest PDF Tools changes.
+
 2015-02-06  Mosè Giordano  <address@hidden>
 
        * tex.el (TeX-source-correlate-handle-TeX-region): Replace
diff --git a/tex.el b/tex.el
index a59d16a..b29ee9b 100644
--- a/tex.el
+++ b/tex.el
@@ -1102,13 +1102,16 @@ 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))
+  (let* ((doc (concat (if TeX-current-process-region-p
+                         (TeX-region-file)
+                       file)
+                     "." (TeX-output-extension)))
+        (buf (or (find-buffer-visiting doc)
+                 (find-file-noselect doc))))
     (if (and TeX-source-correlate-mode
-            (fboundp 'pdf-sync-display-pdf))
-       (pdf-sync-display-pdf)
-      (pop-to-buffer doc))))
+            (fboundp 'pdf-sync-forward-search))
+       (pdf-sync-forward-search)
+      (pop-to-buffer buf))))
 
 (defvar url-unreserved-chars)
 
@@ -1616,25 +1619,21 @@ If this is nil, an empty string will be returned."
   "Keymap for `TeX-source-correlate-mode'.
 You could use this for unusual mouse bindings.")
 
-(defun TeX-source-correlate-handle-TeX-region (file line col &rest more)
+(defun TeX-source-correlate-handle-TeX-region (file line col)
   "Translate backward search info with respect to `TeX-region'.
 That is, if FILE is `TeX-region', update FILE to the real tex
-file and LINE to (+ LINE offset-of-region).  Else, return the
-list of arguments unchanged."
-  (if (string-equal TeX-region (file-name-sans-extension
-                               (file-name-nondirectory file)))
-      (with-current-buffer (or (find-buffer-visiting file)
-                              (find-file-noselect file))
-       (goto-char 0)
-       (if (re-search-forward "!offset(\\([[:digit:]]+\\))" nil t)
-           (let ((offset (string-to-int (match-string-no-properties 1))))
-             (if TeX-region-orig-buffer
-                 (apply #'list
-                        (expand-file-name (buffer-file-name 
TeX-region-orig-buffer))
-                        (+ line offset) col more)
-               (apply #'list file line col more)))
-         (apply #'list file line col more)))
-    (apply #'list file line col more)))
+file and LINE to (+ LINE offset-of-region).  Else, return nil."
+  (when (string-equal TeX-region (file-name-sans-extension
+                                 (file-name-nondirectory file)))
+    (with-current-buffer (or (find-buffer-visiting file)
+                            (find-file-noselect file))
+      (goto-char 0)
+      (when (re-search-forward "!offset(\\([[:digit:]]+\\))" nil t)
+       (let ((offset (string-to-int (match-string-no-properties 1))))
+         (when TeX-region-orig-buffer
+           (apply #'list
+                  (expand-file-name (buffer-file-name TeX-region-orig-buffer))
+                  (+ line offset) col more)))))))
 
 (defun TeX-source-correlate-sync-source (file linecol &rest ignored)
   "Show TeX FILE with point at LINECOL.
@@ -1653,7 +1652,8 @@ or newer."
                 ;; For Emacs 21 compatibility, which doesn't have the
                 ;; url package.
                 (file-error (replace-regexp-in-string "^file://" "" file))))
-        (flc (apply #'TeX-source-correlate-handle-TeX-region file linecol))
+        (flc (or (apply #'TeX-source-correlate-handle-TeX-region file linecol)
+                 (apply #'list file linecol)))
         (file (car flc))
         (line (cadr flc))
         (col  (nth 2 flc)))
@@ -1862,10 +1862,9 @@ function `TeX-global-PDF-mode' for toggling this value."
     (setq TeX-PDF-mode nil))
   (setq TeX-PDF-mode-parsed nil)
   (TeX-set-mode-name nil nil t)
-  (when (and TeX-PDF-mode
-            (boundp 'pdf-sync-correlate-tex-refine-function))
-    (setq pdf-sync-correlate-tex-refine-function
-         #'TeX-source-correlate-handle-TeX-region))
+  (when TeX-PDF-mode
+    (add-hook 'pdf-sync-backward-redirect-functions
+             #'TeX-source-correlate-handle-TeX-region))
   (setq TeX-output-extension
        (if TeX-PDF-mode "pdf" "dvi")))
 (add-to-list 'minor-mode-alist '(TeX-PDF-mode ""))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog |    7 +++++++
 tex.el    |   55 +++++++++++++++++++++++++++----------------------------
 2 files changed, 34 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]