all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: raman@google.com (T.V Raman)
To: emacs-devel@gnu.org
Subject: focus-in-hook ---fires incorrectly?
Date: Mon, 26 Mar 2018 10:20:11 -0700	[thread overview]
Message-ID: <23225.11211.455169.412084@retriever.mtv.corp.google.com> (raw)


this is on emacs built from Git @head running on Debian under StumpWM
as a window-manager.

Try:

(add-hook 'focus-in-hook #'(lambda () (message "hello %s" (selected-frame))))

What you'd expect:

1. See "hello <frame-id>" when Emacs frames receive focus.
2. Nothing when Emacs loses focus.

What Actually Happens:

Hook fires when emacs loses focus, and you see "Hello <frame-id>"
where frame-id is the id of selected frame in emacs
2. You get "hello" when Emacs receives focus  -- with no frame-id.

Note that the corresponding focus-out-hook appears to work correctly
i.e. only fires when Emacs loses focus.

-- 

-- 

-- 

-- 



             reply	other threads:[~2018-03-26 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 17:20 T.V Raman [this message]
2018-03-26 17:44 ` focus-in-hook ---fires incorrectly? Eli Zaretskii
2018-03-26 18:00   ` T.V Raman
2018-03-26 20:09   ` Michael Heerdegen
2018-03-28 12:37     ` Noam Postavsky

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=23225.11211.455169.412084@retriever.mtv.corp.google.com \
    --to=raman@google.com \
    --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.