From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Native display of line numbers Date: Sun, 18 Jun 2017 19:11:27 +0300 Message-ID: <83lgopxols.fsf@gnu.org> References: <83lgoqzm0v.fsf@gnu.org> <20170617202702.GC2955@acm.fritz.box> <837f0ayqdl.fsf@gnu.org> <20170618114251.GA22671@acm> <83r2yhxrlv.fsf@gnu.org> <20170618154705.GB22671@acm> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1497802336 5409 195.159.176.226 (18 Jun 2017 16:12:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Jun 2017 16:12:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 18 18:12:11 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMco6-0000z9-3E for ged-emacs-devel@m.gmane.org; Sun, 18 Jun 2017 18:12:10 +0200 Original-Received: from localhost ([::1]:38895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMcoB-0000Da-9N for ged-emacs-devel@m.gmane.org; Sun, 18 Jun 2017 12:12:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMcng-0000DJ-II for emacs-devel@gnu.org; Sun, 18 Jun 2017 12:11:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMcnd-0004tc-C3 for emacs-devel@gnu.org; Sun, 18 Jun 2017 12:11:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMcnd-0004tX-8j; Sun, 18 Jun 2017 12:11:41 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3570 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dMcnc-0001v6-LL; Sun, 18 Jun 2017 12:11:40 -0400 In-reply-to: <20170618154705.GB22671@acm> (message from Alan Mackenzie on Sun, 18 Jun 2017 15:47:05 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:215751 Archived-At: > Date: Sun, 18 Jun 2017 15:47:05 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > > 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-variabledisplay-line-numbers > 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.