auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. ba10cf083753bceb27923


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. ba10cf083753bceb27923b6b80f5d2f7f78cd093
Date: Fri, 10 Jun 2016 18:59:28 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  ba10cf083753bceb27923b6b80f5d2f7f78cd093 (commit)
      from  ce347e6f4763a530d0a86c9f233361486914bbf1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ba10cf083753bceb27923b6b80f5d2f7f78cd093
Author: Tassilo Horn <address@hidden>
Date:   Fri Jun 10 20:58:32 2016 +0200

    New defcustom TeX-raise-frame-function
    
    * tex.el (TeX-raise-frame-function): New defcustom.
    (TeX-source-correlate-sync-source): Use it.

diff --git a/tex.el b/tex.el
index 923ce32..6ba3d60 100644
--- a/tex.el
+++ b/tex.el
@@ -1846,12 +1846,44 @@ file and LINE to (+ LINE offset-of-region).  Else, 
return nil."
            (list (expand-file-name (buffer-file-name TeX-region-orig-buffer))
                  (+ line offset) col)))))))
 
+(defcustom TeX-raise-frame-function nil
+  "A function which will be called to raise the Emacs frame.
+The function is called after `TeX-source-correlate-sync-source'
+has processed an inverse search DBUS request from Evince or
+Atril in order to raise the Emacs frame.
+
+`TeX-source-correlate-sync-source' already calls `raise-frame',
+however, depending on window manager and focus stealing policies,
+it might very well be that Emacs doesn't pop into the foreground.
+So you can do whatever it takes here.
+
+For some users, `x-focus-frame' does the trick.  For some
+users (on GNOME 3.20),
+
+  (lambda ()
+    (run-at-time 0.5 nil #'x-focus-frame))
+
+does the trick.  Some other users use the external wmctrl tool to
+raise the Emacs frame like so:
+
+  (lambda ()
+    (call-process
+     \"wmctrl\" nil nil nil \"-i\" \"-R\"
+     (frame-parameter (selected-frame) 'outer-window-id)))"
+  :type 'function
+  :group 'TeX-view)
+
 (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
-or newer."
+or newer.
+
+Note that this function tries to raise the Emacs frame using
+`raise-frame'.  However, that doesn't work reliably across window
+managers/operating systems.  If the Emacs frame isn't raised,
+customize `TeX-raise-frame-function'."
   ;; 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
   ;; opened.
@@ -1886,10 +1918,9 @@ or newer."
                  (> pos (point-max)))
          (widen))
        (goto-char pos))
-      ;; Grab focus after inverse search (only if `x-focus-frame' function is
-      ;; available).
-      (when (fboundp 'x-focus-frame)
-       (x-focus-frame (selected-frame))))))
+      (raise-frame)
+      (when TeX-raise-frame-function
+       (funcall TeX-raise-frame-function)))))
 
 (define-minor-mode TeX-source-correlate-mode
   "Minor mode for forward and inverse search.

-----------------------------------------------------------------------

Summary of changes:
 tex.el |   41 ++++++++++++++++++++++++++++++++++++-----
 1 file changed, 36 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]