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: Native display of line numbers Date: Sat, 17 Jun 2017 18:12:00 +0300 Message-ID: <83lgoqzm0v.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1497712347 29459 195.159.176.226 (17 Jun 2017 15:12:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2017 15:12:27 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 17 17:12:23 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 1dMFOg-0007MS-G2 for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2017 17:12:22 +0200 Original-Received: from localhost ([::1]:35382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMFOl-00014Z-P2 for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2017 11:12:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMFOe-0000rn-OT for emacs-devel@gnu.org; Sat, 17 Jun 2017 11:12:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMFOb-0007lD-G2 for emacs-devel@gnu.org; Sat, 17 Jun 2017 11:12:20 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMFOb-0007l8-CX for emacs-devel@gnu.org; Sat, 17 Jun 2017 11:12:17 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2217 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dMFOa-0006zk-IP for emacs-devel@gnu.org; Sat, 17 Jun 2017 11:12:17 -0400 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:215698 Archived-At: I generally consider display of line numbers for each line in the buffer un-Emacsy, something that came from the dark era when we needed to count lines to be able to tell the then existing editors something like "move down N lines, then DO SOMETHING". Emacs pioneered today's world where all this is unnecessary, and the rest is history. However, many users want line numbers to be displayed in Emacs. I don't know why they want it, perhaps they were "spoiled" by other IDEs or something. In any case, given the popularity of the various add-on modes which insist on displaying line numbers using all kinds of tricks, I don't think we can ignore this tendency any longer, even if we agree that this is a disease. The "epidemic" has spread too far and too wide for us to continue looking the other way. And since Emacs doesn't make it easy for a Lisp program to invade the holy realm of redisplay, those modes use tricks that make Emacs slower and frequently interfere with other packages. They also make demands on the display engine that make Emacs harder to develop and maintain. So with that in mind, I came up with an implementation of a native display of line numbers. You can find it in the scratch/line-numbers branch of the Emacs repository. Compared with linum-mode, nlinum-mode, and other similar modes, it has the following main advantages: . it works significantly faster (almost twice as fast as linum-mode, 50% faster that relative-line-numbers-mode) . it doesn't use the display margins . it works with R2L text, something the old modes never did The main features of the line-numbering modes are all supported by this new feature. Please give it a try and report any bugs you find. I'm sure there will be quite a few bugs, given the sheer amount of display feature which could be affected, and which I didn't have time to test. Once the flood of serious bug reports dries out, I will look into merging this to master. If, miraculously, no such flood arrives, I will merge in a couple of weeks. When that happens, we will declare all the other modes which do the same job deprecated. TIA