From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Cadilhac Newsgroups: gmane.emacs.help Subject: Re: [ELISP] Detect focus on emacs. Date: Mon, 02 May 2005 23:21:52 +0200 Organization: Epita Message-ID: <877jihb9xr.fsf@mahaena.lrde> References: <87acnm5v9h.fsf@mahaena.lrde> <87mzreqx7f.fsf-monnier+gnu.emacs.help@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115085876 19318 80.91.229.2 (3 May 2005 02:04:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 May 2005 02:04:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 03 04:04:29 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DSmlo-0006gI-VI for geh-help-gnu-emacs@m.gmane.org; Tue, 03 May 2005 04:04:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DSmsp-0001uz-1x for geh-help-gnu-emacs@m.gmane.org; Mon, 02 May 2005 22:11:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DSiSz-00073Q-MZ for help-gnu-emacs@gnu.org; Mon, 02 May 2005 17:28:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DSiSz-000734-2f for help-gnu-emacs@gnu.org; Mon, 02 May 2005 17:28:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DSiOe-0005aL-5C for help-gnu-emacs@gnu.org; Mon, 02 May 2005 17:24:08 -0400 Original-Received: from [163.5.254.26] (helo=kualalumpur.lrde.epita.fr) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DSiQd-0007Jw-Ra for help-gnu-emacs@gnu.org; Mon, 02 May 2005 17:26:12 -0400 Original-Received: from mahaena.lrde.epita.fr ([192.168.101.66] helo=mahaena.lrde) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.44) id 1DSiM9-000488-Fp for help-gnu-emacs@gnu.org; Mon, 02 May 2005 23:21:33 +0200 Original-To: help-gnu-emacs@gnu.org In-Reply-To: <87mzreqx7f.fsf-monnier+gnu.emacs.help@gnu.org> (Stefan Monnier's message of "Sun, 01 May 2005 20:38:40 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26197 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26197 Stefan Monnier writes: >> I need to know if emacs has the global input focus, that's to say, >> if emacs' window is the selected one in the wm. > > I don't think you can do that from elisp as of Emacs-22. > Patches are welcome to add the functionality, of course, Ok, why not ! A function like `window-focus-p', that will check with XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window has the input focus ? So I'll have a try. BTW, is there guidelines for emacs patches, some must-know coding style or whatever like that somewhere ? -- Michael Cadilhac, a.k.a. Micha [mika] | _ coin _ coin _ angle Epita/LRDE promo 2007 | >(')____, >(')____, >(')____, 2 rue de la Convention | 01.46.70.90.75 | (` =~~/ (` =~~/ (` =~~/ 94270 Le Kremlin Bicetre | 06.23.20.31.30 | ~^~^`---'~^~^~^`---'~^~^~^`---'~^~^