On 9 February 2016 at 21:51, Mosè Giordano <m...@gnu.org> wrote: > Hi Antoine, > > 2016-02-09 21:40 GMT+01:00 Antoine Levitt <antoine.lev...@gmail.com>: > > Hi, > > > > I use Mate (a fork of Gnome), and because of their general renaming of > > things, evince is atril, and gnome is mate. Search & replacing evince to > > atril and gnome to mate in tex.el makes it work. Could auctex support it > out > > of the box? > > Great, you chose exactly the viewer with most mentions in tex.el! Did > you have to replace also strings like > > /org/gnome/evince/Daemon > > to > > /org/mate/atril/Daemon > > ? >
Yes. I just did a brutal search & replace. I also had to make one more change: there's a change of API apparently, and I had to remove the last argument, :uint32 0, in the dbus call (list :struct :int32 (line-number-at-pos) :int32 (1+ (current-column))) :uint32 0)) Here's the full diff to auctex 11.89.1 (the one in ELPA). Tested and working with Atril 1.8.1 (the one in linux mint 17.1). Best, Antoine
--- tex.el 2016-02-09 22:01:05.865827286 +0100 +++ /home/antoine/tex.el 2016-02-09 22:00:12.293825425 +0100 @@ -1182,8 +1182,8 @@ ;; not being defined. (eval-when-compile (and (featurep 'dbusbind) (require 'dbus nil :no-error))) -(defun TeX-evince-dbus-p (&rest options) - "Return non-nil, if evince is installed and accessible via DBUS. +(defun TeX-atril-dbus-p (&rest options) + "Return non-nil, if atril is installed and accessible via DBUS. Additional OPTIONS may be given to extend the check. If none are given, only the minimal requirements needed by backward search are checked. If OPTIONS include `:forward', which is currently @@ -1193,17 +1193,17 @@ (and (featurep 'dbusbind) (require 'dbus nil :no-error) (dbus-ignore-errors (dbus-get-unique-name :session)) - (dbus-ping :session "org.gnome.evince.Daemon") - (executable-find "evince") + (dbus-ping :session "org.mate.atril.Daemon") + (executable-find "atril") (or (not (memq :forward options)) (let ((spec (dbus-introspect-get-method - :session "org.gnome.evince.Daemon" - "/org/gnome/evince/Daemon" - "org.gnome.evince.Daemon" + :session "org.mate.atril.Daemon" + "/org/mate/atril/Daemon" + "org.mate.atril.Daemon" "FindDocument"))) ;; FindDocument must exist, and its signature must be (String, - ;; Boolean, String). Evince versions between 2.30 and 2.91.x - ;; didn't have the Boolean spawn argument we need to start evince + ;; Boolean, String). Atril versions between 2.30 and 2.91.x + ;; didn't have the Boolean spawn argument we need to start atril ;; initially. (and spec (equal '("s" "b" "s") @@ -1236,19 +1236,19 @@ (defvar url-unreserved-chars) -(defun TeX-evince-sync-view () - "Focus the focused page/paragraph in Evince with the position -of point in emacs by using Evince's DBUS API. Used by default -for the Evince viewer entry in `TeX-view-program-list-builtin' if +(defun TeX-atril-sync-view () + "Focus the focused page/paragraph in Atril with the position +of point in emacs by using Atril's DBUS API. Used by default +for the Atril viewer entry in `TeX-view-program-list-builtin' if the requirements are met." (require 'url-util) (let* ((uri (concat "file://" (url-encode-url (expand-file-name (concat file "." (TeX-output-extension)))))) (owner (dbus-call-method - :session "org.gnome.evince.Daemon" - "/org/gnome/evince/Daemon" - "org.gnome.evince.Daemon" + :session "org.mate.atril.Daemon" + "/org/mate/atril/Daemon" + "org.mate.atril.Daemon" "FindDocument" uri t))) @@ -1258,13 +1258,12 @@ (current-buffer)) (dbus-call-method :session owner - "/org/gnome/evince/Window/0" - "org.gnome.evince.Window" + "/org/mate/atril/Window/0" + "org.mate.atril.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)))) + (list :struct :int32 (line-number-at-pos) :int32 (1+ (current-column))))) + (error "Couldn't find the Atril instance for %s" uri)))) (defvar TeX-view-program-list-builtin (cond @@ -1293,15 +1292,15 @@ ("dvips and gv" "%(o?)dvips %d -o && gv %f" ,(list "%(o?)dvips" "gv")) ("gv" "gv %o" "gv") ("xpdf" ("xpdf -remote %s -raise %o" (mode-io-correlate " %(outpage)")) "xpdf") - ("Evince" ,(if (TeX-evince-dbus-p :forward) - 'TeX-evince-sync-view - `("evince" (mode-io-correlate - ;; With evince 3, -p N opens the page *labeled* N, + ("Atril" ,(if (TeX-atril-dbus-p :forward) + 'TeX-atril-sync-view + `("atril" (mode-io-correlate + ;; With atril 3, -p N opens the page *labeled* N, ;; and -i,--page-index the physical page N. ,(if (string-match "--page-index" - (shell-command-to-string "evince --help")) + (shell-command-to-string "atril --help")) " -i %(outpage)" - " -p %(outpage)")) " %o")) "evince") + " -p %(outpage)")) " %o")) "atril") ("Okular" ("okular --unique %o" (mode-io-correlate "#src:%n%a")) "okular") ("xdg-open" "xdg-open %o" "xdg-open") ("PDF Tools" TeX-pdf-tools-sync-view)))) @@ -1396,7 +1395,7 @@ '(((output-dvi has-no-display-manager) "dvi2tty") ((output-dvi style-pstricks) "dvips and gv") (output-dvi "xdvi") - (output-pdf "Evince") + (output-pdf "Atril") (output-html "xdg-open")))) "Alist of predicates and viewers. Each entry consists of a list with two elements. The first @@ -1753,8 +1752,8 @@ (defun TeX-source-correlate-sync-source (file linecol &rest ignored) "Show TeX FILE with point at LINECOL. This function is called when emacs receives a SyncSource signal -emitted from the Evince document viewer. IGNORED absorbs an -unused id field accompanying the DBUS signal sent by Evince-3.0.0 +emitted from the Atril document viewer. IGNORED absorbs an +unused id field accompanying the DBUS signal sent by Atril-3.0.0 or newer." ;; FILE may be given as relative path to the TeX-master root document or as ;; absolute file:// URL. In the former case, the tex file has to be already @@ -1812,11 +1811,11 @@ TeX-source-correlate-map)) (TeX-set-mode-name 'TeX-source-correlate-mode t t) (setq TeX-source-correlate-start-server-flag TeX-source-correlate-mode) - ;; Register Emacs for the SyncSource DBUS signal emitted by Evince. - (when (TeX-evince-dbus-p) + ;; Register Emacs for the SyncSource DBUS signal emitted by Atril. + (when (TeX-atril-dbus-p) (dbus-register-signal - :session nil "/org/gnome/evince/Window/0" - "org.gnome.evince.Window" "SyncSource" + :session nil "/org/mate/atril/Window/0" + "org.mate.atril.Window" "SyncSource" 'TeX-source-correlate-sync-source))) (defalias 'TeX-source-specials-mode 'TeX-source-correlate-mode)
_______________________________________________ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex