help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to determine (from Elisp) whether the Emacs frame has focus?


From: tomas
Subject: Re: How to determine (from Elisp) whether the Emacs frame has focus?
Date: Sat, 14 Nov 2015 08:30:41 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Nov 13, 2015 at 08:05:11PM -0800, John Mastro wrote:
> Marcin Borkowski <mbork@mbork.pl> wrote:
> > I'd like to know whether the selected Emacs frame has focus.  Currently,
> > I'm using an xdotool/xprop combo (I'm on GNU/Linux), but I'd like to
> > know whether there is a better way.  I know about focus-in-hook and
> > focus-out-hook, and I could make them set/unset some global variable,
> > but this looks hackish.
> 
> Not that I can tell.
> 
> I'm not sure if it would end up less hackish, but an alternative to
> global variables might be to use frame parameters. See the info nodes
> "(Elisp) Frame Parameters" and "(Elisp) Parameter Access".

To be more specific, the function selected-frame (Info menu Frames / submenu
Input Focus) gives you the selected frame.

Thanks, Jon for prompting me to read manuals and learn something :)

- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlZG4yEACgkQBcgs9XrR2ka2qQCaAykYO4/O/hbbw9HdEu0vE+r1
xJEAniwH8eRjpaeuKF6clq0OLAl9oIRB
=nfvW
-----END PGP SIGNATURE-----



reply via email to

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