Tassilo Horn wrote:
Hi Thomas,
>> AUCTeX first does
>>
>> (dbus-call-method
>> :session "org.gnome.evince.Daemon"
>> "/org/gnome/evince/Daemon"
>> "org.gnome.evince.Daemon"
>> "FindDocument"
>> "file:///home/horn/some.pdf" ;; replace with some existing PDF
>> t) ;; C-x C-x here
>>
>> Does that work, i.e., open an evince window showing some.pdf?
> This part works, much to my surprise. I pasted the above into the
> scratch buffer, replaced by an existing PDF and ran M-x
> eval-buffer. The PDF opened in a new evince window.
Uh, that's strange. That's exactly what TeX-evince-sync-view does.
> When I then run the TeX-evince-sync-view command on a LaTeX document
> (that has a newly compiled PDF output), nothing happens: no evince
> windows, no error message, no output from 'dbus-monitor', no output in
> the *Messages* buffer - nothing...
Hm, so TeX-evince-sync-view is called, doesn't error, and still does
nothing. Honestly, I have no clue how that can happen. Could you
please do `C-h f TeX-evince-sync-view RET' which shows the docs of the
function. It should look like
,----[ C-h f TeX-evince-sync-view RET ]
| TeX-evince-sync-view is a Lisp function in `tex.el'.
|
| (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
| the requirements are met.
|
| [back]
`----
Mine says:
TeX-evince-sync-view is a compiled Lisp function in
`tex.el'.
(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
the requirements are met.
Notice the difference, "compiled Lisp". Does that make a difference
here?
There, the `tex.el' is a link. Hitting RET on it brings you to the
definition of the function. It should look like
--8<---------------cut here---------------start------------->8---
(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
the requirements are met."
(require 'url-util)
(let* ((uri (concat "file://" (let ((url-unreserved-chars (cons ?/ url-unreserved-chars)))
(url-hexify-string
(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"
"FindDocument"
uri
t)))
(if owner
(dbus-call-method
:session owner
"/org/gnome/evince/Window/0"
"org.gnome.evince.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))))
--8<---------------cut here---------------end--------------->8---
Now set point somewhere in the function and do `M-x edebug-defun'. Now
go to some tex buffer and try the View command with TeX-evince-sync-view
again. Now the function definition should pop up again, and you can
single-step through the function by repeatedly pressing `n' where the
_expression_ values are also printed in *Messages*.
I have tried debugging now. I execute `M-x edebug-defun' in the
function definition as you specify. This causes the following output
in the *Messages* buffer:
Edebug: TeX-evince-sync-view
TeX-evince-sync-view
Unfortunately, that is all that happens. When I execute
TeX-evince-sync-view in a LaTeX buffer afterwards, nothing
happens...
Does that share some light?
Unfortunately not, but thanks for trying,
Thomas
|