[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex a3f4cac 29/36: Implement forward-search for View
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auctex a3f4cac 29/36: Implement forward-search for View command on TeX-region. |
Date: |
Fri, 28 Nov 2014 17:25:51 +0000 |
branch: externals/auctex
commit a3f4cac866bce4784858cc1a2e8e3661576445f4
Author: Tassilo Horn <address@hidden>
Date: Fri Nov 21 11:03:11 2014 +0100
Implement forward-search for View command on TeX-region.
* tex.el (TeX-evince-sync-view): Use line/col information from the
TeX-region buffer if the View command is made on a region.
* tex-buf.el (TeX-region-create): Position point in the same
line/col as in the original buffer to make forward search work.
---
ChangeLog | 8 ++++++++
tex-buf.el | 20 ++++++++++++++------
tex.el | 19 +++++++++++--------
3 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d83ac0f..59a020f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-11-21 Tassilo Horn <address@hidden>
+
+ * tex.el (TeX-evince-sync-view): Use line/col information from the
+ TeX-region buffer if the View command is made on a region.
+
+ * tex-buf.el (TeX-region-create): Position point in the same
+ line/col as in the original buffer to make forward search work.
+
2014-11-20 Mos� Giordano <address@hidden>
* latex.el (LaTeX-env-figure): Fix indentation when there is the
diff --git a/tex-buf.el b/tex-buf.el
index 7b6905b..27a4b5c 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -365,9 +365,9 @@ asked if it is positive, and suppressed if it is not."
;; the command, but keep them if the command to be run is View.
(unless (string= name "View")
(if (frame-live-p TeX-error-overview-frame)
- (delete-frame TeX-error-overview-frame))
- (if (get-buffer TeX-error-overview-buffer-name)
- (kill-buffer TeX-error-overview-buffer-name)))
+ (delete-frame TeX-error-overview-frame))
+ (if (get-buffer TeX-error-overview-buffer-name)
+ (kill-buffer TeX-error-overview-buffer-name)))
;; Now start the process
(setq file (funcall file))
@@ -1447,7 +1447,7 @@ original file."
""
(re-search-forward "[\r\n]" nil t)
(buffer-substring (point-min) (point)))))))))
-
+ (header-offset 0)
;; We search for the trailer from the master file, if it is
;; not present in the region.
(trailer-offset 0)
@@ -1485,8 +1485,9 @@ original file."
header
TeX-region-extra
"\n\\message{ !name(" original ") !offset(")
- (insert (int-to-string (- offset
- (1+ (TeX-current-offset))))
+ (setq header-offset (- offset
+ (1+ (TeX-current-offset))))
+ (insert (int-to-string header-offset)
") }\n"
region
"\n\\message{ !name(" master-name ") !offset(")
@@ -1495,6 +1496,13 @@ original file."
") }\n"
trailer)
(setq TeX-region-orig-buffer orig-buffer)
+ ;; Position point at the line/col that corresponds to point's line in
+ ;; orig-buffer in order to make forward search work.
+ (let ((line-col (with-current-buffer orig-buffer
+ (cons (line-number-at-pos)
+ (current-column)))))
+ (goto-line (abs (- header-offset (car line-col))))
+ (forward-char (cdr line-col)))
(run-hooks 'TeX-region-hook)
(if (string-equal (buffer-string) original-content)
(set-buffer-modified-p nil)
diff --git a/tex.el b/tex.el
index ffd0ecf..3b530cb 100644
--- a/tex.el
+++ b/tex.el
@@ -1112,14 +1112,17 @@ the requirements are met."
uri
t)))
(if owner
- (dbus-call-method
- :session owner
- "/org/gnome/evince/Window/0"
- "org.gnome.evince.Window"
- "SyncView"
- (buffer-file-name)
- (list :struct :int32 (line-number-at-pos) :int32 (1+ (current-column)))
- :uint32 0)
+ (with-current-buffer (or (when TeX-current-process-region-p
+ (get-file-buffer (TeX-region-file t)))
+ (current-buffer))
+ (dbus-call-method
+ :session owner
+ "/org/gnome/evince/Window/0"
+ "org.gnome.evince.Window"
+ "SyncView"
+ (buffer-file-name)
+ (list :struct :int32 (line-number-at-pos) :int32 (1+
(current-column)))
+ :uint32 0))
(error "Couldn't find the Evince instance for %s" uri))))
(defvar TeX-view-program-list-builtin
- [elpa] externals/auctex 1997613 11/36: Add copyright notice to style/foils.el, (continued)
- [elpa] externals/auctex 1997613 11/36: Add copyright notice to style/foils.el, Stefan Monnier, 2014/11/28
- [elpa] externals/auctex deb1a64 24/36: Use more consistent fontification in some styles, Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 29724a5 19/36: Add `luatextra.el' to Makefile.in, Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 20c7209 27/36: Fix fontification of a couple of fontspec macros., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 0cb3759 26/36: Implement inverse/backward search for TeX regions., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 0bae61a 18/36: Add `ifluatex.el' to Makefile.in, Stefan Monnier, 2014/11/28
- [elpa] externals/auctex daa8a25 20/36: Update windows-package Make rule to new Emacs 24.4 package., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 622c054 22/36: Document presence of bashisms in some Make rules., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 904dfef 21/36: Fix structure of the package for Windows., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 3909e4c 06/36: Several changes suggested by byte-compiler warnings., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex a3f4cac 29/36: Implement forward-search for View command on TeX-region.,
Stefan Monnier <=
- [elpa] externals/auctex 0c2cfc8 09/36: Replace `read-string' with `TeX-read-string', Stefan Monnier, 2014/11/28
- [elpa] externals/auctex acf1c76 31/36: Document LaTeX-command-section., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 15edd9b 23/36: Omit f-f hooks and more with TeX-region-create, Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 8f7c399 30/36: Implement LaTeX-command-section., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e4101ed 25/36: Adapt bug intro text for debbugs., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 7b427a7 34/36: Merge ELPA changes fixing some byte-compile warnings., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 58bd866 28/36: Fix indentation in LaTeX-env-figure in a corner case., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e1ec6a0 33/36: Make second argument of LaTeX-label optional., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 59ccf34 35/36: Check the viewer executable exists before opening it., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e739b85 32/36: Move preview/ to top-level., Stefan Monnier, 2014/11/28