Files
emacs/lisp
Eli Zaretskii 5df239fc6f Support display of line numbers natively
This merges branch 'line-numbers'.
* src/buffer.c (disable_line_numbers_overlay_at_eob): New
function.
* src/lisp.h (disable_line_numbers_overlay_at_eob): Add prototype.
* src/dispextern.h (struct it): New members pt_lnum, lnum,
lnum_bytepos, lnum_width, and lnum_pixel_width.
* src/indent.c (line_number_display_width): New function,
refactored from line-number width calculations in vertical-motion.
(Fvertical_motion): Call line_number_display_width when the width
of line-number display is needed.
(Fline_number_display_width): New defun.
(syms_of_indent): Defsubr it.
* src/indent.c (Fvertical_motion): Help C-n/C-p estimate correctly
the width used up by line numbers by looking near the window-start
point.  If window-start is outside of the accessible portion,
temporarily widen the buffer.
* src/term.c (produce_glyphs): Adjust tab stops for the horizontal
space taken by the line-number display.
* src/xdisp.c (display_count_lines_logically)
(display_count_lines_visually, maybe_produce_line_number)
(should_produce_line_number, row_text_area_empty): New functions.
(try_window_reusing_current_matrix): Don't use this method when
display-line-numbers is in effect.
(try_window_id, try_cursor_movement): Disable these optimizations
when the line-number-current-line face is different from
line-number face and for relative line numbers.
(try_window_id, redisplay_window, try_cursor_movement): For
visual line-number display, disable the same redisplay
optimizations as for relative.
(x_produce_glyphs): Adjust tab stops for the horizontal
space taken by the line-number display.
(hscroll_window_tree): Adjust hscroll calculations to line-number
display.
(DISP_INFINITY): Renamed from INFINITY to avoid clashes with
math.h; all users changed.
(set_cursor_from_row): Fix calculation of cursor X coordinate in
R2L rows with display-produced glyphs at the beginning.
(display_line): Use should_produce_line_number to determine
whether a line number should be produced for each glyph row, and
maybe_produce_line_number to produce line numbers.
Don't display line numbers in the minibuffer and in tooltip
frames.
Call row_text_area_empty to verify that a glyph
row's text area is devoid of any glyphs that came from a buffer or
a string.  This fixes a bug with empty-lines indication
disappearing when line numbers or line-prefix are displayed.
(syms_of_xdisp) <display-line-numbers, display-line-numbers-widen>
<display-line-number-width>: New buffer-local variables.
<display-line-numbers-current-absolute>: New variable.

* lisp/cus-start.el (standard): Provide customization forms for
display-line-numbers and its sub-features.
* lisp/faces.el (line-number, line-number-current-line): New faces.
* lisp/frame.el: Add display-line-numbers, display-line-numbers-widen,
display-line-numbers-current-absolute, and
display-line-number-width to the list of variables that should
trigger redisplay of the current buffer.
* lisp/menu-bar.el (menu-bar-showhide-menu): Add menu-bar item to
turn display-line-numbers on and off.
(toggle-display-line-numbers): New function.
* lisp/simple.el (last--line-number-width): New internal variable.
(line-move-visual): Use it to adjust temporary-goal-column when
line-number display changes its width.

* doc/emacs/basic.texi (Position Info): Add cross-reference to
"Display Custom", for line-number display.
* doc/emacs/custom.texi (Init Rebinding):
* doc/emacs/modes.texi (Minor Modes): Remove references to
linum-mode.
* doc/emacs/display.texi (Display Custom): Describe the
line-number display.
* doc/lispref/display.texi (Size of Displayed Text): Document
line-number-display-width.

* etc/NEWS: Document display-line-numbers and its customizations.
2017-07-08 10:49:36 +03:00
..
2017-07-06 00:24:56 -07:00
2017-06-21 08:12:10 +00:00
2017-01-01 01:10:47 -08:00
2017-05-30 08:29:34 -07:00
2017-07-05 17:03:42 +02:00
2017-05-07 13:22:34 +02:00
2017-07-06 00:24:56 -07:00
2017-04-08 11:36:56 -04:00
2017-06-06 15:08:41 -04:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-07-06 00:24:56 -07:00
2016-12-31 19:42:26 -08:00
2017-07-02 11:41:58 +02:00
2016-12-31 19:42:26 -08:00
2017-01-29 19:34:35 +01:00
2017-06-13 14:31:53 +09:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-06-05 20:33:55 -04:00
2017-05-06 18:38:18 -07:00
2017-05-06 18:38:18 -07:00
2017-06-07 14:27:21 -04:00
2017-07-06 00:24:56 -07:00
2017-05-06 18:30:14 -07:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2017-02-21 15:11:56 -05:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-06-26 14:22:34 +09:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2017-05-21 23:03:01 +02:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-07-01 06:26:53 -04:00
2016-12-31 19:42:26 -08:00
2017-04-26 12:51:48 -04:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-03 18:34:13 -05:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-07-06 00:24:56 -07:00
2017-04-27 00:04:54 -04:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-03-19 12:34:04 -07:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2017-01-04 14:21:38 -05:00
2016-12-31 19:42:26 -08:00
2017-05-31 20:32:31 +02:00
2017-02-18 11:32:45 +02:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-02-20 18:08:48 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-05-19 15:20:59 +03:00
2016-12-31 19:42:26 -08:00
2017-07-07 18:13:15 -04:00
2017-01-01 01:10:47 -08:00
2016-12-31 19:42:26 -08:00
2016-12-31 19:42:26 -08:00
2017-05-07 13:22:34 +02:00
2016-12-31 19:42:26 -08:00
2017-01-01 01:10:47 -08:00
2017-01-01 01:10:47 -08:00

This directory contains source code for the parts of Emacs that are
written in Emacs Lisp.  *.el files are Emacs Lisp source, and the
corresponding *.elc files are byte-compiled versions.  Byte-compiled
files are architecture-independent.

The term subdirectory contains Lisp files that customize Emacs for
certain terminal types.  When Emacs starts, it checks the TERM
environment variable to get the terminal type and loads
'term/${TERM}.el' if it exists.

The other subdirectories hold Lisp packages grouped by their general
purpose.