From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Window focus event Date: Thu, 16 Dec 2021 09:30:29 -0500 Message-ID: References: <874k79q8ej.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8446"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: lxsameer , "emacs-devel@gnu.org" To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 16 15:31:47 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxrnO-0001zM-J1 for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Dec 2021 15:31:46 +0100 Original-Received: from localhost ([::1]:46090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxrnN-0002vN-H9 for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Dec 2021 09:31:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxrmG-0001OY-L8 for emacs-devel@gnu.org; Thu, 16 Dec 2021 09:30:36 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxrmE-0002cg-0H for emacs-devel@gnu.org; Thu, 16 Dec 2021 09:30:36 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AA6D880552; Thu, 16 Dec 2021 09:30:31 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 60895802DC; Thu, 16 Dec 2021 09:30:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1639665030; bh=tPW5M1lnuaWDfN5THRB2ZmduZ+T0nWOOXZu7s3wb0KE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=clrdCxRDFTBPTQ5654kjUNLBjDlPPzqJWmEGwMlTIVfkEo94VZW53MQVljOCAP9vj UyH+oYTzs+VnqigBw6sOHC3xpwCI2BtLTd2IpuT4XR140DdTEQ1gDzS3DAaRNB4QJr iy2OoxOpw4c7ESLoa4xyMTihMC449yk3kLu6BU+e62YDhoymiyIFTKj7ZzJrTCt253 p+dAZZon1TwtHmRXIiR5mj+NWndo9fMEC6svHkH6l2RaQSWwqbrnpCDCE//rxwxCRK 8ovzdvaz6W+8XShifZ0qN9EROLQ2Muq4OhBQpGt2QYCQ5rqQgF/3E4c+EaM0eROGCX X5KwBFKY/9Kpw== Original-Received: from pastel (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2A80612081F; Thu, 16 Dec 2021 09:30:30 -0500 (EST) In-Reply-To: <874k79q8ej.fsf@web.de> (Michael Heerdegen's message of "Thu, 16 Dec 2021 09:08:20 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:282160 Archived-At: > Regarding the question: I would say `window-configuration-change-hook' > or `window-state-change-hook' are the best fitting hooks for the task. > May depend on your use case. Indeed. > Note that Emacs sometimes internally selects windows temporarily > (`with-selected-window'), so doing something for every window selection > is most of the time not what you want. Note that neither of the above two hooks are run during `with-selected-window`, AFAIK. Stefan