emacs-devel
[Top][All Lists]
Advanced

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

Re: Native line numbers, final testing


From: Filipe Silva
Subject: Re: Native line numbers, final testing
Date: Mon, 10 Jul 2017 15:15:02 -0300

Eli, is there a way to disable line numbers, but just for somem modes? 

Or better, to enable line numbers, only for certain types of modes or filetypes? 



On Mon, Jul 10, 2017 at 2:00 PM, Eli Zaretskii <address@hidden> wrote:
> From: James Cloos <address@hidden>
> Cc: address@hidden
> Date: Mon, 10 Jul 2017 01:35:12 -0400
>
> >>>>> "EZ" == Eli Zaretskii <address@hidden> writes:
>
> EZ> The doc string for the 'line-number' face explicitly tells to use
> EZ> fixed-pitch font for the face.
>
> I hadn't gotten that far; I only called M-x set-variable in a buffer
> which was already in variable-pitch-mode, and then toggled v-p-m a
> couple of time to compare w/ and w/o.  I hadn't gone looking for the
> name of the face used by the line numbers.

The line-number face by default inherits from the 'default' face.  So
how did you get into a situation where the frame's default face uses a
variable-pitch font?  Did you invoke Emacs with -fn option, or do you
have some mode which creates a frame with the face parameter that
specifies a variable-pitch font?

> Perhaps what I should have written is that the default face for line-
> number should not be affected by enabling variable-pitch-mode.

I didn't think people would have frames whose default face is
variable-pitch.

Does the patch below give good results?

> >> The code might need to check whether the current face provides a glyph
> >> for FIGURE SPACE.
>
> EZ> And if not?
>
> Then it would have had to ignore FIGURE SPACE and fall back to SPACE...

Btw, I don't really see how FIGURE SPACE could solve the problem at
hand anyway.  AFAIU, that character is simply a space whose width is
the same as that of digits.  So it's appropriate for when thousands
separator is a space, but it cannot magically align a number displayed
with a variable-pitch font.  Am I missing something?

Here's the patch I propose to fix your variable-pitch problem:

diff --git a/lisp/faces.el b/lisp/faces.el
index c3693d1..52a4db5 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2467,7 +2467,7 @@ trailing-whitespace

 ;; Definition stolen from linum.el.
 (defface line-number
-  '((t :inherit (shadow default)))
+  '((t :inherit (shadow default) :family "Monospace Serif"))
   "Face for displaying line numbers.
 This face is used when `display-line-numbers' is non-nil.




reply via email to

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