bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26552: [patch] nlinum margin width calculation (emacs <25)


From: Christophe Rhodes
Subject: bug#26552: [patch] nlinum margin width calculation (emacs <25)
Date: Mon, 17 Apr 2017 22:26:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]