[Top][All Lists]

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

Re: Native line numbers landed on master

From: Juanma Barranquero
Subject: Re: Native line numbers landed on master
Date: Fri, 4 Oct 2019 19:28:21 +0200

On Fri, Oct 4, 2019 at 5:58 PM Johan Bockgård <address@hidden> wrote:
> Juanma Barranquero <address@hidden> writes:

> Why not use DEFVAR_INT?

My feeling is that DEFVAR_INT is appropriate for variables that must always have a number, like display-line-numbers-offset in the next patch. Even its "off" value is just having an offset of 0.

On the other hand, ticks can be turned on and off, and though strictly speaking 0 can serve as off, it seems cleaner to allow the user to set them to nil to turn them off.

That said, I don't feel strongly about it. I'll got with the consensus.

> I realize that many existing variables in xdisp.c don't follow this
> recommendation, but the manual says the following:
>      *Warning:* Don’t assume that you should use
>      ‘make-variable-buffer-local’ for user-option variables, simply
>      because users _might_ want to customize them differently in
>      different buffers.  Users can make any variable local, when they
>      wish to.  It is better to leave the choice to them.

I know the recommendation, but the reason many variables don't follow it is that it is less convenient. In cases like this one, I think it's quite likely that the tick values will depend on the mode or the kind of data, or even its length (Yuri said that he uses large values to quickly scan log files, for example). When seems likely that every buffer will have its own value, I strongly believe it's cleaner to have the variable automatically buffer-local.

reply via email to

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