From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#10960: linum-mode does not work properly when changing font size Date: Sat, 10 Mar 2012 23:50:12 +0200 Message-ID: <83lin8xh0r.fsf@gnu.org> References: <83hay1a9b4.fsf@gnu.org> <838vj8zsht.fsf@gnu.org> <83vcmcxzq9.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1331416231 17283 80.91.229.3 (10 Mar 2012 21:50:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Mar 2012 21:50:31 +0000 (UTC) Cc: lekktu@gmail.com, 10960@debbugs.gnu.org, l26wang@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 10 22:50:28 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S6UBH-00058I-PJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Mar 2012 22:50:27 +0100 Original-Received: from localhost ([::1]:43776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6UBH-0002bc-7p for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Mar 2012 16:50:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6UBD-0002b6-MH for bug-gnu-emacs@gnu.org; Sat, 10 Mar 2012 16:50:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6UBB-000801-Qr for bug-gnu-emacs@gnu.org; Sat, 10 Mar 2012 16:50:23 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6UBB-0007zo-Nc for bug-gnu-emacs@gnu.org; Sat, 10 Mar 2012 16:50:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S6Udu-0006wx-6Q for bug-gnu-emacs@gnu.org; Sat, 10 Mar 2012 17:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Mar 2012 22:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10960 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10960-submit@debbugs.gnu.org id=B10960.133141799426698 (code B ref 10960); Sat, 10 Mar 2012 22:20:02 +0000 Original-Received: (at 10960) by debbugs.gnu.org; 10 Mar 2012 22:19:54 +0000 Original-Received: from localhost ([127.0.0.1]:44029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6Udl-0006wY-CX for submit@debbugs.gnu.org; Sat, 10 Mar 2012 17:19:54 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:59187) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6Udf-0006wL-N1 for 10960@debbugs.gnu.org; Sat, 10 Mar 2012 17:19:50 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M0O00G00V8LFM00@a-mtaout23.012.net.il> for 10960@debbugs.gnu.org; Sat, 10 Mar 2012 23:50:04 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.138.42]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M0O00G56VBFE190@a-mtaout23.012.net.il>; Sat, 10 Mar 2012 23:50:04 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57655 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , 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.