GNU bug report logs - #10960
linum-mode does not work properly when changing font size

Previous Next

Package: emacs;

Reported by: Le Wang <l26wang <at> gmail.com>

Date: Tue, 6 Mar 2012 16:29:01 UTC

Severity: normal

Merged with 1255, 8379

Fixed in version 25.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: lekktu <at> gmail.com, 10960 <at> debbugs.gnu.org, l26wang <at> gmail.com
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 <monnier <at> iro.umontreal.ca>
> Cc: lekktu <at> gmail.com,  10960 <at> debbugs.gnu.org,  l26wang <at> gmail.com
> 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
engine.

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

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




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.