GNU bug report logs - #41852
27.0.50; text-scale commands don't scale header of tabulated-list-mode

Previous Next

Package: emacs;

Reported by: Thomas Hisch <thomas.hisch <at> ims.co.at>

Date: Sun, 14 Jun 2020 13:38:01 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 27.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #99 received at 41852 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>
Cc: thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Sat, 31 Oct 2020 00:31:45 +0000
martin rudalics <rudalics <at> gmx.at> writes:

>  >    When the new buffer local variable 'text-scale-remap-header-line-face'
>  >    is non-nil, 'text-scale-adjust' will also change the font size of the
>  >    'header-line' face in the current buffer.
>
> I'd say "will also scale the text in the mode line when displaying that
> buffer".

It doesn't scale the text in the mode line, though.

>  >  This will also affect any
>  >    face that inherits from it.
>
> But if I assign the header line face or some face inheriting from it to
> some buffer text (not that I recommend doing that), that text will be
> scaled regardless of the value of 'text-scale-remap-header-line-face'.
> Right?

Yes.  But that seems (in my testing) to be the case for any face I
tested that doesn't have an absolute value for :height.  So I'm not sure
that it needs to be specifically mentioned in NEWS.

> Here too I would say something like "the buffer text is scaled".  The
> default face itself is not scaled by face remapping.  The remapping is
> applied by the display engine whenever the buffer is displayed after all
> faces have been merged.  But maybe that is clear to everyone and you
> should simply ignore what I wrote.

I'm not sure it is clear to everyone (it cleared some stuff up for me),
but I worry that this might be too detailed for NEWS.  The interesting
bits is probably not exactly how it works, but rather what its visible
effects are.

> We might have a problem when these two are set in separate steps.

Yes, if the variable is set after scaling, it does not take effect until
another scaling operation is done.

Adding this seems to fix that:

(add-variable-watcher 'text-scale-remap-header-line-face
		      #'text-scale--refresh)

(defun text-scale--refresh (symbol newval operation where)
  (when (and (eq symbol 'text-scale-remap-header-line-face)
             (eq operation 'set)
             text-scale-mode)
    (with-current-buffer where
      (let ((text-scale-remap-header-line-face newval))
	(text-scale-mode 1)))))




This bug report was last modified 4 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.