unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
@ 2008-10-25 21:44 Stephen Berman
  2008-10-25 22:17 ` Stephen Berman
  2016-01-09 21:55 ` Alan J Third
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Berman @ 2008-10-25 21:44 UTC (permalink / raw)
  To: emacs-pretest-bug

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@gmx.net> wrote:

> On Wed, 4 Jun 2008 16:35:41 +0200 "Juanma Barranquero" <lekktu@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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2008-10-25 21:44 bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust Stephen Berman
@ 2008-10-25 22:17 ` Stephen Berman
  2008-10-26 17:50   ` Juanma Barranquero
  2016-01-09 21:55 ` Alan J Third
  1 sibling, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2008-10-25 22:17 UTC (permalink / raw)
  To: 1255

On Sat, 25 Oct 2008 23:44:37 +0200 Stephen Berman <stephen.berman@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@gmx.net> wrote:
>
>> On Wed, 4 Jun 2008 16:35:41 +0200 "Juanma Barranquero" <lekktu@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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2008-10-25 22:17 ` Stephen Berman
@ 2008-10-26 17:50   ` Juanma Barranquero
  2008-10-27  2:59     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Juanma Barranquero @ 2008-10-26 17:50 UTC (permalink / raw)
  To: Stephen Berman, 1255

On Sat, Oct 25, 2008 at 23:17, Stephen Berman <stephen.berman@gmx.net> wrote:
> On Sat, 25 Oct 2008 23:44:37 +0200 Stephen Berman <stephen.berman@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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2008-10-26 17:50   ` Juanma Barranquero
@ 2008-10-27  2:59     ` Stefan Monnier
  2008-10-27 10:08       ` Juanma Barranquero
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2008-10-27  2:59 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 1255, Stephen Berman

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







^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2008-10-27  2:59     ` Stefan Monnier
@ 2008-10-27 10:08       ` Juanma Barranquero
  2008-10-27 19:22         ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Juanma Barranquero @ 2008-10-27 10:08 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 1255

On Mon, Oct 27, 2008 at 03:59, Stefan Monnier <monnier@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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2008-10-27 10:08       ` Juanma Barranquero
@ 2008-10-27 19:22         ` Stefan Monnier
  2008-10-27 22:18           ` Juanma Barranquero
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2008-10-27 19:22 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 1255

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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2008-10-27 19:22         ` Stefan Monnier
@ 2008-10-27 22:18           ` Juanma Barranquero
  0 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2008-10-27 22:18 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 1255

On Mon, Oct 27, 2008 at 20:22, Stefan Monnier <monnier@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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2008-10-25 21:44 bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust Stephen Berman
  2008-10-25 22:17 ` Stephen Berman
@ 2016-01-09 21:55 ` Alan J Third
  2016-01-10 15:40   ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Alan J Third @ 2016-01-09 21:55 UTC (permalink / raw)
  To: 1255


(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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust
  2016-01-09 21:55 ` Alan J Third
@ 2016-01-10 15:40   ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2016-01-10 15:40 UTC (permalink / raw)
  To: Alan J Third; +Cc: 1255

> From: Alan J Third <alan@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-10 15:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-25 21:44 bug#1255: 23.0.60; linum-mode: no update after text-scale-adjust Stephen Berman
2008-10-25 22:17 ` Stephen Berman
2008-10-26 17:50   ` Juanma Barranquero
2008-10-27  2:59     ` Stefan Monnier
2008-10-27 10:08       ` Juanma Barranquero
2008-10-27 19:22         ` Stefan Monnier
2008-10-27 22:18           ` Juanma Barranquero
2016-01-09 21:55 ` Alan J Third
2016-01-10 15:40   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).