all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: emacs-devel@gnu.org
Subject: Raising the Emacs frame in response to a DBUS signal
Date: Mon, 30 May 2016 09:47:56 +0200	[thread overview]
Message-ID: <87eg8krnpv.fsf@gnu.org> (raw)

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	other threads:[~2016-05-30  7:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30  7:47 Tassilo Horn [this message]
2016-05-30 11:36 ` Raising the Emacs frame in response to a DBUS signal cesar mena
2016-05-30 11:53   ` Tassilo Horn
2016-06-04  7:34     ` Eli Zaretskii
2016-06-04 12:59       ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg8krnpv.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.