all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: lekktu@gmail.com, 10960@debbugs.gnu.org, l26wang@gmail.com
Subject: bug#10960: linum-mode does not work properly when changing font size
Date: Sat, 10 Mar 2012 23:50:12 +0200	[thread overview]
Message-ID: <83lin8xh0r.fsf@gnu.org> (raw)
In-Reply-To: <jwvpqckz51l.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>,  10960@debbugs.gnu.org,  l26wang@gmail.com
> Date: Sat, 10 Mar 2012 13:28:52 -0500
> 
> > The problem with that answer is that it is maximally unhelpful.  Every
> > package that wants to use the margin will have to be defensively coded
> > against text-scale-*.
> 
> You mean, that text-scale-* makes the problem more common significant?
> Maybe so, yes.  But I don't think that just special-handling
> text-scale-* would be a good solution.

Special-casing it was not what I had in mind.

> We need some more general way to adjust the size of the margin to
> the size of the images&text displayed there, so as to handle
> non-default faces, proportional text, ...

It all boils down to calculating the size of the margins in pixels.
The key to that is window_box_width, which uses
WINDOW_FRAME_COLUMN_WIDTH to convert columns into pixels, and
WINDOW_FRAME_COLUMN_WIDTH returns the "canonical" width of a column,
which is an average width of the default face's font.

So all it takes is to make that calculation aware of face remapping,
images displayed in the margin, etc.





  reply	other threads:[~2012-03-10 21:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 16:27 bug#10960: linum-mode does not work properly when changing font size Le Wang
2012-03-06 17:07 ` Glenn Morris
2012-03-06 18:11   ` Eli Zaretskii
2012-03-06 21:05     ` Juanma Barranquero
2012-03-10  9:59     ` Eli Zaretskii
2012-03-10 14:38       ` Stefan Monnier
2012-03-10 15:06         ` Eli Zaretskii
2012-03-10 15:38           ` Juanma Barranquero
2012-03-10 17:18             ` Eli Zaretskii
2012-03-10 18:28             ` Stefan Monnier
2012-03-10 21:50               ` Eli Zaretskii [this message]
2012-03-11  1:36                 ` Stefan Monnier
2012-03-11  3:57                   ` Eli Zaretskii
2012-03-11 14:37                     ` Stefan Monnier
2012-03-11 17:14                       ` Eli Zaretskii
2012-03-12  1:54                         ` Stefan Monnier
2012-03-13 19:35                           ` Eli Zaretskii
2012-03-11 16:01               ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lin8xh0r.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=10960@debbugs.gnu.org \
    --cc=l26wang@gmail.com \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.