all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Native display of line numbers
@ 2017-06-17 15:12 Eli Zaretskii
  2017-06-17 16:41 ` Stefan Monnier
                   ` (11 more replies)
  0 siblings, 12 replies; 78+ messages in thread
From: Eli Zaretskii @ 2017-06-17 15:12 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 78+ messages in thread
* Re: Native display of line numbers
@ 2017-06-17 23:44 Joseph Garvin
  0 siblings, 0 replies; 78+ messages in thread
From: Joseph Garvin @ 2017-06-17 23:44 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

I just signed up for the devel list to chime in: I'm a user with a real use
case for line numbers, and it's not a disease ;)

I have RSI in my hands. Myself and some other emacsers use speech
recognition driving emacs to code. The latency for speech recognition is
not great though, and so your best bet for speed is to utter a series of
commands all at once, anticipating the outcome from doing all of those
actions in sequence. For this it's essential to have *relative* line
numbers, so that you can say things like, "up 5, delete 3, down 2". Which
is pretty much the scenario you describe, it's just there's a reason to do
it still in 2017.

So I'd welcome any new code that speeds up line number calculation,
although it'd be nice if it had a relative mode. What about absolute line
#s? I have no idea what those heretics use it for ;)

Joe G.

[-- Attachment #2: Type: text/html, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 78+ messages in thread

end of thread, other threads:[~2017-06-24 10:32 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-17 15:12 Native display of line numbers Eli Zaretskii
2017-06-17 16:41 ` Stefan Monnier
2017-06-17 18:25   ` Eli Zaretskii
2017-06-17 21:25     ` Stefan Monnier
2017-06-18 14:21       ` Eli Zaretskii
2017-06-17 16:52 ` Kaushal Modi
2017-06-17 17:20   ` Kaushal Modi
2017-06-17 17:42     ` Eli Zaretskii
2017-06-17 17:41   ` Eli Zaretskii
2017-06-17 21:16     ` Stefan Monnier
2017-06-18  4:27     ` Kaushal Modi
2017-06-18 14:40       ` Eli Zaretskii
2017-06-17 20:27 ` Alan Mackenzie
2017-06-17 21:26   ` Stefan Monnier
2017-06-18  2:35   ` Eli Zaretskii
2017-06-18 11:42     ` Alan Mackenzie
2017-06-18 12:16       ` Colin Baxter
2017-06-18 15:06       ` Eli Zaretskii
2017-06-18 15:47         ` Alan Mackenzie
2017-06-18 16:11           ` Eli Zaretskii
2017-06-18 20:19             ` Alan Mackenzie
2017-06-19  2:28               ` Eli Zaretskii
2017-06-17 20:47 ` Sébastien Le Callonnec
2017-06-18  2:38   ` Eli Zaretskii
2017-06-18 10:51     ` Sébastien Le Callonnec
2017-06-17 21:32 ` Mathias Dahl
2017-06-17 22:12   ` James Nguyen
2017-06-18 14:31     ` Eli Zaretskii
2017-06-19  2:25       ` James Nguyen
2017-06-19 15:32         ` Eli Zaretskii
2017-06-19 16:33           ` James Nguyen
2017-06-18 14:28   ` Eli Zaretskii
2017-06-18 14:42     ` Andreas Schwab
2017-06-18  8:44 ` martin rudalics
2017-06-18  8:58   ` martin rudalics
2017-06-18 14:46   ` Eli Zaretskii
2017-06-19  2:39     ` Eli Zaretskii
2017-06-19  8:04       ` martin rudalics
2017-06-19 15:13         ` Eli Zaretskii
2017-06-18 11:03 ` Yuri Khan
2017-06-18 14:54   ` Eli Zaretskii
2017-06-18 16:54     ` Yuri Khan
2017-06-18 19:00       ` Eli Zaretskii
2017-06-19  5:32         ` Yuri Khan
2017-06-19 15:51           ` Eli Zaretskii
2017-06-24 10:32     ` Eli Zaretskii
2017-06-18 19:41 ` Daniele Nicolodi
2017-06-18 20:04   ` Eli Zaretskii
2017-06-18 20:48     ` Daniele Nicolodi
2017-06-19  2:31       ` Eli Zaretskii
2017-06-19  3:07         ` Daniele Nicolodi
2017-06-19 15:03           ` Eli Zaretskii
2017-06-19  2:44       ` Clément Pit-Claudel
2017-06-19  4:15         ` Eli Zaretskii
2017-06-19  4:30           ` Clément Pit-Claudel
2017-06-18 22:20 ` Scott Jaderholm
2017-06-19  2:34   ` Eli Zaretskii
2017-06-19  5:49     ` Scott Jaderholm
2017-06-19 16:56 ` Stephen Leake
2017-06-19 17:11   ` Eli Zaretskii
2017-06-19 18:43     ` Stephen Leake
2017-06-19 19:32       ` Eli Zaretskii
2017-06-19 18:39 ` Alan Mackenzie
2017-06-19 19:28   ` Eli Zaretskii
2017-06-19 19:38     ` Alan Mackenzie
2017-06-19 19:51       ` Eli Zaretskii
2017-06-22 15:02 ` Filipe Silva
2017-06-22 15:38   ` Eli Zaretskii
2017-06-22 15:46     ` Filipe Silva
2017-06-23 16:23     ` Stefan Monnier
2017-06-23 21:04       ` Eli Zaretskii
2017-06-23 21:24         ` Stefan Monnier
2017-06-24  7:18           ` Eli Zaretskii
2017-06-22 16:27   ` Yuri Khan
2017-06-22 16:56     ` Stephen Berman
2017-06-23 11:10     ` Filipe Silva
2017-06-23 11:17       ` Filipe Silva
  -- strict thread matches above, loose matches on Subject: below --
2017-06-17 23:44 Joseph Garvin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.