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 line numbers, final testing Date: Fri, 30 Jun 2017 22:55:24 +0300 Message-ID: <83vandp7wz.fsf@gnu.org> References: <83y3s9pm2a.fsf@gnu.org> <87vandz7lw.fsf@lylat> <83wp7tpcav.fsf@gnu.org> <87r2y1z45o.fsf@lylat> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1498852562 1119 195.159.176.226 (30 Jun 2017 19:56:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Jun 2017 19:56:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alex Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 30 21:55:52 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 1dR215-0007kW-Cv for ged-emacs-devel@m.gmane.org; Fri, 30 Jun 2017 21:55:47 +0200 Original-Received: from localhost ([::1]:45776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dR213-0004TZ-Vf for ged-emacs-devel@m.gmane.org; Fri, 30 Jun 2017 15:55:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dR20y-0004TS-NI for emacs-devel@gnu.org; Fri, 30 Jun 2017 15:55:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dR20v-0003NA-Ij for emacs-devel@gnu.org; Fri, 30 Jun 2017 15:55:40 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dR20v-0003N5-FC; Fri, 30 Jun 2017 15:55:37 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1706 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dR20u-00059G-Oz; Fri, 30 Jun 2017 15:55:37 -0400 In-reply-to: <87r2y1z45o.fsf@lylat> (message from Alex on Fri, 30 Jun 2017 13:06:27 -0600) 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:216063 Archived-At: > From: Alex > Cc: emacs-devel@gnu.org > Date: Fri, 30 Jun 2017 13:06:27 -0600 > > >> If the current line number is at least 4 digits long, then the text in > >> the current line is shifted over. > > > > Thanks, but I don't understand what you mean, and I tried one file > > with 5-digit line number and didn't see what I think you described. > > > > Can you show a screenshot? Are you using some special font where this > > happens? > > I forgot that just before testing relative line numbers, I set > `display-line-number-width' to a non-nil value. For immediate results, > try setting it to 0 and hit C-n/C-p a few times. Ah, okay. Thanks, should be fixed now. (Btw zero is not valid as the value of display-line-number-width, although the code before the last changes mistakenly tried using it. Starting from now, zero and any other non-positive value are interpreted as nil.) > P.S. I noticed that with display-line-numbers set to 'visual, goto-line > is much slower compared to 'relative. Is this expected? Yes. The initial naïve implementation was unbearably slow, but I was lucky to find a shortcut. It is still sometimes slow, and a few redisplay optimizations are disabled with this mode, because moving point vertically needs to redisplay the entire window, since the line numbers change. If someone has ideas for speeding it up, I'm all ears. At least it is significantly faster than the only add-on package which implemented something similar to visual mode.