[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10960: linum-mode does not work properly when changing font size

From: Eli Zaretskii
Subject: bug#10960: linum-mode does not work properly when changing font size
Date: Sun, 11 Mar 2012 19:14:07 +0200

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden,  address@hidden,  address@hidden
> Date: Sun, 11 Mar 2012 10:37:45 -0400
> The way I see it, set-window-margins can only set the margin's size
> either to "no margin" or to a fixed size given as an integer.

That's correct, but all set-window-margins does is set two attributes
of the window object.  How to use that is entirely up to the display

When the time comes to display the window, the margins come into play
through the pixel coordinates where we draw the fringe bitmap.  The
code which computes those coordinates eventually calls
window_box_left_offset or window_box_right_offset, which call
window_box_width.  The latter is the single place in the code, AFAICS,
that converts the margin width from character cell units to pixel

> So you'd have to let the Elisp code somehow figure out the *display*
> size of the margin's text (either in pixels or in
> char-cell-equivalent), and I don't know of any way Elisp can do that
> currently.

I didn't suggest to do this in Lisp.  (I don't think Lisp programs
should control the display at this low level.)  What I suggested is to
modify the calculation of the fringe pixel position based on how many
pixels are actually needed for the glyphs (character glyphs, stretch
glyphs, image glyphs, etc.) displayed in the fringe.  Isn't that what
you wanted?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]