From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#73862: [PATCH] Add `header-line-active` and `header-line-inactive` faces. Date: Thu, 5 Dec 2024 08:02:06 -0800 Message-ID: References: <86wmgfzhgc.fsf@gnu.org> <86zflay7hh.fsf@gnu.org> <86jzcey3cu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002a1c030628880541" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1224"; mail-complaints-to="usenet@ciao.gmane.io" Cc: trevor.m.murphy@gmail.com, me@eshelyaron.com, 73862@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 05 17:04:31 2024 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 1tJEL8-0000BH-JY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Dec 2024 17:04:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJEKj-0006rJ-1g; Thu, 05 Dec 2024 11:04:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJEKg-0006r2-Md for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 11:04:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJEKg-00008l-E4 for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 11:04:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:References:In-Reply-To:Mime-Version:To:Subject; bh=tH1yxgJuf/PHU5dfe/nQ82W+3kBy/ISaoD7qiMnmpRk=; b=EJzWn03QFzfsEJhiRA51xby5E3OUdtktBOqbvZs/hZ5P6k18ffdkddqqvZ4oCEwiSl14147hWbj/WvRbLwG2GVP90qPYGEMYtVCWjZrj6St9MqmvEJi7X6cjmCaNqP7lHtGBiTNkdjxNzstRyvT4RIA7gHerLEOyaZVOK5JuQwAMJdspvTAtvo9XT5wPAm8kENdNhohQKYcOUX7c7il+FdCvt910K2GAi8+STPp8+y5VwfyDlWbFPKdczUMQ5yU8LzLC8sW2VrK+Rc6FEDkO06qOQ2qkAOLpvHOZgajB2NGMuu9gxq8dpgu7LT31w7l6zXZVkXeIUBE0SXaj9VUTug==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tJEKg-0004ki-8Q for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 11:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Dec 2024 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73862 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73862-submit@debbugs.gnu.org id=B73862.173341459618171 (code B ref 73862); Thu, 05 Dec 2024 16:04:02 +0000 Original-Received: (at 73862) by debbugs.gnu.org; 5 Dec 2024 16:03:16 +0000 Original-Received: from localhost ([127.0.0.1]:40402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJEJw-0004j0-31 for submit@debbugs.gnu.org; Thu, 05 Dec 2024 11:03:16 -0500 Original-Received: from mail-lj1-f173.google.com ([209.85.208.173]:56590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJEJu-0004ie-JX for 73862@debbugs.gnu.org; Thu, 05 Dec 2024 11:03:15 -0500 Original-Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2ffbea0acc2so11765241fa.1 for <73862@debbugs.gnu.org>; Thu, 05 Dec 2024 08:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733414528; x=1734019328; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tH1yxgJuf/PHU5dfe/nQ82W+3kBy/ISaoD7qiMnmpRk=; b=PkK9c+HLHRMGFSQe4nlVFJLbULETJH2ig22tzfC1nAD+riNKWuu598hfDhVRVGTd5t ZMgQqWTyIDbDnurcijISDfweandwvmcVXlx0vtNAPxhQP60C3QI1kb+A1t8GNjUSKBQH 8KGoQqNble9rhvDN9BMrhsY61QQI5psSbtWvqX/aBMwTvioODlcbXIPqxvRJ6cBxt/Iz vJ3lsAM+FWz26NgCD9msKQGC3pRLHTwLOEFDo7qNEf0aGGq+n66pCo1RkybBpj3HySR0 x6zLXH8uqK1b8f/1zHFVpnfyACI7yCcuYWWwVEzz2NIU2mZEjLcjZonOBmx0A7j9UQOn CnTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733414528; x=1734019328; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tH1yxgJuf/PHU5dfe/nQ82W+3kBy/ISaoD7qiMnmpRk=; b=erckO54MqmQ99Fc9vIkpuSHSU6c+3qGLtf9jX3SHNyvgmn/ONia0dNNFQjvZTC+5Jf lKjZX5wTx/aArrHGtFZjuG+lHN7ZMvUrfAK1+T6kl9Kl/BKrb5afjBp+5dJPwF+eUMPe wctrRpfRW1YFpUDPhwKo23FKzQ3FTOKpQQ0IBzgT01oNKLmyJrFkunanELj01mJ+xwxQ sZPoA7KEu6rZKe9EESiInuXsrN6czp06+Cs/Rk4bqSZLV8PKgc2wYv/gqwwyeEPcUSHX uqR4USuZ43lLg3bo/TCCpNIelHCMlraP4/3lecmB9jf08CNbrvzmLXLbGTE7dLfMIBBb ANYQ== X-Forwarded-Encrypted: i=1; AJvYcCUgMGLwT3mN5LeDio9MRF+1n96apLVr4aYP7WV93jFL12pLk7EhgVjxTsc7FN6FZKLdc20wbA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwXCqpoZfaJ2L4Q36vjYAwUND2T3+PBbyc0ttfpKYAdZsuZLIUc 24b8zg8Oe9/H61TxMZOdxtG+DjVeGsgQezBwdZFk2pgCCYHwHBI/7QSPJD3XcGdAlLXKHIX7chr 97CzmCI94UdxW+9E8sWtycntw63w= X-Gm-Gg: ASbGncsy7CVonoj4amqc82RXkaIhB8OA0CiNPepZzNbSZTUxnadh+BwqSAcyaW3AvvS cO+cuUo/h0B/FiJRtGQz5+DUC3P+PwV/ARqsoM9MWxQ7Io5OGbegZ2Fw= X-Google-Smtp-Source: AGHT+IFamNytGYeJZ+Is/r+mcaqcBHVtOWGEMUp4zv+DXt8yZMpVdw5ldtB9PGzh8wxyC0hFLQc2k86gK9Im0qap/W8= X-Received: by 2002:a05:651c:19aa:b0:2ff:8d3b:46d3 with SMTP id 38308e7fff4ca-30009ca95f6mr65995811fa.16.1733414527567; Thu, 05 Dec 2024 08:02:07 -0800 (PST) Original-Received: from 649336022844 named unknown by gmailapi.google.com with HTTPREST; Thu, 5 Dec 2024 08:02:06 -0800 In-Reply-To: <86jzcey3cu.fsf@gnu.org> X-Superhuman-Draft-ID: draft0043c536078e30ca X-Mailer: Superhuman Desktop (2024-12-02T20:06:08Z) X-Superhuman-ID: m4bi8ojp.932d78cf-1c5c-4747-b628-06ece6ff32d9 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296474 Archived-At: --0000000000002a1c030628880541 Content-Type: text/plain; charset="UTF-8" On Wed, Dec 04, 2024 at 11:51 PM, Eli Zaretskii wrote: > Once again, please show some simple Lisp to reproduce the phenomena you > are observing. It is hard to discuss these highly technical issues on this > abstract level. > Happy to. Sorry, I didn't think it was necessary given Eshel's providing of the recipe. It wasn't lisp though, so here's the lisp version from emacs -Q: 1. (setq header-line-format "Some Header") 2. (face-remap-set-base 'header-line 'highlight) 3. (set-face-attribute 'default nil :height (+ (face-attribute 'default :height) 10)) 4. (switch-to-buffer-other-window "new") 5. From within new buffer/window: (set-face-attribute 'default nil :height (+ (face-attribute 'default :height) 10)) You'll see after step 3 the header line switches to the highlight face. After step 5, the header line in the original buffer switches away from the highlight face, which is unexpected. If you then switch back to the original buffer and change the font size again, the highlight will display again. Switching back to the new buffer and changing the font size causes it to disappear again, so I was mistaken about it only happening once. It just so happens that a full redisplay only triggers once for me in my normal usage when I have a window without the header line override specified. On the very basic level of the display code, when a display iterator is > initialized, the window for whose display the iterator is used must be > given to init_iterator as its argument, and the buffer of that window must > be temporarily made to be the current buffer. So this cannot be the problem > in this case. If init_iterator would be passed an incorrect window, we'd > have much more grave display problems than this minor issue. > Understood, but that's not what I was attempting to describe. I was trying to say that the window passed to init_interator IS the correct window. And that that is used to resolve the remap for the inactive/active faces. However, it does not appear that that same window is used to resolve remapping of faces that are inherited by the inactive/active faces. >From what I can tell, this only applies to header-line-active and header-line-inactive (and their mode line equivalents) and it does not apply to other faces in the header line that may inherit from remapped faces, so that's good. Also, I understand what you're saying that remapping mode-line was decided in Emacs 29 to not be supported and the conclusion may be the same for header-line. If that's what it needs to be, that's fine. As Eshel said, it will be a breaking change because people have relied on this behavior. Thanks, --0000000000002a1c030628880541 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 04, 2024 at 11:51 PM, Eli Zaretski= i <eliz@gnu.org> wrote:<= br>

