Dear Maintainers,

Let me add some info to my original bug report, regarding forward search with 
evince.  In fact, some odd behaviour persisted (with or without my patch), in 
particular evince remained first in the Alt-Tab application list, regardless of 
swithching between other applications.  While I couldn't find a reference for 
the evince DBus API, I decided to check what would happen if I replace the 
timestamp argument with a constant zero (or one), and it solved everything 
(including raising and giving focus).

Can anyone tell me what this parameter even mean?

Anyway, raising the emacs window via wmctrl on reverse search, as in the 
previous patch, and replacing the complicated calculation of timestamp with 
some constant in forward search, seems to give a fully correct behaviour.

All the best,
Itai.
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 auctex (11.87-1.2) unstable; urgency=low
 .
   * Raise windows on forward/reverse search.
Author: Itaï BEN YAACOV <can...@free.fr>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- auctex-11.87.orig/tex.el
+++ auctex-11.87/tex.el
@@ -1515,6 +1519,9 @@ or newer."
     (if (null buf)
         (message "No buffer for %s." file)
       (switch-to-buffer buf)
+      (let ((wmctrl (executable-find "wmctrl")))
+	(if wmctrl
+	    (start-process "wmctrl" nil wmctrl "-R" (frame-parameter nil 'name))))
       (push-mark (point) 'nomsg)
       (goto-char (point-min))
       (forward-line (1- line))
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 auctex (11.87-1.3) unstable; urgency=low
 .
   * Raise windows on reverse search.
   * Set evince forward search timestamp to zero.
Author: Itaï BEN YAACOV <can...@free.fr>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- auctex-11.87.orig/tex.el
+++ auctex-11.87/tex.el
@@ -1059,18 +1059,7 @@ the requirements are met."
 	 "org.gnome.evince.Window"
 	 "SyncView"
 	 (buffer-file-name)
-	 (list :struct :int32 (line-number-at-pos) :int32 (1+ (current-column)))
-	 :uint32 (let ((time (float-time)))
-		   ;; FIXME: Evince wants a timestamp as UInt32, but POSIX time
-		   ;; is too large for emacs integers on 32 bit systems.  Emacs
-		   ;; 24.2 will allow providing DBUS ints as floats, and this
-		   ;; dbus version will be identifiable by its new variables
-		   ;; `dbus-compiled-version' and `dbus-runtime-version'.  But
-		   ;; it seems providing just 1 as timestamp has no negative
-		   ;; consequences, anyway.
-		   (if (> most-positive-fixnum time)
-		       (round time)
-		     1)))
+	 (list :struct :int32 (line-number-at-pos) :int32 (1+ (current-column))) :uint32 0)
       (error "Couldn't find the Evince instance for %s" uri))))
 
 (defvar TeX-view-program-list-builtin

Reply via email to