29 Jan 2011 15:40
Inverse Search with Evince & DBUS
Tassilo Horn <tassilo <at> member.fsf.org>
2011-01-29 14:40:20 GMT
2011-01-29 14:40:20 GMT
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))))) (dbus-register-signal :session nil "/org/gnome/evince/Window/0" "org.gnome.evince.Window" "SyncSource" 'th-evince-sync) --8<---------------cut here---------------end--------------->8--- Bye, Tassilo
RSS Feed