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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41852 in the body.
You can then email your comments to 41852 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sun, 14 Jun 2020 13:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Hisch <thomas.hisch <at> ims.co.at>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 14 Jun 2020 13:38:02 GMT) Full text and rfc822 format available.

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

From: Thomas Hisch <thomas.hisch <at> ims.co.at>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 27.0.50; text-scale commands don't scale header of tabulated-list-mode
Date: Sun, 14 Jun 2020 15:36:23 +0200
If the text is scaled (using `text-scale-increase`) in a
`tabulated-list-mode` buffer, the text of the header is not scaled,
which leads to a messed up (row data doesn't align with header row) buffer.

Evaluating the following code in "emacs -Q" and running
`text-scale-increase` in the *temp* buffer, shows the problem

(let ((columns [("Col1" 50) ("Col2" 50)])
      (rows (list '(nil ["row1xxxxxxxxxxxxxxxxxxxxxxxx" "value1"])
                  '(nil ["row2" "value2"])
                  '(nil ["row3" "value3"]))))
  (switch-to-buffer "*temp*")
  (setq tabulated-list-format columns)
  (setq tabulated-list-entries rows)
  (tabulated-list-init-header)
  (tabulated-list-print))



In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-12-18 built on lcy01-amd64-009
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 20.04 LTS

Recent messages:
You can run the command ‘text-scale-increase’ with M-x te-i RET
next-line: End of buffer
Mark set [2 times]
You can run the command ‘eval-buffer’ with M-x ev-b RET
Undo
Quit
Mark set [3 times]
Quit
You can run the command ‘eval-buffer’ with M-x ev-b RET
Making completion list...

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=-snapshot --with-modules=yes --with-x=yes
 --with-x-toolkit=gtk3 --with-xwidgets=yes 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-snapshot-arAUbL/emacs-snapshot-99615=.
-fstack-protector-strong
 -Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD PDUMPER LCMS2 GMP

Important settings:
  value of $LC_MONETARY: de_AT.UTF-8
  value of $LC_NUMERIC: de_AT.UTF-8
  value of $LC_TIME: de_AT.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  text-scale-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search seq
byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x
cl-loaddefs cl-lib face-remap tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting xwidget-internal move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 46025 9161)
 (symbols 48 6016 1)
 (strings 32 15615 1466)
 (string-bytes 1 508801)
 (vectors 16 9339)
 (vector-slots 8 125076 14228)
 (floats 8 23 46)
 (intervals 56 421 0)
 (buffers 1000 14))
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly prohibited.

IMS Nanofabrication GmbH FN: 208021 p, FB-Gericht: Wien; Sitz: Schreygasse 3, 1020, Vienna (Austria),Tel. +43 1 214 48 94; E-Mail: imsoffice <at> ims.co.at; DVR-Nr: 0374369; www.ims.co.at




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sun, 14 Jun 2020 14:43:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thomas Hisch <thomas.hisch <at> ims.co.at>
Cc: 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Sun, 14 Jun 2020 17:42:06 +0300
severity 41852 wishlist
thanks

> From: Thomas Hisch <thomas.hisch <at> ims.co.at>
> Date: Sun, 14 Jun 2020 15:36:23 +0200
> 
> If the text is scaled (using `text-scale-increase`) in a
> `tabulated-list-mode` buffer, the text of the header is not scaled,
> which leads to a messed up (row data doesn't align with header row) buffer.

text-scale-increase affects only the default face and faces that
inherit from it.  It isn't supposed to affect any other face, such as
the mode-line, the header-line, etc.

So you are actually asking for a new feature of the
tabulated-list-mode, whereby it defines "C-x +" etc. to produce effect
specific to that mode.




Severity set to 'wishlist' from 'normal' Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 14 Jun 2020 14:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sun, 14 Jun 2020 16:26:02 GMT) Full text and rfc822 format available.

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

From: Thomas Hisch <thomas.hisch <at> ims.co.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Sun, 14 Jun 2020 18:25:26 +0200
On 6/14/20 4:42 PM, Eli Zaretskii wrote:
>> From: Thomas Hisch <thomas.hisch <at> ims.co.at>
>> Date: Sun, 14 Jun 2020 15:36:23 +0200
>>
>> If the text is scaled (using `text-scale-increase`) in a
>> `tabulated-list-mode` buffer, the text of the header is not scaled,
>> which leads to a messed up (row data doesn't align with header row) buffer.
>
> text-scale-increase affects only the default face and faces that
> inherit from it.  It isn't supposed to affect any other face, such as
> the mode-line, the header-line, etc.

Thx for mentioning header line. I've just noticed that
tabulated-list-mode supports using a header that doesn't rely on
`header-line-format`.
This feature (setq tabulated-list-use-header-line nil) also doesn't work
as expected. I can see that the header row is rescaled now when
`text-scale-increase` is called, but the row data still looks a bit
messed up (cols are not aligned) after calling `text-scale-increase`
multiple times. The issue can be easily seen by calling
`text-scale-increase` in the *Packages* buffer.

Maybe `tabulate-list-mode` calculates the positions of the beginning of
each column only once.

>
> So you are actually asking for a new feature of the
> tabulated-list-mode, whereby it defines "C-x +" etc. to produce effect
> specific to that mode.
>

Yes it would be nice if text-scale-increase would properly rescale the
header-line, especially since (setq tabulated-list-use-header-line t) is
the default.

BR
Thomas
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly prohibited.

IMS Nanofabrication GmbH FN: 208021 p, FB-Gericht: Wien; Sitz: Schreygasse 3, 1020, Vienna (Austria),Tel. +43 1 214 48 94; E-Mail: imsoffice <at> ims.co.at; DVR-Nr: 0374369; www.ims.co.at




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sun, 14 Jun 2020 16:29:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Thomas Hisch <thomas.hisch <at> ims.co.at>
Cc: 41852 <at> debbugs.gnu.org
Subject: RE: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Sun, 14 Jun 2020 09:28:33 -0700 (PDT)
> > If the text is scaled (using `text-scale-increase`) in a
> > `tabulated-list-mode` buffer, the text of the header is not scaled,
> > which leads to a messed up (row data doesn't align with header row) buffer.
> 
> text-scale-increase affects only the default face and faces that
> inherit from it.  It isn't supposed to affect any other face, such as
> the mode-line, the header-line, etc.
> 
> So you are actually asking for a new feature of the
> tabulated-list-mode, whereby it defines "C-x +" etc. to produce effect
> specific to that mode.

Sounds reasonable to expect that column headings
remain over the columns they head.  We can call
that an enhancement request or a bug to be fixed.
___

Just an FYI, and not to take anything away from
either the enhancement request or Eli's note above:

There's another way to zoom in and out, which does
affect also the header-line and mode-line, in which
case the reported bug doesn't manifest - column
headers remain over the columns: zoom the frame,
not the buffer.

(Another difference, however, is that zooming a
frame affects all windows/buffers in it, and it
doesn't zoom the current buffer in other frames.
So it has different use cases from buffer zooming.
It's not what this bug report is about, but it
might be helpful info for Thomas in some contexts.)

Library `zoom-frm.el' provides frame-zooming
commands.
___

https://www.emacswiki.org/emacs/download/zoom-frm.el




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sun, 14 Jun 2020 17:24:01 GMT) Full text and rfc822 format available.

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

From: Thomas Hisch <thomas.hisch <at> ims.co.at>
To: Drew Adams <drew.adams <at> oracle.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Sun, 14 Jun 2020 19:23:06 +0200

On 6/14/20 6:28 PM, Drew Adams wrote:
>>> If the text is scaled (using `text-scale-increase`) in a
>>> `tabulated-list-mode` buffer, the text of the header is not scaled,
>>> which leads to a messed up (row data doesn't align with header row) buffer.
>>
>> text-scale-increase affects only the default face and faces that
>> inherit from it.  It isn't supposed to affect any other face, such as
>> the mode-line, the header-line, etc.
>>
>> So you are actually asking for a new feature of the
>> tabulated-list-mode, whereby it defines "C-x +" etc. to produce effect
>> specific to that mode.
>
> Sounds reasonable to expect that column headings
> remain over the columns they head.  We can call
> that an enhancement request or a bug to be fixed.
> ___
>
> Just an FYI, and not to take anything away from
> either the enhancement request or Eli's note above:
>
> There's another way to zoom in and out, which does
> affect also the header-line and mode-line, in which
> case the reported bug doesn't manifest - column
> headers remain over the columns: zoom the frame,
> not the buffer.
>
> (Another difference, however, is that zooming a
> frame affects all windows/buffers in it, and it
> doesn't zoom the current buffer in other frames.
> So it has different use cases from buffer zooming.
> It's not what this bug report is about, but it
> might be helpful info for Thomas in some contexts.)
>
> Library `zoom-frm.el' provides frame-zooming
> commands.

Thx, this seems to be a helpful library, although it was a bit tedious
to install (required two additional libs: frame-cmds.el, frame-fns.el).

> ___
>
> https://www.emacswiki.org/emacs/download/zoom-frm.el
>
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly prohibited.

IMS Nanofabrication GmbH FN: 208021 p, FB-Gericht: Wien; Sitz: Schreygasse 3, 1020, Vienna (Austria),Tel. +43 1 214 48 94; E-Mail: imsoffice <at> ims.co.at; DVR-Nr: 0374369; www.ims.co.at




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sun, 18 Oct 2020 23:35:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Thomas Hisch <thomas.hisch <at> ims.co.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Sun, 18 Oct 2020 16:34:23 -0700
[Message part 1 (text/plain, inline)]
tags 41852 + patch
thanks

Thomas Hisch <thomas.hisch <at> ims.co.at> writes:

>> So you are actually asking for a new feature of the
>> tabulated-list-mode, whereby it defines "C-x +" etc. to produce effect
>> specific to that mode.
>
> Yes it would be nice if text-scale-increase would properly rescale the
> header-line, especially since (setq tabulated-list-use-header-line t) is
> the default.

How about the attached patch?
[41852.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 18 Oct 2020 23:35:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Mon, 19 Oct 2020 14:20:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
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: Mon, 19 Oct 2020 17:19:52 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sun, 18 Oct 2020 16:34:23 -0700
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
> 
> How about the attached patch?

It's probably a good feature, but it has at least one caveat: setting
that variable non-nil will cause not only the header-line face to be
rescaled, it will also cause any face that inherits from header-line
to be rescaled.  Not sure if this is a problem, but it should be
called out in NEWS, at least.

> +** text-scale-mode
> +
> +---
> +*** text-scale-mode can adjust text height of header line face.
> +When the new buffer local variable 'text-scale-mode-header-line' is
> +non-nil, 'text-scale-adjust' (bound to 'C-x C-+' and 'C-x C--' by
> +default) will also change the text height of the header line face.
> +This feature is intended for use by Emacs Lisp package authors.

This should mention modes that arrange their display in tabular form
below the header-line, such as tabulated-list-mode and its
descendants.  Otherwise the last sentence and the goal of the feature
itself are left on a level that's too abstract.

> -(make-variable-buffer-local 'text-scale-mode-remapping)
> +(make-obsolete-variable 'text-scale-mode-remapping "no longer used." "28.1")
> +
> +(defvar text-scale-mode--remappings nil
> +  "List of current remapping cookies for `text-scale-mode'.")

Why this change?

> +(defvar text-scale-mode-header-line nil

I suggest to name this text-scale-remap-header-line-face.

> +  "If non-nil, also change text height of the header line.")

Not just height, the size.  Also, please say "`header-line' face", and
mention that all the faces that inherit from it will be affected as
well.

> +(defun face-remap--remap-face (sym)
> +  (push (face-remap-add-relative sym
> +                       :height
> +                       (expt text-scale-mode-step
> +                             text-scale-mode-amount))
> +        text-scale-mode--remappings))

I wonder whether this is all there is to it.  The display code doesn't
automatically use the remapped face in all cases, we need to code that
"by hand" in each and every case.  So far we've been doing that only
for the default face; I wonder if we'll have to do something similar
for header-line on the C level...  Please be sure to test this in
every possible way, including cursor motion around such rescaled
header-lines etc.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Mon, 19 Oct 2020 18:22:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 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: Mon, 19 Oct 2020 18:21:06 +0000
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> It's probably a good feature, but it has at least one caveat: setting
> that variable non-nil will cause not only the header-line face to be
> rescaled, it will also cause any face that inherits from header-line
> to be rescaled.  Not sure if this is a problem, but it should be
> called out in NEWS, at least.
[...]
> This should mention modes that arrange their display in tabular form
> below the header-line, such as tabulated-list-mode and its
> descendants.  Otherwise the last sentence and the goal of the feature
> itself are left on a level that's too abstract.

I've made an attempt to improve this in the attached.

>> -(make-variable-buffer-local 'text-scale-mode-remapping)
>> +(make-obsolete-variable 'text-scale-mode-remapping "no longer used." "28.1")
>> +
>> +(defvar text-scale-mode--remappings nil
>> +  "List of current remapping cookies for `text-scale-mode'.")
>
> Why this change?

This is to give the variable the correct plural form, and to mark it
internal by giving it the double dash.

>> +(defvar text-scale-mode-header-line nil
>
> I suggest to name this text-scale-remap-header-line-face.

Done.

>> +  "If non-nil, also change text height of the header line.")
>
> Not just height, the size.  Also, please say "`header-line' face", and
> mention that all the faces that inherit from it will be affected as
> well.

Done.

>> +(defun face-remap--remap-face (sym)
>> +  (push (face-remap-add-relative sym
>> +                       :height
>> +                       (expt text-scale-mode-step
>> +                             text-scale-mode-amount))
>> +        text-scale-mode--remappings))
>
> I wonder whether this is all there is to it.  The display code doesn't
> automatically use the remapped face in all cases, we need to code that
> "by hand" in each and every case.  So far we've been doing that only
> for the default face; I wonder if we'll have to do something similar
> for header-line on the C level...  Please be sure to test this in
> every possible way, including cursor motion around such rescaled
> header-lines etc.

I've done my best to test it some more, including cursor motion around
the adjusted header line, as well as scrolling the window left and right
and up and down (using mouse and keyboard).  I've not been able to
produce any failures so far.  Please let me know if you have any more
ideas for what I could do to try to break it.
[0001-Make-text-scale-mode-optionally-adjust-header-line-f.patch (text/x-diff, attachment)]
[0002-Set-text-scale-mode-header-line-in-tabulated-list-mo.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Mon, 19 Oct 2020 19:03:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
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: Mon, 19 Oct 2020 22:02:04 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Mon, 19 Oct 2020 18:21:06 +0000
> Cc: thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> 
> > This should mention modes that arrange their display in tabular form
> > below the header-line, such as tabulated-list-mode and its
> > descendants.  Otherwise the last sentence and the goal of the feature
> > itself are left on a level that's too abstract.
> 
> I've made an attempt to improve this in the attached.

LGTM, thanks.

> >> -(make-variable-buffer-local 'text-scale-mode-remapping)
> >> +(make-obsolete-variable 'text-scale-mode-remapping "no longer used." "28.1")
> >> +
> >> +(defvar text-scale-mode--remappings nil
> >> +  "List of current remapping cookies for `text-scale-mode'.")
> >
> > Why this change?
> 
> This is to give the variable the correct plural form, and to mark it
> internal by giving it the double dash.

Can we continue supporting text-scale-mode-remapping in
text-scale-mode--remappings?  I'd like to avoid backward-incompatible
changes if possible.

> >> +(defun face-remap--remap-face (sym)
> >> +  (push (face-remap-add-relative sym
> >> +                       :height
> >> +                       (expt text-scale-mode-step
> >> +                             text-scale-mode-amount))
> >> +        text-scale-mode--remappings))
> >
> > I wonder whether this is all there is to it.  The display code doesn't
> > automatically use the remapped face in all cases, we need to code that
> > "by hand" in each and every case.  So far we've been doing that only
> > for the default face; I wonder if we'll have to do something similar
> > for header-line on the C level...  Please be sure to test this in
> > every possible way, including cursor motion around such rescaled
> > header-lines etc.
> 
> I've done my best to test it some more, including cursor motion around
> the adjusted header line, as well as scrolling the window left and right
> and up and down (using mouse and keyboard).  I've not been able to
> produce any failures so far.  Please let me know if you have any more
> ideas for what I could do to try to break it.

Do mouse clicks work well, even if you click close to the edges of a
much-enlarged header-line?

Otherwise the changes look fine to me, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Mon, 19 Oct 2020 22:42:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 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: Mon, 19 Oct 2020 15:41:48 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> Can we continue supporting text-scale-mode-remapping in
> text-scale-mode--remappings?  I'd like to avoid backward-incompatible
> changes if possible.

Do you mean something like this?

diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 4d7be7d65a..377976782f 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -219,7 +219,8 @@ text-scale-mode-step

 ;; current remapping cookie for text-scale-mode
 (defvar text-scale-mode-remapping nil)
-(make-obsolete-variable 'text-scale-mode-remapping "no longer used." "28.1")
+(make-obsolete-variable 'text-scale-mode-remapping
+                        'text-scale-mode--remappings "28.1")

 (defvar text-scale-mode--remappings nil
   "List of current remapping cookies for `text-scale-mode'.")
@@ -239,8 +240,10 @@ text-scale-remap-header-line-face
 (make-variable-buffer-local 'text-scale-header-line)

 (defun face-remap--clear-remappings ()
-  (dolist (remapping text-scale-mode--remappings)
+  (dolist (remapping (cons text-scale-mode-remapping ; backwards-compatibility
+                           text-scale-mode--remappings))
     (face-remap-remove-relative remapping))
+  (setq text-scale-mode-remapping nil) ; backwards-compatibility
   (setq text-scale-mode--remappings nil))

 (defun face-remap--remap-face (sym)

> Do mouse clicks work well, even if you click close to the edges of a
> much-enlarged header-line?

This seems to work as expected, yes.  I've tested with both very large
and very small text sizes.

> Otherwise the changes look fine to me, thanks.

Thank you for reviewing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Tue, 20 Oct 2020 14:16:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
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: Tue, 20 Oct 2020 17:15:14 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Mon, 19 Oct 2020 15:41:48 -0700
> Cc: thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Can we continue supporting text-scale-mode-remapping in
> > text-scale-mode--remappings?  I'd like to avoid backward-incompatible
> > changes if possible.
> 
> Do you mean something like this?

Yes.  Except that now I'm asking whether we need to obsolete the
variable.  is that just because of the name?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Tue, 20 Oct 2020 14:41:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 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: Tue, 20 Oct 2020 14:40:17 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > Can we continue supporting text-scale-mode-remapping in
>> > text-scale-mode--remappings?  I'd like to avoid backward-incompatible
>> > changes if possible.
>>
>> Do you mean something like this?
>
> Yes.  Except that now I'm asking whether we need to obsolete the
> variable.  is that just because of the name?

I guess we could re-use the old name if we really want to.  But it would
still be a breaking change, since this is now a list instead of a single
value.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Tue, 20 Oct 2020 14:46:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
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: Tue, 20 Oct 2020 17:45:28 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Tue, 20 Oct 2020 14:40:17 +0000
> Cc: thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> 
> >> Do you mean something like this?
> >
> > Yes.  Except that now I'm asking whether we need to obsolete the
> > variable.  is that just because of the name?
> 
> I guess we could re-use the old name if we really want to.  But it would
> still be a breaking change, since this is now a list instead of a single
> value.

That's also easy to handle in a compatible way, right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Tue, 20 Oct 2020 19:11:01 GMT) Full text and rfc822 format available.

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

From: Thomas Hisch <thomas.hisch <at> ims.co.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>
Cc: 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Tue, 20 Oct 2020 21:10:04 +0200
Thx for working on a fix for this issue!

I've tried testing the patches, but without success. What I did was the
following:

start emacs -Q
M-x package-list-packages
M-x text-scale-increase

The text-scale-increase command doesn't have an effect on the scale of
the header line, but only on the scale of the date in the package table.

Does the above example rescale the font in the header line for you?

Regards,
Thomas
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly prohibited.

IMS Nanofabrication GmbH FN: 208021 p, FB-Gericht: Wien; Sitz: Schreygasse 3, 1020, Vienna (Austria),Tel. +43 1 214 48 94; E-Mail: imsoffice <at> ims.co.at; DVR-Nr: 0374369; www.ims.co.at




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 17:34:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 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: Thu, 29 Oct 2020 10:33:05 -0700
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > Yes.  Except that now I'm asking whether we need to obsolete the
>> > variable.  is that just because of the name?
>>
>> I guess we could re-use the old name if we really want to.  But it would
>> still be a breaking change, since this is now a list instead of a single
>> value.
>
> That's also easy to handle in a compatible way, right?

OK, here's what I propose.  I still suggest to make the old name into an
obsolete alias in order to mark it as internal, please let me know if
this is acceptable.
[0001-Make-text-scale-mode-optionally-adjust-header-line-f.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 17:44:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Thomas Hisch <thomas.hisch <at> ims.co.at>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Thu, 29 Oct 2020 10:43:49 -0700
Thomas Hisch <thomas.hisch <at> ims.co.at> writes:

> I've tried testing the patches, but without success. What I did was the
> following:

Thanks for testing!

> start emacs -Q
> M-x package-list-packages
> M-x text-scale-increase
>
> The text-scale-increase command doesn't have an effect on the scale of
> the header line, but only on the scale of the date in the package table.
>
> Does the above example rescale the font in the header line for you?

Yes, it works for me.  Strange.

My only guess is that there was something missing in the last diff I
sent.  Could you please try again using the latest patch I sent to this
thread?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 18:03:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Kangas <stefan <at> marxist.se>, 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: Thu, 29 Oct 2020 11:02:49 -0700 (PDT)
> OK, here's what I propose.  I still suggest to make the old name into an
> obsolete alias in order to mark it as internal, please let me know if
> this is acceptable.

Minor comments:

1. No need to mention this here: "(bound to 'C-x C-+'
   and 'C-x C--' by default)".  This is about what's
   new; it's not doc for the command.

2. "This feature is intended for..." sounds like it's
   intended _only_ for that use case.  I think you
   really want to point out that it is useful, _in
   particular_, for that use case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 18:16:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Drew Adams <drew.adams <at> oracle.com>, 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: Thu, 29 Oct 2020 11:15:25 -0700
Drew Adams <drew.adams <at> oracle.com> writes:

> Minor comments:
>
> 1. No need to mention this here: "(bound to 'C-x C-+'
>    and 'C-x C--' by default)".  This is about what's
>    new; it's not doc for the command.
>
> 2. "This feature is intended for..." sounds like it's
>    intended _only_ for that use case.  I think you
>    really want to point out that it is useful, _in
>    particular_, for that use case.

Thanks, I changed the text as follows:

*** text-scale-mode can now adjust font size of the 'header-line' face.
When the new buffer local variable 'text-scale-mode-header-line' is
non-nil, 'text-scale-adjust' will also change the text height of the
'header-line' face.  This will affect any face that inherits from it.

This feature is useful for major modes that arrange their display in a
tabular form below the header-line.  It is enabled by default in
'tabulated-list-mode' and its derived modes (such as the modes used by
'list-packages', 'list-buffers' and 'list-bookmarks).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 18:33:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Kangas <stefan <at> marxist.se>, 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: Thu, 29 Oct 2020 11:32:31 -0700 (PDT)
> Thanks, I changed the text as follows:
> 
> *** text-scale-mode can now adjust font size of the 'header-line' face.
> When the new buffer local variable 'text-scale-mode-header-line' is
> non-nil, 'text-scale-adjust' will also change the text height of the
> 'header-line' face.  This will affect any face that inherits from it.
> 
> This feature is useful for major modes that arrange their display in a
> tabular form below the header-line.  It is enabled by default in
> 'tabulated-list-mode' and its derived modes (such as the modes used by
> 'list-packages', 'list-buffers' and 'list-bookmarks).

LGTM; thx.

I'd suggest removing the text in parentheses.
NEWS items should generally be limited to what's new,
without additional explanation (unless it's important).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 18:48:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Drew Adams <drew.adams <at> oracle.com>, 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: Thu, 29 Oct 2020 11:47:45 -0700
Drew Adams <drew.adams <at> oracle.com> writes:

> I'd suggest removing the text in parentheses.
> NEWS items should generally be limited to what's new,
> without additional explanation (unless it's important).

OK, I'll do that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 19:38:01 GMT) Full text and rfc822 format available.

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

From: Thomas Hisch <thomas.hisch <at> ims.co.at>
To: Stefan Kangas <stefan <at> marxist.se>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Thu, 29 Oct 2020 20:37:46 +0100
[Message part 1 (text/plain, inline)]

On 29.10.20 18:43, Stefan Kangas wrote:
> Thomas Hisch <thomas.hisch <at> ims.co.at> writes:
>
>> I've tried testing the patches, but without success. What I did was the
>> following:
>
> Thanks for testing!
>

My pleasure!

>> start emacs -Q
>> M-x package-list-packages
>> M-x text-scale-increase
>>
>> The text-scale-increase command doesn't have an effect on the scale of
>> the header line, but only on the scale of the date in the package table.
>>
>> Does the above example rescale the font in the header line for you?
>
> Yes, it works for me.  Strange.
>
> My only guess is that there was something missing in the last diff I
> sent.  Could you please try again using the latest patch I sent to this
> thread?
>

You current patch seems to work - Great! There is still an issue when
the test-scale is increased multiple times, because the columns of the
header row don't align with the columns of the data rows. See the
attached image.

Regards
Thomas

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly prohibited.

IMS Nanofabrication GmbH FN: 208021 p, FB-Gericht: Wien; Sitz: Schreygasse 3, 1020, Vienna (Austria),Tel. +43 1 214 48 94; E-Mail: imsoffice <at> ims.co.at; DVR-Nr: 0374369; www.ims.co.at
[plp.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 29 Oct 2020 21:46:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Thomas Hisch <thomas.hisch <at> ims.co.at>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Thu, 29 Oct 2020 14:45:16 -0700
Thomas Hisch <thomas.hisch <at> ims.co.at> writes:

> You current patch seems to work - Great!

Excellent, thanks for testing.

> There is still an issue when the test-scale is increased multiple
> times, because the columns of the header row don't align with the
> columns of the data rows. See the attached image.

Indeed, this seems to be a limitation with the display property
:align-to space.  But it seems to be a separate, more general issue, so
I filed Bug#44315.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 08:02:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
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: Fri, 30 Oct 2020 10:01:09 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 29 Oct 2020 14:45:16 -0700
> Cc: 41852 <at> debbugs.gnu.org
> 
> > There is still an issue when the test-scale is increased multiple
> > times, because the columns of the header row don't align with the
> > columns of the data rows. See the attached image.
> 
> Indeed, this seems to be a limitation with the display property
> :align-to space.

As explained in bug#44315, this is not a limitation.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 08:55:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Kangas <stefan <at> marxist.se>, 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: Fri, 30 Oct 2020 09:54:38 +0100
> +default) will also change the text height of the 'header-line' face.

I'd prefer "font size" instead of "text height" here.  Also, I'd like to
see some clarification

(1) that only the size of the header line face for a buffer where
'text-scale-mode-header-line' has been set is affected (the line above
is IMHO too general to state this restriction),

(2) that text in the header line or elsewhere in such a buffer not
inheriting from (the remapped) header line face is unaffected, and

(3) whether and how existing customizations of the header line face are
taken into account.

Wrt (3) I assume that 'tabulated-list-mode' can already get derailed
when a user customizes header line face to use some large or small font
size (a scenario where face remapping is not involved at all).

Note that maybe 'text-scale-mode-header-line' should be also watched by
'set-buffer-redisplay'.

Thanks, martin





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 16:06:01 GMT) Full text and rfc822 format available.

Message #81 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: Fri, 30 Oct 2020 16:04:58 +0000
martin rudalics <rudalics <at> gmx.at> writes:

>  > +default) will also change the text height of the 'header-line' face.
>
> I'd prefer "font size" instead of "text height" here.

Fixed.

> Also, I'd like to see some clarification
>
> (1) that only the size of the header line face for a buffer where
> 'text-scale-mode-header-line' has been set is affected (the line above
> is IMHO too general to state this restriction),

Could you be more specific?  It already says it's buffer local, but it
seems like you think it should say something more?

Do you mean to be very explicit about it, like this?

  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.  This will also affect any
  face that inherits from it.

> (2) that text in the header line or elsewhere in such a buffer not
> inheriting from (the remapped) header line face is unaffected, and

I'm not sure I understand what you mean.  If text-scale-mode is enabled,
typically through running e.g. `text-scale-increase', the `default' face
is scaled.  The result, AFAICT, is that all faces in the buffer change
size (well, not the mode line).  And that makes sense since all other
implicitly inherits from it, right?

This works even for anonymous faces, e.g.:

   (progn
    (fundamental-mode)
    (insert (propertize "foo" 'face '(:height 1.5)))
    (text-scale-increase))

What am I missing?

> (3) whether and how existing customizations of the header line face are
> taken into account.
>
> Wrt (3) I assume that 'tabulated-list-mode' can already get derailed
> when a user customizes header line face to use some large or small font
> size (a scenario where face remapping is not involved at all).

I tried customizing the `Height' for the `header-line' face, and it
seems to work as expected:

With no text-scale-mode it is as big as it is customized to be.  When I
run `text-scale-increase', it scales up accordingly (relative to its
customized size).  So I don't know what, if anything, should be added
here.  Since it works as expected, perhaps there is nothing to add?

> Note that maybe 'text-scale-mode-header-line' should be also watched by
> 'set-buffer-redisplay'.

I tried adding `text-scale-remap-header-line-face' to the list of
variables that are fed to `add-variable-watcher' at the end of frame.el.
That doesn't work, unfortunately.

I believe that since the remapping is done on a Lisp level,
`text-scale-mode' isn't called even with a variable watcher.  Is there a
way to work around that?  Or am I doing it wrong?

Thanks for taking the time to review this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 17:38:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Kangas <stefan <at> marxist.se>, 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: Fri, 30 Oct 2020 18:37:35 +0100
> Could you be more specific?  It already says it's buffer local, but it
> seems like you think it should say something more?

IIUC one cannot "set" a face buffer-locally.  One has to emulate that
via face remapping.

> Do you mean to be very explicit about it, like this?
>
>    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".

>  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?

>> (2) that text in the header line or elsewhere in such a buffer not
>> inheriting from (the remapped) header line face is unaffected, and
>
> I'm not sure I understand what you mean.  If text-scale-mode is enabled,
> typically through running e.g. `text-scale-increase', the `default' face
> is scaled.

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.

> The result, AFAICT, is that all faces in the buffer change
> size (well, not the mode line).

The faces do not change size.  They just "appear" larger or smaller.
And mode, header and tab line are not part of the buffer, so face
remapping does not affect them.  So far - I wouldn't mind if your change
affected mode and tab line as well.

> And that makes sense since all other
> implicitly inherits from it, right?
>
> This works even for anonymous faces, e.g.:
>
>     (progn
>      (fundamental-mode)
>      (insert (propertize "foo" 'face '(:height 1.5)))
>      (text-scale-increase))
>
> What am I missing?

Inserting "foo" makes it part of the buffer text and thus subject to
text scaling ('text-scale-increase' needs an argument btw).

>> (3) whether and how existing customizations of the header line face are
>> taken into account.
>>
>> Wrt (3) I assume that 'tabulated-list-mode' can already get derailed
>> when a user customizes header line face to use some large or small font
>> size (a scenario where face remapping is not involved at all).
>
> I tried customizing the `Height' for the `header-line' face, and it
> seems to work as expected:
>
> With no text-scale-mode it is as big as it is customized to be.  When I
> run `text-scale-increase', it scales up accordingly (relative to its
> customized size).  So I don't know what, if anything, should be added
> here.  Since it works as expected, perhaps there is nothing to add?

OK.

>> Note that maybe 'text-scale-mode-header-line' should be also watched by
>> 'set-buffer-redisplay'.
>
> I tried adding `text-scale-remap-header-line-face' to the list of
> variables that are fed to `add-variable-watcher' at the end of frame.el.
> That doesn't work, unfortunately.
>
> I believe that since the remapping is done on a Lisp level,
> `text-scale-mode' isn't called even with a variable watcher.  Is there a
> way to work around that?  Or am I doing it wrong?

I'm not sure whether it's needed at all, Eli knows better.  I suppose it
should work out of the box because setting the header line format
already triggers 'set-buffer-redisplay' and the additional setting of
'text-scale-mode-header-line' will be covered by it.  We might have a
problem when these two are set in separate steps.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 18:55:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: rudalics <at> gmx.at, 41852 <at> debbugs.gnu.org, thomas.hisch <at> ims.co.at
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Fri, 30 Oct 2020 20:54:32 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 30 Oct 2020 16:04:58 +0000
> Cc: thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> 
> > (2) that text in the header line or elsewhere in such a buffer not
> > inheriting from (the remapped) header line face is unaffected, and
> 
> I'm not sure I understand what you mean.  If text-scale-mode is enabled,
> typically through running e.g. `text-scale-increase', the `default' face
> is scaled.  The result, AFAICT, is that all faces in the buffer change
> size (well, not the mode line).

No, only faces that inherit from 'default' are scaled.  And now so
will the faces that inherit from 'header-line'.

> And that makes sense since all other implicitly inherits from it,
> right?

No, not every face inherits from 'default', only those that inherit
explicitly.  A random face that is defined with defface isn't affected
by text-scale-*.

> This works even for anonymous faces, e.g.:
> 
>    (progn
>     (fundamental-mode)
>     (insert (propertize "foo" 'face '(:height 1.5)))
>     (text-scale-increase))
> 
> What am I missing?

See above.

> > Wrt (3) I assume that 'tabulated-list-mode' can already get derailed
> > when a user customizes header line face to use some large or small font
> > size (a scenario where face remapping is not involved at all).
> 
> I tried customizing the `Height' for the `header-line' face, and it
> seems to work as expected:
> 
> With no text-scale-mode it is as big as it is customized to be.  When I
> run `text-scale-increase', it scales up accordingly (relative to its
> customized size).  So I don't know what, if anything, should be added
> here.  Since it works as expected, perhaps there is nothing to add?

What Martin means, I think, is that using a larger font in header-line
face might make the text below the header line in tabulated-list-mode
fail to align.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 19:02:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: thomas.hisch <at> ims.co.at, stefan <at> marxist.se, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Fri, 30 Oct 2020 21:01:02 +0200
> Cc: thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> Date: Fri, 30 Oct 2020 18:37:35 +0100
> 
>  >> Note that maybe 'text-scale-mode-header-line' should be also watched by
>  >> 'set-buffer-redisplay'.
>  >
>  > I tried adding `text-scale-remap-header-line-face' to the list of
>  > variables that are fed to `add-variable-watcher' at the end of frame.el.
>  > That doesn't work, unfortunately.
>  >
>  > I believe that since the remapping is done on a Lisp level,
>  > `text-scale-mode' isn't called even with a variable watcher.  Is there a
>  > way to work around that?  Or am I doing it wrong?
> 
> I'm not sure whether it's needed at all, Eli knows better.  I suppose it
> should work out of the box because setting the header line format
> already triggers 'set-buffer-redisplay' and the additional setting of
> 'text-scale-mode-header-line' will be covered by it.  We might have a
> problem when these two are set in separate steps.

The way to check whether some variable needs to be watched is
described in a comment near the end of frame.el.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 20:24:02 GMT) Full text and rfc822 format available.

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

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

>> > (2) that text in the header line or elsewhere in such a buffer not
>> > inheriting from (the remapped) header line face is unaffected, and
>>
>> I'm not sure I understand what you mean.  If text-scale-mode is enabled,
>> typically through running e.g. `text-scale-increase', the `default' face
>> is scaled.  The result, AFAICT, is that all faces in the buffer change
>> size (well, not the mode line).
>
> No, only faces that inherit from 'default' are scaled.  And now so
> will the faces that inherit from 'header-line'.

When I use my patch in emacs -Q, say `M-x list-buffer' and then evaluate
this in that buffer:

(setq-local header-line-format (concat
                                (propertize "foo" 'face 'mode-line) " "
                                (propertize "bar" 'face 'bold)))

Both "foo" and "bar" in the header line is scaled with the rest of the
buffer.  But I don't think either of those faces inherits from the
header-line face.

Is this the scenario you had in mind?

>> And that makes sense since all other implicitly inherits from it,
>> right?
>
> No, not every face inherits from 'default', only those that inherit
> explicitly.

`(elisp) Basic Faces' says that they do:

  ‘default’
       The default face, whose attributes are all specified.  All other
       faces implicitly inherit from it: any unspecified attribute
       defaults to the attribute on this face (*note Face Attributes::).

So I'm not sure I understand what you are saying.  I'm probably still
missing something.

> A random face that is defined with defface isn't affected by
> text-scale-*.

What do you mean by "random face" here?  When I do this, the text "bar"
is scaled along with the rest:

(progn
  (defface foo-face '((t :weight bold)) "")
  (pop-to-buffer (get-buffer-create "*test*"))
  (insert "foo\n")
  (insert (propertize "bar\n" 'face 'foo-face))
  (insert "baz\n")
  (text-scale-increase 1))

Or could you give an example of where this does not happen?

>> This works even for anonymous faces, e.g.:
>>
>>    (progn
>>     (fundamental-mode)
>>     (insert (propertize "foo" 'face '(:height 1.5)))
>>     (text-scale-increase))
>>
>> What am I missing?
>
> See above.

Could you elaborate?  What I see is that this anonymous face is scaled.
Are you saying that you see something different?

>> > Wrt (3) I assume that 'tabulated-list-mode' can already get derailed
>> > when a user customizes header line face to use some large or small font
>> > size (a scenario where face remapping is not involved at all).
>>
>> I tried customizing the `Height' for the `header-line' face, and it
>> seems to work as expected:
>>
>> With no text-scale-mode it is as big as it is customized to be.  When I
>> run `text-scale-increase', it scales up accordingly (relative to its
>> customized size).  So I don't know what, if anything, should be added
>> here.  Since it works as expected, perhaps there is nothing to add?
>
> What Martin means, I think, is that using a larger font in header-line
> face might make the text below the header line in tabulated-list-mode
> fail to align.

Oh, okay.  Yes, that is true.

Is there anything we can or should do about that?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 30 Oct 2020 20:54:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: rudalics <at> gmx.at, 41852 <at> debbugs.gnu.org, thomas.hisch <at> ims.co.at
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Fri, 30 Oct 2020 22:53:01 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 30 Oct 2020 20:22:58 +0000
> Cc: rudalics <at> gmx.at, thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> 
> > No, only faces that inherit from 'default' are scaled.  And now so
> > will the faces that inherit from 'header-line'.
> 
> When I use my patch in emacs -Q, say `M-x list-buffer' and then evaluate
> this in that buffer:
> 
> (setq-local header-line-format (concat
>                                 (propertize "foo" 'face 'mode-line) " "
>                                 (propertize "bar" 'face 'bold)))
> 
> Both "foo" and "bar" in the header line is scaled with the rest of the
> buffer.  But I don't think either of those faces inherits from the
> header-line face.

Try using fixed-pitch and variable-pitch instead of mode-line and
bold.  What happens then?  And what does that mean for this
discussion?

> > No, not every face inherits from 'default', only those that inherit
> > explicitly.
> 
> `(elisp) Basic Faces' says that they do:
> 
>   ‘default’
>        The default face, whose attributes are all specified.  All other
>        faces implicitly inherit from it: any unspecified attribute
>        defaults to the attribute on this face (*note Face Attributes::).
> 
> So I'm not sure I understand what you are saying.

You said it yourself: "any _unspecified_ attribute".

> > A random face that is defined with defface isn't affected by
> > text-scale-*.
> 
> What do you mean by "random face" here?  When I do this, the text "bar"
> is scaled along with the rest:
> 
> (progn
>   (defface foo-face '((t :weight bold)) "")
>   (pop-to-buffer (get-buffer-create "*test*"))
>   (insert "foo\n")
>   (insert (propertize "bar\n" 'face 'foo-face))
>   (insert "baz\n")
>   (text-scale-increase 1))
> 
> Or could you give an example of where this does not happen?

I just did: fixed-pitch and variable-pitch.  Another example would be
any defface that specifies :height as an absolute number of 1/10
point.

> >>    (progn
> >>     (fundamental-mode)
> >>     (insert (propertize "foo" 'face '(:height 1.5)))
> >>     (text-scale-increase))
> >>
> >> What am I missing?
> >
> > See above.
> 
> Could you elaborate?  What I see is that this anonymous face is scaled.

Because you specified :height as 1.5 times the default, i.e. relative
to the default face.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 00:32:01 GMT) Full text and rfc822 format available.

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)))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 08:02:01 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Kangas <stefan <at> marxist.se>, 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 09:00:55 +0100
>> 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.

Silly me.  I obviously meant "header line" here.

>> 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.

By no means.  I just mentioned it to illustrate how elusive the text
scaling mechanism is.

>> 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.

Fully agreed.  That's why in NEWS I'd try to talk only about those
visual effects and skip any details of the underlying implementation
like faces, fonts and their scaling.

>> 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)))))

Something like that.  Here I have a comment in my private version of
face-remap.el that says

      ;; ... face-remapping first pushes an
      ;; entry to `face-remapping-alist' and then sets its cdr to the
      ;; modified value so our variable watcher won't catch the modified
      ;; value.  Such destructive operations are a general problem with
      ;; watching non-scalar variables.

but I can't tell whether it's directly related.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 08:31:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
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 10:29:48 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 29 Oct 2020 10:33:05 -0700
> Cc: thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> 
> >> > Yes.  Except that now I'm asking whether we need to obsolete the
> >> > variable.  is that just because of the name?
> >>
> >> I guess we could re-use the old name if we really want to.  But it would
> >> still be a breaking change, since this is now a list instead of a single
> >> value.
> >
> > That's also easy to handle in a compatible way, right?
> 
> OK, here's what I propose.  I still suggest to make the old name into an
> obsolete alias in order to mark it as internal, please let me know if
> this is acceptable.

I don't understand: I was asking to keep the variable and not make it
obsolete, but this patch does make it obsolete anyway.  What did I
miss?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 16:16:02 GMT) Full text and rfc822 format available.

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

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

> Try using fixed-pitch and variable-pitch instead of mode-line and
> bold.  What happens then?  And what does that mean for this
> discussion?

I tried this with my patch, in emacs -Q:

(progn
 (setq-local text-scale-remap-header-line-face t)
 (setq-local header-line-format (concat
                                 (propertize "foo" 'face 'fixed-pitch) " "
                                 (propertize "bar" 'face 'variable-pitch))))

They also scale.

> I just did: fixed-pitch and variable-pitch.  Another example would be
> any defface that specifies :height as an absolute number of 1/10
> point.

I find that text inserted into a buffer using the fixed-pitch and
variable-pitch both scale.  But if I specify :height to be an absolute
number, the text does not scale.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 16:27:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 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 09:25:54 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> OK, here's what I propose.  I still suggest to make the old name into an
>> obsolete alias in order to mark it as internal, please let me know if
>> this is acceptable.
>
> I don't understand: I was asking to keep the variable and not make it
> obsolete, but this patch does make it obsolete anyway.  What did I
> miss?

You didn't miss anything, you just didn't like my updated proposal.
I'll change it to match what you ask.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 16:49:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: rudalics <at> gmx.at, 41852 <at> debbugs.gnu.org, thomas.hisch <at> ims.co.at
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Sat, 31 Oct 2020 18:48:32 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 31 Oct 2020 09:15:23 -0700
> Cc: rudalics <at> gmx.at, thomas.hisch <at> ims.co.at, 41852 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Try using fixed-pitch and variable-pitch instead of mode-line and
> > bold.  What happens then?  And what does that mean for this
> > discussion?
> 
> I tried this with my patch, in emacs -Q:
> 
> (progn
>  (setq-local text-scale-remap-header-line-face t)
>  (setq-local header-line-format (concat
>                                  (propertize "foo" 'face 'fixed-pitch) " "
>                                  (propertize "bar" 'face 'variable-pitch))))
> 
> They also scale.

They don't scale obn my system, which is what I'd expect.  Maybe these
faces don't specify the font on some systems, but the principle is
nevertheless valid.

> > I just did: fixed-pitch and variable-pitch.  Another example would be
> > any defface that specifies :height as an absolute number of 1/10
> > point.
> 
> I find that text inserted into a buffer using the fixed-pitch and
> variable-pitch both scale.  But if I specify :height to be an absolute
> number, the text does not scale.

Which means your fixed-pitch and variable-pitch faces don't specify
the size of the font.  But otherwise what I said was correct, and
should be taken into account.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 16:51:01 GMT) Full text and rfc822 format available.

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

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

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> Try using fixed-pitch and variable-pitch instead of mode-line and
>> bold.  What happens then?  And what does that mean for this
>> discussion?
>
> I tried this with my patch, in emacs -Q:
>
> (progn
>  (setq-local text-scale-remap-header-line-face t)
>  (setq-local header-line-format (concat
>                                  (propertize "foo" 'face 'fixed-pitch) " "
>                                  (propertize "bar" 'face 'variable-pitch))))
>
> They also scale.

So looking at this, I'm not sure we should even say: "This will also
affect any face that inherits from it."  It risks confusing more than
helping, IMHO.

Nor am I so sure we should talk about the 'header-line' face.

I think we should say something closer to what Martin suggested, say:

  *** text-scale-mode can now scale the header line.
  When the new buffer local variable 'text-scale-remap-header-line-face'
  is non-nil, 'text-scale-adjust' will also scale the text in the header
  line when displaying that buffer.

  This is useful for major modes that arrange their display in a tabular
  form below the header-line.  It is therefore enabled by default in
  'tabulated-list-mode' and its derived modes.

  Note that text scaling never affects text using a face where the
  :height attribute is set to an absolute value.

And then adjust the docstring accordingly.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 16:59:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: stefan <at> marxist.se
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 18:57:59 +0200
> Date: Sat, 31 Oct 2020 18:48:32 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 41852 <at> debbugs.gnu.org, thomas.hisch <at> ims.co.at
> 
> > > I just did: fixed-pitch and variable-pitch.  Another example would be
> > > any defface that specifies :height as an absolute number of 1/10
> > > point.
> > 
> > I find that text inserted into a buffer using the fixed-pitch and
> > variable-pitch both scale.  But if I specify :height to be an absolute
> > number, the text does not scale.
> 
> Which means your fixed-pitch and variable-pitch faces don't specify
> the size of the font.  But otherwise what I said was correct, and
> should be taken into account.

And in any case, the scaling only affects the faces that are used to
display buffer text.  Other parts of the Emacs display, like display
margins and the mode line, aren't affected.  So the same face will
behave as scaled when it is on buffer text, and as unscaled elsewhere.
That's why we needed text-scale-remap-header-line-face in the first
place, right?  This is a subtlety that needs to be kept in mind, if
not made more widely known, when we are expecting that more and more
faces scale together with the default face.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Sat, 31 Oct 2020 17:57:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: stefan <at> marxist.se
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 19:55:38 +0200
> Date: Sat, 31 Oct 2020 18:48:32 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 41852 <at> debbugs.gnu.org, thomas.hisch <at> ims.co.at
> 
> > (progn
> >  (setq-local text-scale-remap-header-line-face t)
> >  (setq-local header-line-format (concat
> >                                  (propertize "foo" 'face 'fixed-pitch) " "
> >                                  (propertize "bar" 'face 'variable-pitch))))
> > 
> > They also scale.
> 
> They don't scale obn my system, which is what I'd expect.  Maybe these
> faces don't specify the font on some systems, but the principle is
> nevertheless valid.

No, that's because your patch is not yet in, so setting
text-scale-remap-header-line-face has no effect.  Sorry, I didn't
realize you haven't yet committed those changes.

In any case, the general point is valid: it is incorrect to assume
that every face used anywhere will scale with the buffer text.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Thu, 12 Nov 2020 22:26:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 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: Thu, 12 Nov 2020 17:25:17 -0500
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > (progn
>> >  (setq-local text-scale-remap-header-line-face t)
>> >  (setq-local header-line-format (concat
>> >                                  (propertize "foo" 'face 'fixed-pitch) " "
>> >                                  (propertize "bar" 'face 'variable-pitch))))
>> >
>> > They also scale.
>>
>> They don't scale obn my system, which is what I'd expect.  Maybe these
>> faces don't specify the font on some systems, but the principle is
>> nevertheless valid.
>
> No, that's because your patch is not yet in, so setting
> text-scale-remap-header-line-face has no effect.  Sorry, I didn't
> realize you haven't yet committed those changes.
>
> In any case, the general point is valid: it is incorrect to assume
> that every face used anywhere will scale with the buffer text.

What do you think of the attached patch?  It is along the lines of
what I suggested in a separate email, where I wrote:

> So looking at this, I'm not sure we should even say: "This will also
> affect any face that inherits from it."  It risks confusing more than
> helping, IMHO.
>
> Nor am I so sure we should talk about the 'header-line' face.
>
> I think we should say something closer to what Martin suggested, say:
>
>   *** text-scale-mode can now scale the header line.
>   When the new buffer local variable 'text-scale-remap-header-line-face'
>   is non-nil, 'text-scale-adjust' will also scale the text in the header
>   line when displaying that buffer.
>
>   This is useful for major modes that arrange their display in a tabular
>   form below the header-line.  It is therefore enabled by default in
>   'tabulated-list-mode' and its derived modes.
>
>   Note that text scaling never affects text using a face where the
>   :height attribute is set to an absolute value.
>
> And then adjust the docstring accordingly.

Do you think this is horribly wrong, or does it make sense?

Thanks in advance.
[0001-Make-text-scale-mode-optionally-adjust-the-header-li.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 13 Nov 2020 07:52:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
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: Fri, 13 Nov 2020 09:51:01 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 12 Nov 2020 17:25:17 -0500
> Cc: 41852 <at> debbugs.gnu.org, thomas.hisch <at> ims.co.at
> 
> > In any case, the general point is valid: it is incorrect to assume
> > that every face used anywhere will scale with the buffer text.
> 
> What do you think of the attached patch?

LGTM, but please wait for Martin and others to comment.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 13 Nov 2020 08:51:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Kangas <stefan <at> marxist.se>, 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: Fri, 13 Nov 2020 09:49:50 +0100
> +(defvar text-scale-remap-header-line nil
> +  "If non-nil, also change font size of the header line.")

I'd prefer something like the arguable a bit long

"If non-nil, text scaling may change font size of header lines too."

here.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 13 Nov 2020 14:02:01 GMT) Full text and rfc822 format available.

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

From: Jean Louis <bugs <at> gnu.support>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: thomas.hisch <at> ims.co.at, Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Fri, 13 Nov 2020 16:00:23 +0300
I am aware of problem that header in tabulated-list-mode did not
enlarge.

I have tried patching the current git but get problems. Please send me
the full tabulated-list.el that I can try it.

Loading file /home/data1/protected/Programming/Software/emacs/lisp/emacs-lisp/tabulated-list.el failed to provide feature ‘tabulated-list’
make[1]: *** [Makefile:817: bootstrap-emacs.pdmp] Error 255
make[1]: Leaving directory '/home/data1/protected/Programming/Software/emacs/src'
make: *** [Makefile:424: src] Error 2
[~/Programming/Software/emacs]

For your note I am using tabulated-list-mode with somewhat enlarged
faces from default. I would like to test that enhancement.

(define-derived-mode hyperscope-mode tabulated-list-mode "Hyperscope" "Major Hyperscope mode"
  (hyperscope-text-scale-adjust 'hyperscope-mode)
  (setq tabulated-list-format [("ID" 8 t :right-align t)
                               ("Hyperlink" 70 t)
                               ("Type" 10 t)])
  (setq tabulated-list-padding 1)
  ;; (setq tabulated-list-sort-key (cons "ID" nil))
  (tabulated-list-init-header))

(defun hyperscope-text-scale-adjust (symbol)
  (let ((adjust nil)) ;; TODO customize to turn off or on
    (if (and adjust (eql symbol 'hyperscope-mode))
	(text-scale-adjust 2)
      (if (and adjust (eql symbol 'hyperscope-text-view-mode))
      	  (text-scale-adjust 1)
	(if (and adjust (eql symbol 'hyperscope-org-view-mode))
	    (text-scale-adjust 1))))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 13 Nov 2020 14:33:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Jean Louis <bugs <at> gnu.support>
Cc: thomas.hisch <at> ims.co.at, Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Fri, 13 Nov 2020 06:32:03 -0800
Jean Louis <bugs <at> gnu.support> writes:

> I have tried patching the current git but get problems. Please send me
> the full tabulated-list.el that I can try it.
>
> Loading file /home/data1/protected/Programming/Software/emacs/lisp/emacs-lisp/tabulated-list.el failed to provide feature ‘tabulated-list’
> make[1]: *** [Makefile:817: bootstrap-emacs.pdmp] Error 255
> make[1]: Leaving directory '/home/data1/protected/Programming/Software/emacs/src'
> make: *** [Makefile:424: src] Error 2
> [~/Programming/Software/emacs]

I do not understand how my patch could cause this.  Is there no
`provide' statement in your tabulated-list.el?  Are you applying the
patch to an otherwise clean repository?

> For your note I am using tabulated-list-mode with somewhat enlarged
> faces from default. I would like to test that enhancement.

OK.  Note that your mode needs to contain this line for the feature to
work:

    (setq-local text-scale-remap-header-line t)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 13 Nov 2020 16:31:02 GMT) Full text and rfc822 format available.

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

From: Jean Louis <bugs <at> gnu.support>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: thomas.hisch <at> ims.co.at, Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Fri, 13 Nov 2020 18:33:27 +0300
I am confident it is not your patch causing it. It must be some of my
mistakes. I will try again.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 13 Nov 2020 16:51:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: github.com <at> gnu.support
Cc: thomas.hisch <at> ims.co.at, Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Fri, 13 Nov 2020 08:49:47 -0800
github.com <at> gnu.support writes:

> I wasn't really expecting that text scaling starts working by itself
> in tabulated-list-mode. That it does is fine.
>
> I have not changed anything and I could scale. You mentioned that I
> would need to make settings, I did not do any.

Sorry, I missed that your mode inherits from tabulated-list-mode, so as
you correctly observed it will work without any modifications.

> What I was expecting is that by doing the scaling that alignments
> remain in order. But they don't.
>
> OGV video 3.5M is here that shows how alignment of columns goes out of
> order in tabulated-list-mode:
> https://gnu.support/images/tmp/2020-11-13-18:56:31.ogv

I think this is Bug#44315.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Fri, 13 Nov 2020 17:13:01 GMT) Full text and rfc822 format available.

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

From: github.com <at> gnu.support
To: Stefan Kangas <stefan <at> marxist.se>
Cc: thomas.hisch <at> ims.co.at, Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50; text-scale commands don't scale header of
 tabulated-list-mode
Date: Fri, 13 Nov 2020 19:07:05 +0300
I wasn't really expecting that text scaling starts working by itself
in tabulated-list-mode. That it does is fine.

I have not changed anything and I could scale. You mentioned that I
would need to make settings, I did not do any.

What I was expecting is that by doing the scaling that alignments
remain in order. But they don't.

OGV video 3.5M is here that shows how alignment of columns goes out of
order in tabulated-list-mode:
https://gnu.support/images/tmp/2020-11-13-18:56:31.ogv

If you cannot see OGV video, maybe you may see screenshots:

Smaller scale, alignment of columns is out of order:
https://gnu.support/images/tmp/Screenshot%20from%202020-11-13%2019-03-59.jpg

Larger scale, alignment out of order:
https://gnu.support/images/tmp/Screenshot%20from%202020-11-13%2019-04-08.jpg

Jean




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Wed, 25 Nov 2020 02:09:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: martin rudalics <rudalics <at> gmx.at>
Cc: thomas.hisch <at> ims.co.at, Eli Zaretskii <eliz <at> gnu.org>, 41852 <at> debbugs.gnu.org
Subject: Re: bug#41852: 27.0.50;
 text-scale commands don't scale header of tabulated-list-mode
Date: Tue, 24 Nov 2020 18:08:07 -0800
martin rudalics <rudalics <at> gmx.at> writes:

>> +(defvar text-scale-remap-header-line nil
>> +  "If non-nil, also change font size of the header line.")
>
> I'd prefer something like the arguable a bit long
>
> "If non-nil, text scaling may change font size of header lines too."
>
> here.

Thank you, I'll change that before pushing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41852; Package emacs. (Wed, 25 Nov 2020 02:09:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 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: Tue, 24 Nov 2020 18:08:14 -0800
tags 41852 + fixed
close 41852
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

>> What do you think of the attached patch?
>
> LGTM, but please wait for Martin and others to comment.
>
> Thanks.

Thanks, I have fixed the patch according to Martin's comments.  There
have been no further comments within 11 days, so I've now pushed this to
master as commit 30c437752d.

I'm therefore closing this bug report.




Added tag(s) fixed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 25 Nov 2020 02:09:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 41852 <at> debbugs.gnu.org and Thomas Hisch <thomas.hisch <at> ims.co.at> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 25 Nov 2020 02:09:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 23 Dec 2020 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 96 days ago.

Previous Next


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