emacs-devel
[Top][All Lists]
Advanced

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

Re: Native display of line numbers


From: Eli Zaretskii
Subject: Re: Native display of line numbers
Date: Sun, 18 Jun 2017 19:11:27 +0300

> Date: Sun, 18 Jun 2017 15:47:05 +0000
> Cc: address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > Given a window whose buffer is in Follow Mode, how do I know what is
> > the "correct" value of point to use in that window to make the
> > relative numbers "global"?
> 
> I don't see that this can easily be done, since follow-mode more fights
> the display engine rather than working with it.

Maybe follow-mode could provide a buffer-local variable with the value
of that point, and the display engine could simply access that
variable?

> $ emacs --no-desktop
> M-x customize-variable<RET>display-line-numbers<RET>
>   <set display-line-numbers to relative using the keyboard or mouse and
>   save it for the session>
> C-x C-f path/to/src/xdisp.c
> If in X, maximise the selected window using the mouse.
> C-c 3 ; see below.
> 
> The displayed line-numbers are now "global", and range from 0 to 194
> 
> C-n
> 
> The displayed line-numbers in the "other two" windows now range from -31
> to 33.
> 
> ########################################################################
> (defun 3-column ()
>   "Disply the current buffer in 3 columns with Follow Mode"
>   (interactive)
>   (follow-mode 1)
>   (delete-other-windows)
>   (split-window-horizontally) (split-window-horizontally)
>   (balance-windows))
> (global-set-key "\C-c3" '3-column)
> ########################################################################
> 
> I've found another bug, I'm afraid.  Starting off from the above
> situation, with point in the middle window (in X windows), do M-<.  The
> relative line numbers in the middle window now range from -59 to -20,
> with that window's point at relative line -39.

Thanks.  Both situations are redisplay bugs: if you trigger redisplay
in both of them, the line numbers are again window-local.  I need to
find a redisplay optimization that prevents that from happening
automatically.



reply via email to

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