Function: TeX-evince-dbus-p
TeX-evince-dbus-p is a byte-compiled function defined in tex.el.
Signature
(TeX-evince-dbus-p DE APP &rest OPTIONS)
Documentation
Return non-nil, if an evince-compatible reader is 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 the only option, then additional requirements needed by forward search are checked, too.
DE is the name of the desktop environment, APP is the name of viewer.
Source Code
;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
;; XXX: Atril and xreader are forks of Evince and share an almost
;; identical interface with it. Instead of having different functions
;; for each program, we keep the original *-evince-* functions and
;; make them accept arguments to specify the actual name of the
;; program and the desktop environment, that will be used to set up
;; DBUS communication.
(defun TeX-evince-dbus-p (de app &rest options)
"Return non-nil, if an evince-compatible reader is 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
the only option, then additional requirements needed by forward
search are checked, too.
DE is the name of the desktop environment, APP is the name of viewer."
(let ((dbus-debug nil))
(and (featurep 'dbusbind)
(require 'dbus nil :no-error)
(dbus-ignore-errors (dbus-get-unique-name :session))
;; Apparently, `dbus-ping' can signal errors in certain
;; situations. If so, fail gracefully (bug#59380).
(ignore-errors
(dbus-ping :session (format "org.%s.%s.Daemon" de app)
;; Don't block for up to 25 secs if something
;; is wonky.
2000))
(or (not (memq :forward options))
(let ((spec (dbus-introspect-get-method
:session (format "org.%s.%s.Daemon" de app)
(format "/org/%s/%s/Daemon" de app)
(format "org.%s.%s.Daemon" de app)
"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 initially.
(and
spec
(equal '("s" "b" "s")
(delq nil (mapcar
(lambda (elem)
(when (and (listp elem)
(eq (car elem) 'arg))
(cdr (caar (cdr elem)))))
spec)))))))))