From unknown Sat Aug 16 18:45:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Resent-From: Shigeru Fukaya Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jun 2014 17:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17813@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140319877919679 (code B ref -1); Thu, 19 Jun 2014 17:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jun 2014 17:26:19 +0000 Received: from localhost ([127.0.0.1]:53367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wxg6H-00057D-Ox for submit@debbugs.gnu.org; Thu, 19 Jun 2014 13:26:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41168) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wxg69-00056d-5X for submit@debbugs.gnu.org; Thu, 19 Jun 2014 13:26:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxg5v-0000Vm-0A for submit@debbugs.gnu.org; Thu, 19 Jun 2014 13:25:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, FSL_HELO_FAKE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxg5u-0000Ve-Sq for submit@debbugs.gnu.org; Thu, 19 Jun 2014 13:25:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxg5l-00050O-NO for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 13:25:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxg5c-0000U6-Kg for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 13:25:41 -0400 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]:40578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxg5c-0000U2-48 for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 13:25:32 -0400 Received: by mail-pa0-f52.google.com with SMTP id eu11so2138317pac.11 for ; Thu, 19 Jun 2014 10:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:mime-version:content-type:message-id; bh=wULJJLOZZgRSCD4hSoCG4Xwu1mRZVhvy+nnNA1iD17U=; b=mcfacKNuJgyvJkIZqlHEKRBNCl6lsdnG6L1onQi/HLFO16r4udx6axclFMR7vb4xtK enKEKAEndPshgezCarVtdJQqmgn16D3VMn3JBqaWNuMgKlA26qv7zcYy+2T1mcjqs7q0 QDBoEytRiiWn3xLPzz5Ft3yZNKEmcMwSAjLdn1mKpsJ5zmZTlTlWcGKlYLkEXAsFf88/ o+drlMr91QGlwbx+ZGz+cIKxzPR9VFwURhFw5Zr9DLBMTyD8jBayznrOa4iDjNRwnVSg vybtsKxUyg3b4wL3v3Q0wHRcoOtcJfo+QYTEXmc0tsIMf+c8ezinyjCcBBjzmK9pjhyC WTLg== X-Received: by 10.68.178.131 with SMTP id cy3mr7513095pbc.146.1403198730741; Thu, 19 Jun 2014 10:25:30 -0700 (PDT) Received: from gmail.com (115x125x38x6.ap115.ftth.ucom.ne.jp. [115.125.38.6]) by mx.google.com with ESMTPSA id vc5sm29806476pac.19.2014.06.19.10.25.28 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jun 2014 10:25:29 -0700 (PDT) From: Shigeru Fukaya Date: Fri, 20 Jun 2014 02:25:28 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-CreAmhv2SrEBq1CizvNea" X-Mailer: HidemaruMail 6.24 (WinNT,602) Message-Id: <37CF8BE3769E04shigeru.fukaya@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --Boundary-CreAmhv2SrEBq1CizvNea Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Font size of line numbers by `linum-mode' follow `text-scale-adjust', though the size of left margin doesn't change. (nlinum also has the same problem) The possible solutions are, (1) To change the width of left margin for line numbers. [attached patch] (2) To fix the font size of line numbers. (set-face-attribute 'linum nil :height (face-attribute 'linum :height nil t)) Solution (2) may need more in case of multi frames with different font size. Regards, Shigeru --Boundary-CreAmhv2SrEBq1CizvNea Content-Type: application/octet-stream; name="linum.diff" Content-Disposition: attachment; filename="linum.diff" Content-Transfer-Encoding: base64 LS0tIG9yaWcvbGludW0uZWwJMjAxNC0wMy0yMSAxNDozNDo0MC4wMDAwMDAwMDAgKzA5MDAK KysrIC4vbGludW0uZWwJMjAxNC0wNi0yMCAwMjoxMzo1NS4wMjM5MzM0MDAgKzA5MDAKQEAg LTE3OCw2ICsxNzgsMTAgQEAgTGludW0gbW9kZSBpcyBhIGJ1ZmZlci1sb2NhbCBtaW5vciBt b2RlLgogICAgICAgKGxldCAoKGluaGliaXQtcG9pbnQtbW90aW9uLWhvb2tzIHQpKQogICAg ICAgICAoZm9yd2FyZC1saW5lKSkKICAgICAgIChzZXRxIGxpbmUgKDErIGxpbmUpKSkKKyAg ICAod2hlbiAoYW5kIGZhY2UtcmVtYXBwaW5nLWFsaXN0IChib3VuZC1hbmQtdHJ1ZS1wIGxp bnVtLW1vZGUpKQorICAgICAgKGxldCAoKGggKGNhZHIgKGFzc3EgOmhlaWdodCAoYXNzcSAn ZGVmYXVsdCBmYWNlLXJlbWFwcGluZy1hbGlzdCkpKSkpCisJKHdoZW4gKG51bWJlcnAgaCkK KwkgIChzZXRxIHdpZHRoIChjZWlsaW5nICgqIHdpZHRoIGgpKSkpKSkKICAgICAoc2V0LXdp bmRvdy1tYXJnaW5zIHdpbiB3aWR0aCAoY2RyICh3aW5kb3ctbWFyZ2lucyB3aW4pKSkpKQog CiAoZGVmdW4gbGludW0tYWZ0ZXItY2hhbmdlIChiZWcgZW5kIF9sZW4pCg== --Boundary-CreAmhv2SrEBq1CizvNea-- From unknown Sat Aug 16 18:45:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jun 2014 18:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Shigeru Fukaya Cc: 17813@debbugs.gnu.org, miles@gnu.org Received: via spool by 17813-submit@debbugs.gnu.org id=B17813.140320361827562 (code B ref 17813); Thu, 19 Jun 2014 18:47:02 +0000 Received: (at 17813) by debbugs.gnu.org; 19 Jun 2014 18:46:58 +0000 Received: from localhost ([127.0.0.1]:53432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxhMO-0007AT-Tm for submit@debbugs.gnu.org; Thu, 19 Jun 2014 14:46:57 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:52300) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxhMM-0007AF-Uk for 17813@debbugs.gnu.org; Thu, 19 Jun 2014 14:46:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJC6HVgjSGReOegeEOAEDqRmBaoNMIQ X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJC6HVgjSGReOegeEOAEDqRmBaoNMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="68358080" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 19 Jun 2014 14:46:48 -0400 Received: by pastel.home (Postfix, from userid 20848) id BA0CE60D16; Thu, 19 Jun 2014 14:46:48 -0400 (EDT) From: Stefan Monnier Message-ID: References: <37CF8BE3769E04shigeru.fukaya@gmail.com> Date: Thu, 19 Jun 2014 14:46:48 -0400 In-Reply-To: <37CF8BE3769E04shigeru.fukaya@gmail.com> (Shigeru Fukaya's message of "Fri, 20 Jun 2014 02:25:28 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Font size of line numbers by `linum-mode' follow `text-scale-adjust', though > the size of left margin doesn't change. > (nlinum also has the same problem) > The possible solutions are, > (1) To change the width of left margin for line numbers. > (2) To fix the font size of line numbers. I think the right solution is to scale the margin width by the ratio "linum font size / base font size". Then users can set their `linum' face the way want and choose between (1) and (2). But it turns out that face-attribute can't be used for that because it does not pay attention to face-remapping-alist. Miles, Eli, others, do you know of a function that returns "the font size, including face-remapping-alist effects"? Stefan From unknown Sat Aug 16 18:45:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 09:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: miles@gnu.org, 17813@debbugs.gnu.org, shigeru.fukaya@gmail.com Reply-To: Eli Zaretskii Received: via spool by 17813-submit@debbugs.gnu.org id=B17813.140325666630319 (code B ref 17813); Fri, 20 Jun 2014 09:32:02 +0000 Received: (at 17813) by debbugs.gnu.org; 20 Jun 2014 09:31:06 +0000 Received: from localhost ([127.0.0.1]:53782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxvA1-0007sw-8x for submit@debbugs.gnu.org; Fri, 20 Jun 2014 05:31:06 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:42057) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wxv9y-0007sN-4O for 17813@debbugs.gnu.org; Fri, 20 Jun 2014 05:31:03 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N7G00F00NLB4Y00@mtaout27.012.net.il> for 17813@debbugs.gnu.org; Fri, 20 Jun 2014 12:27:47 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7G008Q1NMBAW60@mtaout27.012.net.il>; Fri, 20 Jun 2014 12:27:47 +0300 (IDT) Date: Fri, 20 Jun 2014 12:30:42 +0300 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <838uosrkql.fsf@gnu.org> References: <37CF8BE3769E04shigeru.fukaya@gmail.com> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stefan Monnier > Date: Thu, 19 Jun 2014 14:46:48 -0400 > Cc: 17813@debbugs.gnu.org, miles@gnu.org > > I think the right solution is to scale the margin width by the ratio > "linum font size / base font size". Then users can set their `linum' > face the way want and choose between (1) and (2). > > But it turns out that face-attribute can't be used for that because it > does not pay attention to face-remapping-alist. Not sure what you mean by that: attributes don't care about remapping, because remapping doesn't change the attributes, it only changes their values. > Miles, Eli, others, do you know of a function that returns "the font > size, including face-remapping-alist effects"? I think you want (aref (font-info (face-font 'default)) 2) But note that font's size and its "width" (which is actually the average width recorded in the font file) are not identical. We don't have a Lisp API to get the average width of a non-default font; perhaps we should. From unknown Sat Aug 16 18:45:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 13:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: miles@gnu.org, 17813@debbugs.gnu.org, shigeru.fukaya@gmail.com Received: via spool by 17813-submit@debbugs.gnu.org id=B17813.140327135131200 (code B ref 17813); Fri, 20 Jun 2014 13:36:01 +0000 Received: (at 17813) by debbugs.gnu.org; 20 Jun 2014 13:35:51 +0000 Received: from localhost ([127.0.0.1]:53884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wxyyo-00086y-9G for submit@debbugs.gnu.org; Fri, 20 Jun 2014 09:35:51 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:54601) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wxyyg-00086f-8h for 17813@debbugs.gnu.org; Fri, 20 Jun 2014 09:35:42 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCy0HEhQYDSQuh1YI0hkXjnoHCoQuBKkZgWqDTCE X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCy0HEhQYDSQuh1YI0hkXjnoHCoQuBKkZgWqDTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="68731732" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 20 Jun 2014 09:35:32 -0400 Received: by pastel.home (Postfix, from userid 20848) id 5A5BE60D09; Fri, 20 Jun 2014 09:35:32 -0400 (EDT) From: Stefan Monnier Message-ID: References: <37CF8BE3769E04shigeru.fukaya@gmail.com> <838uosrkql.fsf@gnu.org> Date: Fri, 20 Jun 2014 09:35:32 -0400 In-Reply-To: <838uosrkql.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jun 2014 12:30:42 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> I think the right solution is to scale the margin width by the ratio >> "linum font size / base font size". Then users can set their `linum' >> face the way want and choose between (1) and (2). >> But it turns out that face-attribute can't be used for that because it >> does not pay attention to face-remapping-alist. > Not sure what you mean by that: attributes don't care about remapping, > because remapping doesn't change the attributes, it only changes their > values. I mean the following: a way to know "if I apply face `foo' (and only face `foo') to a chunk of text in the current buffer, what will it look like: will it be bold? what will be its size? ..." `face-attribute' doesn't work here because it fails to take into account the effect of face-remapping-alist. >> Miles, Eli, others, do you know of a function that returns "the font >> size, including face-remapping-alist effects"? > I think you want > (aref (font-info (face-font 'default)) 2) Indeed, that seems to work, thanks. > But note that font's size and its "width" (which is actually the > average width recorded in the font file) are not identical. We don't > have a Lisp API to get the average width of a non-default font; Indeed, that's an additional problem. > perhaps we should. I'm all for it. Stefan From unknown Sat Aug 16 18:45:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 14:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: miles@gnu.org, 17813@debbugs.gnu.org, shigeru.fukaya@gmail.com Reply-To: Eli Zaretskii Received: via spool by 17813-submit@debbugs.gnu.org id=B17813.14032744999296 (code B ref 17813); Fri, 20 Jun 2014 14:29:01 +0000 Received: (at 17813) by debbugs.gnu.org; 20 Jun 2014 14:28:19 +0000 Received: from localhost ([127.0.0.1]:54835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wxznf-0002Pq-3Z for submit@debbugs.gnu.org; Fri, 20 Jun 2014 10:28:19 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:36677) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wxznc-0002Pb-P8 for 17813@debbugs.gnu.org; Fri, 20 Jun 2014 10:28:17 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N7H00O001CINO00@mtaout27.012.net.il> for 17813@debbugs.gnu.org; Fri, 20 Jun 2014 17:25:01 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7H00E4R1DP3LA0@mtaout27.012.net.il>; Fri, 20 Jun 2014 17:25:01 +0300 (IDT) Date: Fri, 20 Jun 2014 17:27:57 +0300 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <83tx7fr6z6.fsf@gnu.org> References: <37CF8BE3769E04shigeru.fukaya@gmail.com> <838uosrkql.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stefan Monnier > Cc: shigeru.fukaya@gmail.com, 17813@debbugs.gnu.org, miles@gnu.org > Date: Fri, 20 Jun 2014 09:35:32 -0400 > > >> I think the right solution is to scale the margin width by the ratio > >> "linum font size / base font size". Then users can set their `linum' > >> face the way want and choose between (1) and (2). > >> But it turns out that face-attribute can't be used for that because it > >> does not pay attention to face-remapping-alist. > > Not sure what you mean by that: attributes don't care about remapping, > > because remapping doesn't change the attributes, it only changes their > > values. > > I mean the following: > > a way to know "if I apply face `foo' (and only face `foo') to a chunk > of text in the current buffer, what will it look like: will it be bold? > what will be its size? ..." > > `face-attribute' doesn't work here because it fails to take into account > the effect of face-remapping-alist. APIs that need to take face remapping into account need to be specifically programmed to do that. Some were, some weren't; face-font belongs to the former. > > (aref (font-info (face-font 'default)) 2) > > Indeed, that seems to work, thanks. > > > But note that font's size and its "width" (which is actually the > > average width recorded in the font file) are not identical. We don't > > have a Lisp API to get the average width of a non-default font; > > Indeed, that's an additional problem. > > > perhaps we should. > > I'm all for it. Would it be OK to add that as the last element to the array returned by font-info? From unknown Sat Aug 16 18:45:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: miles@gnu.org, 17813@debbugs.gnu.org, shigeru.fukaya@gmail.com Received: via spool by 17813-submit@debbugs.gnu.org id=B17813.140327853615793 (code B ref 17813); Fri, 20 Jun 2014 15:36:02 +0000 Received: (at 17813) by debbugs.gnu.org; 20 Jun 2014 15:35:36 +0000 Received: from localhost ([127.0.0.1]:54887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy0qh-00046V-2t for submit@debbugs.gnu.org; Fri, 20 Jun 2014 11:35:36 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:26075) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy0qb-00046C-Au for 17813@debbugs.gnu.org; Fri, 20 Jun 2014 11:35:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKkZgWqDTCE X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKkZgWqDTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="68779377" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 20 Jun 2014 11:35:15 -0400 Received: by pastel.home (Postfix, from userid 20848) id 4B80161711; Fri, 20 Jun 2014 11:35:15 -0400 (EDT) From: Stefan Monnier Message-ID: References: <37CF8BE3769E04shigeru.fukaya@gmail.com> <838uosrkql.fsf@gnu.org> <83tx7fr6z6.fsf@gnu.org> Date: Fri, 20 Jun 2014 11:35:15 -0400 In-Reply-To: <83tx7fr6z6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jun 2014 17:27:57 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Would it be OK to add that as the last element to the array returned > by font-info? Sounds fine to me, but I know very little about font handling. I do know that the face/font code uses various arrays that don't all have the same length but share the same meaning for the first elements, so of course, we should first make sure that adding an element to the array doesn't break other parts. Stefan From unknown Sat Aug 16 18:45:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Jul 2014 19:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Shigeru Fukaya Cc: 17813@debbugs.gnu.org Received: via spool by 17813-submit@debbugs.gnu.org id=B17813.140484805132431 (code B ref 17813); Tue, 08 Jul 2014 19:35:01 +0000 Received: (at 17813) by debbugs.gnu.org; 8 Jul 2014 19:34:11 +0000 Received: from localhost ([127.0.0.1]:47292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4b9S-0008Qv-5y for submit@debbugs.gnu.org; Tue, 08 Jul 2014 15:34:11 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:17595) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4b9L-0008QD-HN for 17813@debbugs.gnu.org; Tue, 08 Jul 2014 15:34:04 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWIxALNBIUGA0kMYdb0hkXjnoHhDgEqRmBaoNMIQ X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWIxALNBIUGA0kMYdb0hkXjnoHhDgEqRmBaoNMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="76898621" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 08 Jul 2014 15:33:53 -0400 Received: by pastel.home (Postfix, from userid 20848) id 3851E60337; Tue, 8 Jul 2014 15:33:53 -0400 (EDT) From: Stefan Monnier Message-ID: References: <37CF8BE3769E04shigeru.fukaya@gmail.com> Date: Tue, 08 Jul 2014 15:33:53 -0400 In-Reply-To: <37CF8BE3769E04shigeru.fukaya@gmail.com> (Shigeru Fukaya's message of "Fri, 20 Jun 2014 02:25:28 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) Version:24.5 > (1) To change the width of left margin for line numbers. > [attached patch] I installed the patch below instead (I earlier used a similar patch for nlinum), which should be slightly more robust. Thank you, Stefan === modified file 'lisp/linum.el' --- lisp/linum.el 2014-02-10 01:34:22 +0000 +++ lisp/linum.el 2014-07-08 19:27:00 +0000 @@ -138,6 +138,9 @@ (mapc #'delete-overlay linum-available) (setq linum-available nil)))) +(defun linum--face-height (face) + (aref (font-info (face-font face)) 2)) + (defun linum-update-window (win) "Update line numbers for the portion visible in window WIN." (goto-char (window-start win)) @@ -178,6 +181,12 @@ (let ((inhibit-point-motion-hooks t)) (forward-line)) (setq line (1+ line))) + (when (display-graphic-p) + (setq width (ceiling + ;; We'd really want to check the widths rather than the + ;; heights, but it's a start. + (/ (* width 1.0 (linum--face-height 'linum)) + (frame-char-height))))) (set-window-margins win width (cdr (window-margins win))))) (defun linum-after-change (beg end _len) From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 08 15:34:30 2014 Received: (at control) by debbugs.gnu.org; 8 Jul 2014 19:34:30 +0000 Received: from localhost ([127.0.0.1]:47295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4b9l-0008RY-Cy for submit@debbugs.gnu.org; Tue, 08 Jul 2014 15:34:30 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:28006) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4b9e-0008RC-Py for control@debbugs.gnu.org; Tue, 08 Jul 2014 15:34:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWMws0EhQYDYgw0hkXjwEWhCIEqRmBaoNMIQ X-IPAS-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWMws0EhQYDYgw0hkXjwEWhCIEqRmBaoNMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="76898660" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 08 Jul 2014 15:34:13 -0400 Received: by pastel.home (Postfix, from userid 20848) id 0899160337; Tue, 8 Jul 2014 15:34:13 -0400 (EDT) From: Stefan Monnier To: control@debbugs.gnu.org Subject: Re: bug#17813: 24.3.91; bad linum display with `text-scale-adjust' Message-ID: References: <37CF8BE3769E04shigeru.fukaya@gmail.com> Date: Tue, 08 Jul 2014 15:34:12 -0400 In-Reply-To: <37CF8BE3769E04shigeru.fukaya@gmail.com> (Shigeru Fukaya's message of "Fri, 20 Jun 2014 02:25:28 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) close 17813 thanks