From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.devel Subject: Re: Let mode-line packages distinguish the selected-window Date: Tue, 29 Oct 2019 12:50:20 +0100 Message-ID: <87wocn3h4z.fsf@bernoul.li> References: <87blu3pqyc.fsf@bernoul.li> <83wocrtxl3.fsf@gnu.org> <9a34b0c1-149b-a850-db88-b9d7cb5c751e@gmx.at> <87tv7triwh.fsf@bernoul.li> <83a79ksw4h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="178621"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 29 12:57:49 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPQ8C-000kLt-9C for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2019 12:57:48 +0100 Original-Received: from localhost ([::1]:55346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPQ8A-0002Ok-FM for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2019 07:57:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40553) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPQ1A-0005cj-EL for emacs-devel@gnu.org; Tue, 29 Oct 2019 07:50:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPQ19-0002St-7M for emacs-devel@gnu.org; Tue, 29 Oct 2019 07:50:32 -0400 Original-Received: from mail.hostpark.net ([212.243.197.30]:53012) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iPQ17-0002PS-Kw; Tue, 29 Oct 2019 07:50:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 1467A16112; Tue, 29 Oct 2019 12:50:26 +0100 (CET) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id 4taj6tCzayex; Tue, 29 Oct 2019 12:50:25 +0100 (CET) Original-Received: from p2 (212-51-149-230.fiber7.init7.net [212.51.149.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 8BE68160E3; Tue, 29 Oct 2019 12:50:25 +0100 (CET) In-reply-to: <83a79ksw4h.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.243.197.30 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:241582 Archived-At: Eli Zaretskii writes: >> From: Jonas Bernoulli >> Cc: Eli Zaretskii , emacs-devel@gnu.org >> Date: Sun, 27 Oct 2019 22:13:50 +0100 >> >> Which face (mode-line or mode-line-inactive) is the mode-line of this >> window using? >> >> That is of course closely related to the question: >> >> Is the is the "selected" window? >> >> But the answer to the first question can not always be derived from the >> answer to the second. > > Are you saying that you want the actual mode-line face to be exposed > to Lisp, not the selected window of the selected frame? Checking whether Emacs was already doing that after all was the last thing that I checked before I started this thread, so yes. Doing that the way Martin suggested sounds like a good idea to me: >>> So maybe we should just provide a function called 'mode-line-active-p' >>> that returns non-nil when the window whose mode-line is just processed >>> is considered active (whether that decision is right or wrong) and not >>> talk about the selected window in the first place.