GNU bug report logs - #1255
23.0.60; linum-mode: no update after text-scale-adjust

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Sat, 25 Oct 2008 22:00:03 UTC

Severity: normal

Merged with 8379, 10960

Fixed in version 25.1

Done: Alan J Third <alan <at> idiocy.org>

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 1255 in the body.
You can then email your comments to 1255 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Sat, 25 Oct 2008 23:44:37 +0200
Adding this to the bug tracker; I still see it in GNU Emacs 23.0.60.12
(i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2008-10-25 on escher.  (I
also still see the problem Juanma Barranquero pointed out.)


On Wed, 04 Jun 2008 20:38:07 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:

> On Wed, 4 Jun 2008 16:35:41 +0200 "Juanma Barranquero" <lekktu <at> gmail.com> wrote:
>
>> Testing face-remap with linum-mode, a small limitation does show up:
>> margin width is computed in character cells (according to the docs of
>> `set-window-margins'), but obviously it does not take
>> `face-remapping-alist' into account.
>
> This also reveals a linum bug: linum-mode fails to update the display
> when the font size changes.  E.g., with linum-mode enabled type C-x C--
> and then there is text at the bottom of the the window with no line
> numbering in the margin (if the text in the buffer is long enough).
>
> Steve Berman




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at 1255 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: 1255 <at> debbugs.gnu.org
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Sun, 26 Oct 2008 00:17:40 +0200
On Sat, 25 Oct 2008 23:44:37 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:

> Adding this to the bug tracker; I still see it in GNU Emacs 23.0.60.12
> (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2008-10-25 on escher.  (I
> also still see the problem Juanma Barranquero pointed out.)

I forgot to give a reference for this; see
<http://permalink.gmane.org/gmane.emacs.devel/98414>.

> On Wed, 04 Jun 2008 20:38:07 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:
>
>> On Wed, 4 Jun 2008 16:35:41 +0200 "Juanma Barranquero" <lekktu <at> gmail.com> wrote:
>>
>>> Testing face-remap with linum-mode, a small limitation does show up:
>>> margin width is computed in character cells (according to the docs of
>>> `set-window-margins'), but obviously it does not take
>>> `face-remapping-alist' into account.
>>
>> This also reveals a linum bug: linum-mode fails to update the display
>> when the font size changes.  E.g., with linum-mode enabled type C-x C--
>> and then there is text at the bottom of the the window with no line
>> numbering in the margin (if the text in the buffer is long enough).
>>
>> Steve Berman




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Juanma Barranquero" <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #15 received at 1255 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Juanma Barranquero" <lekktu <at> gmail.com>
To: "Stephen Berman" <stephen.berman <at> gmx.net>, 1255 <at> debbugs.gnu.org
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Sun, 26 Oct 2008 18:50:24 +0100
On Sat, Oct 25, 2008 at 23:17, Stephen Berman <stephen.berman <at> gmx.net> wrote:
> On Sat, 25 Oct 2008 23:44:37 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:
>
>> Adding this to the bug tracker; I still see it in GNU Emacs 23.0.60.12
>> (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2008-10-25 on escher.  (I
>> also still see the problem Juanma Barranquero pointed out.)
>
> I forgot to give a reference for this; see
> <http://permalink.gmane.org/gmane.emacs.devel/98414>.

FWIW, the problem I pointed out is not linum's, but either a
limitation of the way text-scale-adjust is implemented, or a redisplay
bug. Linum just happens to be a good way to show it off.

   Juanma




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #20 received at 1255 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 1255 <at> debbugs.gnu.org, "Stephen Berman" <stephen.berman <at> gmx.net>
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Sun, 26 Oct 2008 22:59:07 -0400
>>> Adding this to the bug tracker; I still see it in GNU Emacs 23.0.60.12
>>> (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2008-10-25 on escher.  (I
>>> also still see the problem Juanma Barranquero pointed out.)
>> 
>> I forgot to give a reference for this; see
>> <http://permalink.gmane.org/gmane.emacs.devel/98414>.

> FWIW, the problem I pointed out is not linum's, but either a
> limitation of the way text-scale-adjust is implemented, or a redisplay
> bug. Linum just happens to be a good way to show it off.

What makes you think so?


        Stefan





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Juanma Barranquero" <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #25 received at 1255 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Juanma Barranquero" <lekktu <at> gmail.com>
To: "Stefan Monnier" <monnier <at> iro.umontreal.ca>
Cc: 1255 <at> debbugs.gnu.org
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Mon, 27 Oct 2008 11:08:15 +0100
On Mon, Oct 27, 2008 at 03:59, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

>> FWIW, the problem I pointed out is not linum's, but either a
>> limitation of the way text-scale-adjust is implemented, or a redisplay
>> bug. Linum just happens to be a good way to show it off.
>
> What makes you think so?

ELISP> (let ((ov (make-overlay (point) (point)))
             (str "01234"))
         (set-window-margins (selected-window) (length str))
         (overlay-put ov 'before-string (propertize " " 'display
`((margin left-margin) ,str)))
         nil)
nil
ELISP> (text-scale-increase 3)
t

And the "01234" text in the window margin is no longer entirely
visible. I.e., `set-window-margins' sets the margin width in
"character cells", and its pixel width does not vary when the
character size is increased by `text-scale-increaase' and friends.
This is unrelated to linum.el, AFAICS.

  Juanma




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #30 received at 1255 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Juanma Barranquero" <lekktu <at> gmail.com>
Cc: 1255 <at> debbugs.gnu.org
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Mon, 27 Oct 2008 15:22:16 -0400
>>> FWIW, the problem I pointed out is not linum's, but either a
>>> limitation of the way text-scale-adjust is implemented, or a redisplay
>>> bug. Linum just happens to be a good way to show it off.
>> What makes you think so?

ELISP> (let ((ov (make-overlay (point) (point)))
>              (str "01234"))
>          (set-window-margins (selected-window) (length str))
>          (overlay-put ov 'before-string (propertize " " 'display
> `((margin left-margin) ,str)))
>          nil)
> nil
ELISP> (text-scale-increase 3)
> t

> And the "01234" text in the window margin is no longer entirely
> visible. I.e., `set-window-margins' sets the margin width in
> "character cells", and its pixel width does not vary when the
> character size is increased by `text-scale-increaase' and friends.
> This is unrelated to linum.el, AFAICS.

Oh, now I understand.  Then your problem is not a bug but a feature:
text-scale-adjust is specifically meant to change the size of the text
but nothing else.  If you want to change the size of the text and the
rest, then you want to use something else (e.g. customize the `default'
face).

So, yes, the problem lies somewhat in linum-mode which should resize the
margin accordingly, tho it's far from easy for it to do so (and it can
only do it in increments of the base default font size).


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Juanma Barranquero" <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #35 received at 1255 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Juanma Barranquero" <lekktu <at> gmail.com>
To: "Stefan Monnier" <monnier <at> iro.umontreal.ca>
Cc: 1255 <at> debbugs.gnu.org
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Mon, 27 Oct 2008 23:18:34 +0100
On Mon, Oct 27, 2008 at 20:22, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> Oh, now I understand.  Then your problem is not a bug but a feature:
> text-scale-adjust is specifically meant to change the size of the text
> but nothing else.

Well, it changes the size of the buffer text *and* the margin text...

> If you want to change the size of the text and the
> rest, then you want to use something else (e.g. customize the `default'
> face).

That would not work for several buffers.

> So, yes, the problem lies somewhat in linum-mode which should resize the
> margin accordingly

For specific uses of linum, you can use `linum-format' and
`linum-before-numbering-hook' to set a face of right size, or any
other workaround.

But the issue will still be present for any package that puts
information into the window margin, so it is not linum-mode specific.

> tho it's far from easy for it to do so (and it can
> only do it in increments of the base default font size).

That's the real problem, IMO.

             Juanma




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1255; Package emacs. (Wed, 18 Feb 2009 00:00:07 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: nixie <onixie <at> gmail.com>
Cc: 8379 <at> debbugs.gnu.org
Subject: Re: bug#8379: The width of linum window is not adjusted after
	face-remapping
Date: Wed, 30 Mar 2011 12:39:16 +0200
forcemerge 1255 8379
thanks

> I found that the width of linum window is not changed with
> (text-scale-increase) or (text-scale-decrease) function.

This is bug#1255: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1255

    Juanma




Merged 1255 8379 10960. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 06 Mar 2012 17:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#1255; Package emacs. (Sat, 09 Jan 2016 21:57:01 GMT) Full text and rfc822 format available.

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

From: Alan J Third <alan <at> idiocy.org>
To: 1255 <at> debbugs.gnu.org
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Sat, 09 Jan 2016 21:55:51 +0000
(let ((ov (make-overlay (point) (point)))
      (str "01234"))
  (set-window-margins (selected-window) (length str))
  (overlay-put ov 'before-string
               (propertize " " 'display
                           `((margin left-margin) ,str)))
  nil)

(text-scale-increase 3)

Using the above code from Juanma shows this is still an issue in 25.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#1255; Package emacs. (Sun, 10 Jan 2016 15:41:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan J Third <alan <at> idiocy.org>
Cc: 1255 <at> debbugs.gnu.org
Subject: Re: bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
Date: Sun, 10 Jan 2016 17:40:22 +0200
> From: Alan J Third <alan <at> idiocy.org>
> Date: Sat, 09 Jan 2016 21:55:51 +0000
> 
> (let ((ov (make-overlay (point) (point)))
>       (str "01234"))
>   (set-window-margins (selected-window) (length str))
>   (overlay-put ov 'before-string
>                (propertize " " 'display
>                            `((margin left-margin) ,str)))
>   nil)
> 
> (text-scale-increase 3)
> 
> Using the above code from Juanma shows this is still an issue in 25.

Thanks for re-testing.

However, my analysis of this bug is different: unlike with the
original report, typing "C-x -" when linum-mode is enabled does now
recompute and update the width of the margin (and not surprisingly so:
linum.el now uses pixel dimensions and converts them to character
cells using the current canonical character width, which does account
for rescaling).  Evaluating

  (text-scale-increase 3)

when linum-mode is enabled also does TRT.  The only thing that fails
to adjust the margin is the above snippet, but I submit that it's the
problem of the snippet, since window margins are never changed by the
display engine on its own, they were always controlled by Lisp
applications.

So I think we can safely close this bug as done.

Thanks.




bug marked as fixed in version 25.1, send any further explanations to 1255 <at> debbugs.gnu.org and Stephen Berman <stephen.berman <at> gmx.net> Request was from Alan J Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Sun, 10 Jan 2016 20:17:01 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. (Mon, 08 Feb 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 129 days ago.

Previous Next


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