auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Re: [AUCTeX] Inverse Search with Evince & DBUS


From: Tassilo Horn
Subject: [AUCTeX-devel] Re: [AUCTeX] Inverse Search with Evince & DBUS
Date: Fri, 11 Feb 2011 10:08:09 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Hi,

I've just found out that my previous patch doesn't work if the tex
source is split into different tex files residing in different
directories.  Here's an updated version that fixes that issue.

--8<---------------cut here---------------start------------->8---
Index: ChangeLog
===================================================================
RCS file: /sources/auctex/auctex/ChangeLog,v
retrieving revision 5.1727
diff -r5.1727 ChangeLog
0a1,5
> 2011-02-06  Tassilo Horn  <address@hidden>
> 
>       * tex.el (TeX-source-correlate-mode): Add support for I/O
>       correlation mode inverse search for the Evince document viewer.
> 
Index: tex.el
===================================================================
RCS file: /sources/auctex/auctex/tex.el,v
retrieving revision 5.674
diff -r5.674 tex.el
1415a1416,1431
> (defun TeX-source-correlate-sync-source (file linecol)
>   "Show TeX FILE with point at LINECOL.
> This function is called when emacs receives a SyncSource signal
> emitted from the Evince document viewer."
>   ;; FILE is actually given as relative path to the TeX-master root document,
>   ;; so we need to strip the directory part to match the buffer name.
>   (let ((buf (get-buffer (file-name-nondirectory file)))
>         (line (car linecol))
>         (col (cadr linecol)))
>     (if (null buf)
>         (message "No buffer for %s." file)
>       (switch-to-buffer buf)
>       (goto-line (car linecol))
>       (unless (= col -1)
>         (move-to-column col)))))
> 
1436a1453,1461
>   ;; Register Emacs for the SyncSource DBUS signal emitted by Evince.
>   (when (and (fboundp 'dbus-register-signal)
>            (fboundp 'dbus-call-method)
>            (executable-find "evince"))
>     (require 'dbus)
>     (dbus-register-signal
>      :session nil "/org/gnome/evince/Window/0"
>      "org.gnome.evince.Window" "SyncSource"
>      'TeX-source-correlate-sync-source))
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo



reply via email to

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