From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Let mode-line packages distinguish the selected-window Date: Sat, 26 Oct 2019 22:41:56 +0300 Message-ID: <83h83vthtn.fsf@gnu.org> References: <87blu3pqyc.fsf@bernoul.li> <877e4r5mu6.fsf@bernoul.li> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="214771"; mail-complaints-to="usenet@blaine.gmane.org" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Jonas Bernoulli Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 26 21:43:41 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 1iORyP-000tjX-ED for ged-emacs-devel@m.gmane.org; Sat, 26 Oct 2019 21:43:41 +0200 Original-Received: from localhost ([::1]:41702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iORyN-0008TH-EN for ged-emacs-devel@m.gmane.org; Sat, 26 Oct 2019 15:43:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51476) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iORwz-00067r-13 for emacs-devel@gnu.org; Sat, 26 Oct 2019 15:42:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iORwy-0001wi-5c; Sat, 26 Oct 2019 15:42:12 -0400 Original-Received: from [176.228.60.248] (port=3800 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iORwx-0000NG-6F; Sat, 26 Oct 2019 15:42:11 -0400 In-reply-to: <877e4r5mu6.fsf@bernoul.li> (message from Jonas Bernoulli on Sat, 26 Oct 2019 21:27:29 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:241477 Archived-At: > From: Jonas Bernoulli > Date: Sat, 26 Oct 2019 21:27:29 +0200 > Cc: emacs-devel@gnu.org > > > Despite what the above may suggest, I fully agree: while it's now easy > > to "roll your own", this is a common need and we should provide this > > info directly. > > That would be nice. (And no Eli, I don't have a patch ready. Not much > of a C guy. Not at all really.) Well, you were "a C guy" enough to suggest where to make the change... Anyway, feel free to submit a feature request via report-emacs-bug. > But even though I suggested something like that, I feel the > remembered-selected-window approach is a bit hackish. IMO it would be > nicer if instead of that variable regular selected-window would return > "that window" while a new function/variable named something like > mode-line-window returned the "window whose mode-line is currently being > updated". But that would be a breaking change, so maybe not. Yes, maybe not. And I think the variable you want should actually be a function. But that's the easy part; the hard part is to make sure the value does what Lisp code called from mode-line expect. Thanks.