From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Filipe Silva Newsgroups: gmane.emacs.devel Subject: Re: Native line numbers, final testing Date: Mon, 10 Jul 2017 15:15:02 -0300 Message-ID: References: <83y3s9pm2a.fsf@gnu.org> <87vandz7lw.fsf@lylat> <83wp7tpcav.fsf@gnu.org> <87r2y1z45o.fsf@lylat> <83vandp7wz.fsf@gnu.org> <87mv8pyy7f.fsf@lylat> <83shigpoxq.fsf@gnu.org> <87mv8nkh31.fsf@lylat> <83bmp3pnmb.fsf@gnu.org> <87eftzju5g.fsf@lylat> <837ezqq3gd.fsf@gnu.org> <874luuyuqy.fsf@lylat> <83wp7po86m.fsf@gnu.org> <87fuecc7vg.fsf@lylat> <83y3s2n5pa.fsf@gnu.org> <878tk1rmjx.fsf@lylat> <83a84gn4z9.fsf@gnu.org> <837ezkmwfg.fsf@gnu.org> <874lumps82.fsf@lylat> <8337a5ja4p.fsf@gnu.org> <83van0i5wl.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113cec0ad130b20553fa8f47" X-Trace: blaine.gmane.org 1499710591 10212 195.159.176.226 (10 Jul 2017 18:16:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Jul 2017 18:16:31 +0000 (UTC) Cc: James Cloos , Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 10 20:16:17 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dUdEG-00022M-8Q for ged-emacs-devel@m.gmane.org; Mon, 10 Jul 2017 20:16:16 +0200 Original-Received: from localhost ([::1]:42395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUdEL-0007JW-EV for ged-emacs-devel@m.gmane.org; Mon, 10 Jul 2017 14:16:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUdE9-0007I5-W9 for emacs-devel@gnu.org; Mon, 10 Jul 2017 14:16:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUdE8-00062B-OF for emacs-devel@gnu.org; Mon, 10 Jul 2017 14:16:09 -0400 Original-Received: from mail-oi0-f54.google.com ([209.85.218.54]:36075) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUdE4-000611-R8; Mon, 10 Jul 2017 14:16:05 -0400 Original-Received: by mail-oi0-f54.google.com with SMTP id x187so81926492oig.3; Mon, 10 Jul 2017 11:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=B2eCUMDo+35A/C4UfiJj7FPR7GERlljCGNr/sBhvSSQ=; b=tTBYuX9npR/KaMOb7nuDEUC6W/j/xtKmDDEVYa7Y01aMti7fOh4C7W2arHRrWOeNgu 9GyC1n8IOtpUD6i3+rBYiz6f//KBEeuiom3YLR3L9xB8J88U8bSJa7J9i/ECaC4CnZG/ 5xhP7YV/hzvCn2lp1NbxF/4xR6w80AvzjrdD1tM5eWbDyp+IXZhoYhxvEDdtkv0YSXtS Ia75/whBzXSXWhn2v49x3UwH2Kzkd0MJfDeE3Ubr6beBoSd2Zd4H6Uw5NQZxmr73kZZZ A4uqYNXx+xsiu8wl4V+B8OTtekPlQl5Za4BtTSFgtSMqiGM+2sBrpkumePvFtv1hypSm n7Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=B2eCUMDo+35A/C4UfiJj7FPR7GERlljCGNr/sBhvSSQ=; b=YgHp71S8xEN2LEtNsGlRoJjeVNZPpDcGF0+fucDXzaSVonbloYnwHOClEPQHAxcwcW SAcsITzuZ6tTxCwmVpqZ6AI2T6K/vPZY8cdevOZpA+ioAUyCzAYxMXITDgrvc9JRxKFi hFSiYr7gL5+DHoNiWv+xsqMsw6OLSP/Etsu9Kr3/aHeHmt9jHCg8eCb0WqDvp7kYgQhZ g0jQwodTSVH3v2guwlGiHmwUWoCAqBlq54sPY4olUpyKBixFSspxsRpqAGIBeW8fNYIy sJhymvT6sHYsrx6zzdbtFoW1TmZRO+A1G8HTt+PAxX/5IHngVYboWPbxSREYBStxWjhk hudQ== X-Gm-Message-State: AIVw111dTWSioLqIaV7hAuosTufksc/sHEB/+oeqKRfPvbEjydF74lbQ nAyivLO/kNrUc6wHSrlc/7i0Orx3aA== X-Received: by 10.202.57.133 with SMTP id g127mr10736961oia.225.1499710503331; Mon, 10 Jul 2017 11:15:03 -0700 (PDT) Original-Received: by 10.182.85.69 with HTTP; Mon, 10 Jul 2017 11:15:02 -0700 (PDT) In-Reply-To: <83van0i5wl.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.218.54 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216429 Archived-At: --001a113cec0ad130b20553fa8f47 Content-Type: text/plain; charset="UTF-8" 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 wrote: > > From: James Cloos > > Cc: emacs-devel@gnu.org > > Date: Mon, 10 Jul 2017 01:35:12 -0400 > > > > >>>>> "EZ" == Eli Zaretskii 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. > > > --001a113cec0ad130b20553fa8f47 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Eli, is there a way to disable line numbers, but just for so= mem modes?=C2=A0

Or better, to enable line numbers, only for cer= tain types of modes or filetypes?=C2=A0



On Mon, Jul 10, 2017 at 2= :00 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> From: James Cloos <cloos@jhcloos.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 10 Jul 2017 01:35:12 -0400
>
> >>>>> "EZ" =3D=3D Eli Zaretskii <eliz@gnu.org> writes:
>
> EZ> The doc string for the 'line-number' face explicitly te= lls to use
> EZ> fixed-pitch font for the face.
>
> I hadn't gotten that far; I only called M-x set-variable in a buff= er
> which was already in variable-pitch-mode, and then toggled v-p-m a
> couple of time to compare w/ and w/o.=C2=A0 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.=C2=A0 So
how did you get into a situation where the frame's default face uses a<= br> variable-pitch font?=C2=A0 Did you invoke Emacs with -fn option, or do you<= br> 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-<= br> > 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 provide= s 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.=C2=A0 AFAIU, that character is simply a space whose width is the same as that of digits.=C2=A0 So it's appropriate for when thousand= s
separator is a space, but it cannot magically align a number displayed
with a variable-pitch font.=C2=A0 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

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



--001a113cec0ad130b20553fa8f47--