From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Christophe Rhodes Newsgroups: gmane.emacs.bugs Subject: bug#26552: [patch] nlinum margin width calculation (emacs <25) Date: Mon, 17 Apr 2017 22:26:56 +0100 Message-ID: <8737d6pvxb.fsf@cantab.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1492529544 8149 195.159.176.226 (18 Apr 2017 15:32:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Apr 2017 15:32:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: 26552@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 18 17:32:20 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0V73-0001yJ-9t for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Apr 2017 17:32:17 +0200 Original-Received: from localhost ([::1]:42560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0V79-0003zj-4S for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Apr 2017 11:32:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0V5u-0003GS-Gr for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 11:31:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0V5q-0001q5-KP for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 11:31:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56744) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0V5q-0001pp-GU for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 11:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d0V5q-0001Jx-4Z for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 11:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christophe Rhodes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Apr 2017 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26552 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14925294024902 (code B ref -1); Tue, 18 Apr 2017 15:31:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Apr 2017 15:30:02 +0000 Original-Received: from localhost ([127.0.0.1]:54937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0V4r-0001Gi-0c for submit@debbugs.gnu.org; Tue, 18 Apr 2017 11:30:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0Nu4-0001ib-96 for submit@debbugs.gnu.org; Tue, 18 Apr 2017 03:50:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Nty-0004q5-4G for submit@debbugs.gnu.org; Tue, 18 Apr 2017 03:50:18 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54873) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Nty-0004q1-1n for submit@debbugs.gnu.org; Tue, 18 Apr 2017 03:50:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Ntx-00081c-1V for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 03:50:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Nts-0004kw-6w for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 03:50:17 -0400 Original-Received: from [195.159.176.226] (port=50426 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0Nts-0004k7-02 for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 03:50:12 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d0Ntj-0002tM-RT for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2017 09:50:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:qnUfbaeZG2ASkVVJZZOzgMuibiE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Tue, 18 Apr 2017 11:30:00 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:131732 Archived-At: --=-=-= Content-Type: text/plain Hi, I think the calculation that nlinum-mode does to guess the margin size in the absence of font width information (in emacs versions less than 25) uses the wrong bit of font information: the pixel size, rather than the font height. Trivial patch below, which fixes the problem for me. Best wishes, Christophe --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=nlinum.diff --- nlinum.el~ 2017-04-17 20:41:35.595122970 +0100 +++ nlinum.el 2017-04-17 21:46:37.713053714 +0100 @@ -71,7 +71,7 @@ (nlinum--setup-windows)) (defun nlinum--face-height (face) - (aref (font-info (face-font face)) 2)) + (aref (font-info (face-font face)) 3)) (defun nlinum--face-width (face) ;New info only in Emacs>=25. (let ((fi (font-info (face-font face)))) --=-=-=--