[Top][All Lists]

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

[AUCTeX] Inverse Search with Evince & DBUS

From: Tassilo Horn
Subject: [AUCTeX] Inverse Search with Evince & DBUS
Date: Sat, 29 Jan 2011 15:40:20 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Hi all,

I've just gotten inverse search working with Evince (2.32).  That
doesn't have a setting for an editor command (well, it's GNOME, so it
has no settings at all, right?), but instead it fires a SyncSource
signal on the desktop bus.

Well, recent emacsen have dbus support, so it was pretty easy to get
inverse search working.  Here's the code:

--8<---------------cut here---------------start------------->8---
(require 'dbus)

(defun th-evince-sync (file linecol)
  (let ((buf (get-buffer file))
        (line (car linecol))
        (col (cadr linecol)))
    (if (null buf)
        (message "Sorry, %s is not opened..." file)
      (switch-to-buffer buf)
      (goto-line (car linecol))
      (unless (= col -1)
        (move-to-column col)))))

 :session nil "/org/gnome/evince/Window/0"
 "org.gnome.evince.Window" "SyncSource"
--8<---------------cut here---------------end--------------->8---


reply via email to

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