From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Native line numbers landed on master Date: Wed, 2 Oct 2019 05:41:51 +0200 Message-ID: <20191002034151.p3crynpqf5npx7yk@Ergus> References: <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: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="126499"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: Lars Ingebrigtsen , Yuri D'Elia , Eli Zaretskii , Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 02 05:42:29 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 1iFVX0-000Wng-Fr for ged-emacs-devel@m.gmane.org; Wed, 02 Oct 2019 05:42:26 +0200 Original-Received: from localhost ([::1]:51290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFVWy-00012j-Jm for ged-emacs-devel@m.gmane.org; Tue, 01 Oct 2019 23:42:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43819) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFVWp-0000zx-Nf for emacs-devel@gnu.org; Tue, 01 Oct 2019 23:42:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFVWn-0007GL-B4 for emacs-devel@gnu.org; Tue, 01 Oct 2019 23:42:15 -0400 Original-Received: from sonic301-20.consmr.mail.ir2.yahoo.com ([77.238.176.97]:43195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFVWj-00079H-2A for emacs-devel@gnu.org; Tue, 01 Oct 2019 23:42:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1569987726; bh=oJ0LPmW/9tncAZr/JF499lMDkTEqWRp1DSX0B1hah6w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=KgqhqXclNKeJZ55wbl4sxmb+u60qXwoRXmaKpaNvHaaEMJozQ5LRBfW/V7PGR97PoHyOJkfFinQWTducnkqkqpDjTUaF6c9gn4YXRtBEBJ2Lijm18Iy7jB/vQhjmO+25TDKrB0CzOGsImiZI471u+aqITZLUBHKW4mxYiQcJ6TD/teLJwFfLKr63mU3cucD1G5GGk/ww32SISmAUb9Z7z4BTYZotiV8Wa2t3E26ayC7sdXthBO3k1pajQqU8LnA8burHrVSLeSRPm/rP/1RyPTLGG4DO1/yDWyDWsJtNDV6fWR5BfersglbyR8EnxaVIdXuW3dH7ino+qCde+m+pKw== X-YMail-OSG: Y9OMDoMVM1lKsAOxpUJ.NsShhQvlqj0bB1OHHcqV_BqTkqvDJC0jNIK.zilpV1h yqfX4xbVrfn_1FRY1_aDrGT0mS.2IEIM.9v3e2ArD2MveFNUXfVSELIYGaabfkV7bStKr5yMBDuO 56EhRW0CrOsAHqHJZbvkgdKOePmO27kbgmnsni.rTGM6UIshW3FZjKtQur4aa7JuscgY2RzILTzA VWh4e4r5y3wRpRziyXjo8AUKIA0HXsVht8lC9lYR3ebpC.m6kjsGhbpRPuKPfazzr19Tf5no957e qitCjhhpKkoUK.BN926LgadOS2J4pq87xs76O6t2cLQ_vq1l0NU2hjU_UAatuz0gZ3CBOmVjODcc 3__MoKKrWWgLWTK3wK7hiVjXvcsIiKD1Sjf_vmzGLRsovjOgUsgwSeepOaP_XHWSPucCeOs92teV H3LmwE1BP7KxHjfqyH6KiINxNQOael0NyjUqhirGxnGG2scB9ObfCXkRu1v99Rxtp5Ts32K3JL0t fV.CWK9uhw9IAQjboh68lzQlL1msijySPubsC6TmDqyzoVTJu9O4WLFXaWgabyFcJtKErM2cFjSf GjuF5SzwRuqrrIWY2B2EVWBSk3qVaq.2CXlPbHwDS35L23oLKMx96747aJI70P2V9F2YsuPTtId_ Xh8rD0eZ9FizJ_Gvfp5mtYYvQYzr2avoWjwk0e1ciOjq7e.P7TylqpYOKR.TIUC3_NH_eLNdUAB0 5gb7fhTtUuR3yONRC5wv.zQ4byDT5mEk.9FBdLmLgmsLSR3f95_gqPZ5TGdliJqo90yxnWn3c6Vd .rfQBaL2VM8OZpdnAHtfYl00INouobmRAFPHU4d200 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ir2.yahoo.com with HTTP; Wed, 2 Oct 2019 03:42:06 +0000 Original-Received: by smtp426.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID ad0c11c50e8f090ba4295fb34dc1df59; Wed, 02 Oct 2019 03:42:02 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 77.238.176.97 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:240457 Archived-At: On Wed, Oct 02, 2019 at 01:51:17AM +0200, Juanma Barranquero wrote: >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? > We deal with similar issues very often. For example in display_fill_column_indicator_column it uses a general case where it can be t or a positive number. You in the simpler case you can use also DEFVAR_INT to bypass part of the needed tests. But in general you only need to avoid divisions by zero, value = NILP,or any non numbers. if so, the code does nothing. You only need this: if (RANGED_FIXNUMP (1, my_Lisp_Object, INT_MAX)) int my_C_object = XFIXNUM (my_Lisp_Object); >> 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.