Once again, please show some simple Lisp to reproduce the phenomena you are observing. It is hard to discuss these highly technical issues on this abstract level.

=

Happy= to. Sorry, I didn't think it was necessary given Eshel's=C2=A0prov= iding of the recipe. It wasn't lisp though, so here's the lisp vers= ion from emacs -Q:

  1. (setq header-line-format "Some Header")
    <= /li>
  2. (face-remap-set-base 'header-line 'highlight)
  3. =
  4. (set-face-attribute 'default nil :height (+ (face-attribute 'defa= ult :height) 10))
  5. (switch-to-buffer-other-window "new= ")
  6. From within new buffer/window: (set-face-attribute 'default nil :height (+ (face-attribute '= default :height) 10))
You'll see after step 3 = the header line switches to the highlight face.
After step 5,= the header line in the original buffer switches away from the highlight fa= ce, which is unexpected.

If you then switch ba= ck to the original buffer and change the font size again, the highlight wil= l display again. Switching back to the new buffer and changing the font siz= e causes it to disappear again, so I was mistaken about it only happening o= nce. It just so happens that a full redisplay only triggers once for me in = my normal=C2=A0usage when I have a window without the header line override = specified.

<= div class=3D"">
=

On the very basic level of the display code, when a display it= erator is initialized, the window for whose display the iterator is used must be given to init_iterator as its argument, and the buffer of that window must be temporarily made to be the current buffer. So this cannot be the problem in this case. If init_iterator would be passed an incorrect window, we'd have much more grave display problems than this minor issue.

=

Understood, but that's not what I was at= tempting to describe. I was trying to say that the window passed to init_in= terator IS the correct window. And that that is used to resolve the remap f= or the inactive/active faces. However, it does not appear that that same wi= ndow is used to resolve remapping=C2=A0of faces that are inherited by the i= nactive/active faces.

From what I can tell, th= is only applies to header-line-active and header-line-inactive (and their m= ode line equivalents) and it does not apply to other faces in the header li= ne that may inherit from remapped faces, so that's good.
=
Also, I understand what you're saying that remapping mod= e-line was decided in Emacs 29 to not be supported and the conclusion may b= e the same for header-line. If that's what it needs to be, that's f= ine. As Eshel said, it will be a breaking change because people have relied= on this behavior.

Thanks,

--0000000000002a1c030628880541--