|
From: | Ergus |
Subject: | Re: Native line numbers landed on master |
Date: | Wed, 2 Oct 2019 05:41:51 +0200 |
User-agent: | NeoMutt/20180716 |
On Wed, Oct 02, 2019 at 01:51:17AM +0200, Juanma Barranquero wrote:
On Wed, Oct 2, 2019 at 12:53 AM Ergus <address@hidden> 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.
[Prev in Thread] | Current Thread | [Next in Thread] |