From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Native line numbers landed on master Date: Wed, 2 Oct 2019 01:51:17 +0200 Message-ID: References: <834l4xbfmp.fsf@gnu.org> <87ef414dfn.fsf@wavexx.thregr.org> <83o9359w3l.fsf@gnu.org> <83eezycce5.fsf@gnu.org> <87muekj0i9.fsf@wavexx.thregr.org> <87d0fgagjl.fsf@gnus.org> <20191001225254.mwjnxlynjdc3mz7y@Ergus> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000065df7f0593e2097d" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="183187"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Yuri D'Elia , Lars Ingebrigtsen , Eli Zaretskii , Emacs developers To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 02 03:38:49 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFTbN-000lYJ-GL for ged-emacs-devel@m.gmane.org; Wed, 02 Oct 2019 03:38:49 +0200 Original-Received: from localhost ([::1]:50294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFTbL-0000m7-5J for ged-emacs-devel@m.gmane.org; Tue, 01 Oct 2019 21:38:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43922) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFRwA-0005ci-QF for emacs-devel@gnu.org; Tue, 01 Oct 2019 19:52:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFRw5-0006kP-N1 for emacs-devel@gnu.org; Tue, 01 Oct 2019 19:52:07 -0400 Original-Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]:41838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFRvw-0006eJ-2Q; Tue, 01 Oct 2019 19:51:56 -0400 Original-Received: by mail-qt1-x836.google.com with SMTP id d16so3395454qtq.8; Tue, 01 Oct 2019 16:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y+8h4xvVkEdiAAwcSf/cDrpluCGax+C36CDklxrDZLU=; b=RipLA/R0F5zlt7gVNVO5Mu510OALTsINwssAO3OXN1cDhyug0HRm/OsITEBjuFoKQp xLXj7G/7GhB9YEB4AzTh/PG4Z5BzVO2QT9El1MDtmBDpcioGERnTLjvHq7wpp4e+nWcX vnxroma6E+jLzemu6vZnPXsoa4bBPOimsDIY2Bsc1WZzDoTtu2kSbtW7Le8ZKVDsWt1O esCQQIe6PDHej6HtEMQDH/bWNz9d/83q1KeZcznnVgydOazRhF9GZT74i7gHxX6YAogy 4WFzEX1MG/LhShOCRpMBoyqFT936Agc9exqnW3CQue9hCq4IQE9VVkkXxdndNt/uW/US YSIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y+8h4xvVkEdiAAwcSf/cDrpluCGax+C36CDklxrDZLU=; b=VDnQdP6zkwirHe+IYdvxjgaG9RCGup9ALTF7Ok/ol7kFZmqw3WXxrNIX79PZLlnmY6 IaSg2w109+KuYjSzC5vbomPKmW3DkTxT89Ibf+FvAwh03ZmKds+8L0pJHbdnopdXTShW M6LZXVV7crS1nS8OAgmwQyzG1RV5/IWl3wWxb3lJio9xQ4pLuUcyONc5Hn+/F9kPv5XY hfTtjeBpqS/FElZAN6xYszsgEHrLOGBixCFlAI1PQB1PTDZ4mSIh7iHoo/+wt5GmmLPo ZrHF70IFoP6wNeJuGmPenvGN3d3NG6IjEPwCtX9CvE0CdSoVcTjLBk0AZXzj126xtnSt GHhQ== X-Gm-Message-State: APjAAAWFeAKCywoentFWgsPr1CV8i1iP6ct1P/djY3kZfc+TDXBBL3Ma FNkFiPln+Spw3755zx+DSOCA0anPX4r8HNYJQh4= X-Google-Smtp-Source: APXvYqwsDkMcivk6j0RLb75g4O+gBS9Q0UpMdIrAbp2T14MsdMsrJrMF0XhWYT8bF9sqeeCXEbtMcV7WVHZJkGsdrf8= X-Received: by 2002:a05:6214:70c:: with SMTP id b12mr554270qvz.87.1569973913008; Tue, 01 Oct 2019 16:51:53 -0700 (PDT) In-Reply-To: <20191001225254.mwjnxlynjdc3mz7y@Ergus> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::836 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:240456 Archived-At: --00000000000065df7f0593e2097d Content-Type: multipart/alternative; boundary="00000000000065df7d0593e2097b" --00000000000065df7d0593e2097b Content-Type: text/plain; charset="UTF-8" On Wed, Oct 2, 2019 at 12:53 AM Ergus wrote: > 1) I don't have any strong feeling about using one or two values. But in > any case they should be configurable. This will add more use cases that > could benefit with this and I think it will be simple to implement (just > need to add 2 int variables). Adding the variables is trivial, yes. The problem is dealing with errors, like the user setting the variables to non-numbers, etc. I'm sure we don't want to throw signals there, do we? Eli, opinions? > 2) Is it possible to call merge_faces more lazily? I mean inside the > `if` `else if` so only one of them will be called when needed. AFAIK > maybe_produce_line_number is called for every line and the code needs > only one of those merges every 5/10/x lines. You're right. Thanks. Improved patch attached. --00000000000065df7d0593e2097b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Oct 2, 2019 at 12:53 AM Ergus <spacibba@aol.com> wrote:

> 1) I d= on't have any strong feeling about using one or two values. But in
&= gt; any case they should be configurable. This will add more use cases that=
> could benefit with this and I think it will be simple to implement= (just
> need to add 2 int variables).

Adding the v= ariables is trivial, yes. The problem is dealing with errors, like the user= setting the variables to non-numbers, etc. I'm sure we don't want = to throw signals there, do we?

Eli, opinions?

> 2) Is it possible to call merge_faces more lazily= ? I mean inside the
> `if` `else if` so only one of them will be call= ed when needed. AFAIK
> maybe_produce_line_number is called for every= line and the code needs
> only one of those merges every 5/10/x line= s.

You're right. Thanks. Improved patch at= tached.


--00000000000065df7d0593e2097b-- --00000000000065df7f0593e2097d Content-Type: application/octet-stream; name="0001-New-faces-to-higlight-line-numbers-multiple-of-5-and.patch" Content-Disposition: attachment; filename="0001-New-faces-to-higlight-line-numbers-multiple-of-5-and.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k18hw1wq0 RnJvbSBhMTQwZjBiODAzMTJjMGQ5YTM4YmEzZTc0YzEyYTAzMWViYTQ5YTkxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKdWFubWEgQmFycmFucXVlcm8gPGxla2t0dUBnbWFpbC5jb20+ CkRhdGU6IFdlZCwgMiBPY3QgMjAxOSAwMToxNjo1OCArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIE5l dyBmYWNlcyB0byBoaWdsaWdodCBsaW5lIG51bWJlcnMgbXVsdGlwbGUgb2YgNSBhbmQgMTAKCiog bGlzcC9mYWNlcy5lbCAobGluZS1udW1iZXItZml0aC1saW5lLCBsaW5lLW51bWJlci10ZW50aC1s aW5lKToKTmV3IGZhY2VzLgoqIHNyYy94ZGlzcC5jIChtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVy KTogVXNlIG5ldyBmYWNlcyBmb3Ig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3hkaXNwICh2b2lkKQogICAvKiBOYW1lcyBvZiB0aGUgZmFj ZXMgdXNlZCB0byBkaXNwbGF5IGxpbmUgbnVtYmVycy4gICovCiAgIERFRlNZTSAoUWxpbmVfbnVt YmVyLCAibGluZS1udW1iZXIiKTsKICAgREVGU1lNIChRbGluZV9udW1iZXJfY3VycmVudF9saW5l LCAibGluZS1udW1iZXItY3VycmVudC1saW5lIik7CisgIERFRlNZTSAoUWxpbmVfbnVtYmVyX2Zp ZnRoX2xpbmUsICJsaW5lLW51bWJlci1maWZ0aC1saW5lIik7CisgIERFRlNZTSAoUWxpbmVfbnVt YmVyX3RlbnRoX2xpbmUsICJsaW5lLW51bWJlci10ZW50aC1saW5lIik7CiAgIC8qIE5hbWUgb2Yg YSB0ZXh0IHByb3BlcnR5IHdoaWNoIGRpc2FibGVzIGxpbmUtbnVtYmVyIGRpc3BsYXkuICAqLwog ICBERUZTWU0gKFFkaXNwbGF5X2xpbmVfbnVtYmVyc19kaXNhYmxlLCAiZGlzcGxheS1saW5lLW51 bWJlcnMtZGlzYWJsZSIpOwogCi0tIAoyLjIxLjAud2luZG93cy4xCgo= --00000000000065df7f0593e2097d--