emacs-devel
[Top][All Lists]
Advanced

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

Raising the Emacs frame in response to a DBUS signal


From: Tassilo Horn
Subject: Raising the Emacs frame in response to a DBUS signal
Date: Mon, 30 May 2016 09:47:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Hi all,

GNU AUCTeX supports inverse search for the Evince PDF viewer, i.e., when
you're writing a LaTeX document with Emacs/AUCTeX and view the compiled
PDF using Evince, you can Ctrl-click in Evince and Emacs jumps to the
corresponding text in your LaTeX editing buffer.  For that purpose,
Emacs is registered to handle SyncSource DBUS signals issued by Evince.

Since recently (no clue when as I normally don't use Evince but the PDF
Tools Emacs PDF viewer) in Emacs 25, the Emacs frame is not raised
anymore when the AUCTeX function handling the SyncSource signal is
called, and the problem is that I don't know how to achieve that again.

`raise-frame' seems to raise the selected frame above other Emacs frames
of the same Emacs instance but not above other applications (like
Evince).  Here in Gnome 3.20, I get at least a notification "Emacs is
ready" which I can click to switch to Emacs.  But the user who reported
the problem uses XFCE where nothing seems to happen.  Or better, point
in Emacs jumps to the right position but he has to switch to Emacs
explicitly.

Then I found `x-focus-frame' which seems to do what I want.  A simple
test case like evaluating

  (progn
    (sleep-for 5)
    (x-focus-frame (selected-frame)))

in *scratch* and then switching to another application brings Emacs to
the front again when the 5 seconds have passed.  However, when I add the
very same `x-focus-frame' call to the end of the AUCTeX SyncSource DBUS
handler function, it seems to have no effect.  The function is run and
switches to the right LaTeX editing buffer and sets point, but Emacs
the Emacs frame is not raised.

That's the actual function:

  http://git.savannah.gnu.org/cgit/auctex.git/tree/tex.el#n1849

In some previous version of the function I've called `raise-frame' at
the end but eventually removed that call.  Sadly, I'm don't know anymore
why I did that.  Either because the frame was raised anyhow or because
it didn't raise.

I checked the ChangeLogs but couldn't find some change which looks
relevant.

Bye,
Tassilo



reply via email to

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