From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jos=C3=A9_?= =?UTF-8?Q?J=C3=BAnior?= Newsgroups: gmane.emacs.bugs Subject: bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive Date: Sat, 5 Feb 2022 09:10:44 -0300 Message-ID: References: <87ee4p9oyc.fsf@gnus.org> <878rux7ylf.fsf@gnus.org> <874k5hur34.fsf@gnus.org> <86ee4lxcly.fsf@mail.linkov.net> <87fsozojw0.fsf@gnus.org> <148bcdf2-c9bf-1809-1f3d-9886f1a7cf80@gmx.at> <14975056-17a7-b3df-e562-ea6c095d1acf@gmx.at> <87a6f5da29.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ea736e05d744437d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4323"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53629@debbugs.gnu.org, Juri Linkov To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 05 13:12:29 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nGJvX-0000vN-Bc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 13:12:27 +0100 Original-Received: from localhost ([::1]:60632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGJvV-0007fQ-Jx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 07:12:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGJv9-0007f3-5v for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 07:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGJv7-0001QC-VA for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 07:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGJv7-0000Mn-R9 for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 07:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jos=C3=A9_?= =?UTF-8?Q?J=C3=BAnior?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Feb 2022 12:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53629 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 53629-submit@debbugs.gnu.org id=B53629.16440630881366 (code B ref 53629); Sat, 05 Feb 2022 12:12:01 +0000 Original-Received: (at 53629) by debbugs.gnu.org; 5 Feb 2022 12:11:28 +0000 Original-Received: from localhost ([127.0.0.1]:33965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGJua-0000Ly-4q for submit@debbugs.gnu.org; Sat, 05 Feb 2022 07:11:28 -0500 Original-Received: from mail-ua1-f42.google.com ([209.85.222.42]:45965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGJuY-0000Ll-7z for 53629@debbugs.gnu.org; Sat, 05 Feb 2022 07:11:26 -0500 Original-Received: by mail-ua1-f42.google.com with SMTP id b37so15205488uad.12 for <53629@debbugs.gnu.org>; Sat, 05 Feb 2022 04:11:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jnaEsfGxM9BmUkxhYBeJyjegTW0QM7aoeiLz+GQzkdE=; b=CjB5B3WxDYZ0kzR7JRtDkvDEasK0p23DY+qWmJBWNoEz+5vQN+ufNISRLPudLW07lB 52gMnZ5HZFqzdN/F6ye5atonCaZ5mXHX0P3ucstwCS8amVZiAy5bdAiBbGuYB5l8zIkv hfiDgoWWvFVR5CanJib+63hGvyICr5QuPA/4x4gqldKHx+2k+aF4dN3kbKn6SogUNRhz sZPM+iMDLSmxnDKlKbxhixVmbS3k7sXXmbMmY5Ujj1JWEiZ/Ukspe7JHx1wvo/L0cSAt u9dKezQZWrxG7WSjYx75A6cN4LL5Kvv9WrI0RSO6IUHqPUtaMECagaD/3Bw8zx2GZoJB 8xLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jnaEsfGxM9BmUkxhYBeJyjegTW0QM7aoeiLz+GQzkdE=; b=krbRGJC58hP1Vne9ckOk8XsY3W/otQm/LONqqSbKJGx4lBoAB8zEfbnhTWkf9pRK53 VJ3hOFpwtxtGgQBARoFCB80TFQT7yKGgjzwvEVqvg1rHzyNGbxiGbcDn0fW+DJ6a3V4G O5D7E0M3zzAZr4vD+/75A/xI3kcr6QoCghUnWiGQRqeFw1rwwkNdIUq2dODYogCyN9ac ObaQjhG9Eb4kKEBMYrEiwIVxtAnKfAbE6hTaZjfLuxkDbTtaKf3uiQ1I73zuijCuAZtL tKklkYd8osOLAHEChoZv0DyzsCoTIF8Ao0oIHVRb2nPmI4E/967ija53IAs81CWK1gRg khOg== X-Gm-Message-State: AOAM530L8SszKT8TsMVr0WpWj/jCgStO/APuClYFDlYmyUHJcLW1G8v6 0H/TbR+WfLl1wWEtJaUdi00A/BO0Z5I1OoJcdPg= X-Google-Smtp-Source: ABdhPJypYiOHwTnVgmg0BB/Ppe2QqUsR/Q7NS+LsAU2obAIla4UuQDAHXSCkfzAPSL9cVAtamPmnhw8G9EVuVaEVJxQ= X-Received: by 2002:a05:6102:cc8:: with SMTP id g8mr2269144vst.39.1644063080736; Sat, 05 Feb 2022 04:11:20 -0800 (PST) In-Reply-To: <87a6f5da29.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226062 Archived-At: --000000000000ea736e05d744437d Content-Type: text/plain; charset="UTF-8" Thanks, I think it's perfect now. It would be good to have it documented, indeed. On Sat, Feb 5, 2022 at 4:52 AM Lars Ingebrigtsen wrote: > martin rudalics writes: > > > I disregarded the useless complication that 'minibuffer-selected-window' > > returns nil when the selected window is not a minibuffer window. Please > > try the below. > > > > martin > > > > (defun my-buffer-identification (fmt) > > (list (propertize > > fmt > > 'face (if (let ((window (selected-window))) > > (or (eq window (old-selected-window)) > > (and (minibuffer-window-active-p > (minibuffer-window)) > > (with-selected-window (minibuffer-window) > > (eq window > (minibuffer-selected-window)))))) > > Thanks; seems to work fine. Perhaps we should make this into a utility > function and then document this technique in the manual in the mode line > section? > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --000000000000ea736e05d744437d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, I think it's perfect now. It would be good to = have it documented, indeed.

On Sat, Feb 5, 2022 at 4:52 AM Lars Ingebrig= tsen <larsi@gnus.org> wrote:
martin rudalics &l= t;rudalics@gmx.at&= gt; writes:

> I disregarded the useless complication that 'minibuffer-selected-w= indow'
> returns nil when the selected window is not a minibuffer window.=C2=A0= Please
> try the below.
>
> martin
>
> (defun my-buffer-identification (fmt)
>=C2=A0 =C2=A0(list (propertize
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 fmt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 'face (if (let ((window (selected-windo= w)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= or (eq window (old-selected-window))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (and (minibuffer-window-active-p (minibuffer-window))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-selected-window (minibuffer-window)=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(eq window (minibuffer-selected-wi= ndow))))))

Thanks; seems to work fine.=C2=A0 Perhaps we should make this into a utilit= y
function and then document this technique in the manual in the mode line section?

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000ea736e05d744437d--