1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-02 02:10:46 -08:00
emacs/etc
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
..
charsets Update copyright year to 2017 2016-12-31 19:42:26 -08:00
e Prefer straight quoting in some etc text files 2015-08-26 14:09:07 -07:00
forms Update copyright year to 2017 2016-12-31 19:42:26 -08:00
gnus
images Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
nxml Update nXML to use Emacs's Unicode support, and lexical-binding 2016-01-15 10:29:20 -05:00
org Synchronize with the "emacs-sync" branch from Org 2017-06-23 10:58:09 +02:00
refcards ; Fix version in orgcard.tex 2017-06-23 10:59:16 +02:00
schema Add Org schemas.xml contents to Emacs schemas.xml 2017-06-22 11:54:27 +02:00
srecode Update copyright year to 2017 2016-12-31 19:42:26 -08:00
themes Add realgud face definitions 2017-07-05 10:36:31 -04:00
tutorials * etc/tutorials/TUTORIAL.sv: synced with TUTORIAL (Bug#20371) 2017-06-02 22:16:01 +02:00
AUTHORS ; Update contributor name 2017-05-06 18:38:18 -07:00
CALC-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
CENSORSHIP
ChangeLog.1 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
compilation.txt Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
COPYING
DEBUG Replace QUIT with maybe_quit 2017-01-25 21:25:37 -08:00
DEVEL.HUMOR Prefer straight quoting in some etc text files 2015-08-26 14:09:07 -07:00
DISTRIB Update copyright year to 2017 2016-12-31 19:42:26 -08:00
edt-user.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
emacs-buffer.gdb Merge etc/emacs-buffer.gdb from emacs-25 to master. 2017-06-05 14:08:22 -07:00
emacs.appdata.xml Update copyright year to 2017 2016-12-31 19:42:26 -08:00
emacs.desktop * etc/emacs.desktop: Add "Keywords". 2014-10-30 21:10:19 -07:00
emacs.icon
emacs.service Rename '--new-daemon' to 'fg-daemon' and '--old-daemon' to '--bg-daemon' 2017-05-29 22:18:55 -04:00
enriched.txt Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ERC-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ETAGS.EBNF Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ETAGS.README Update copyright year to 2017 2016-12-31 19:42:26 -08:00
FTP
future-bug
GNU Update copyright year to 2015 2015-01-01 09:18:06 -08:00
GNUS-NEWS Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
gnus-tut.txt Update copyright year to 2017 2016-12-31 19:42:26 -08:00
grep.txt Update copyright year to 2017 2016-12-31 19:42:26 -08:00
HELLO Update copyright year to 2017 2016-12-31 19:42:26 -08:00
HISTORY Set Emacs version to 25.2 and update AUTHORS file 2017-04-20 17:29:11 +02:00
JOKES
LINUX-GNU
MACHINES Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
MH-E-NEWS ; Spelling fixes for "SpamAssassin" 2017-05-30 08:29:34 -07:00
MORE.STUFF
NEWS Support display of line numbers natively 2017-07-08 10:49:36 +03:00
NEWS.1-17 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.18 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.19 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.20 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.21 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.22 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.23 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.24 Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NEWS.25 Fixups after merge from emacs-25 2017-03-19 12:39:16 -07:00
NEXTSTEP Update copyright year to 2017 2016-12-31 19:42:26 -08:00
NXML-NEWS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ORDERS
ORG-NEWS Spelling fixes 2017-07-06 00:24:56 -07:00
package-keyring.gpg * etc/package-keyring.gpg: New file. 2014-09-24 10:28:27 -04:00
PROBLEMS Merge from origin/emacs-25 2017-06-11 16:20:41 -07:00
ps-prin0.ps Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ps-prin1.ps Update copyright year to 2017 2016-12-31 19:42:26 -08:00
publicsuffix.txt Update publicsuffix.txt. 2016-02-06 16:11:18 +11:00
README Update copyright year to 2017 2016-12-31 19:42:26 -08:00
rgb.txt
ses-example.ses Update copyright year to 2017 2016-12-31 19:42:26 -08:00
spook.lines
TERMS Update copyright year to 2017 2016-12-31 19:42:26 -08:00
THE-GNU-PROJECT
TODO Fix obsolete ‘test/automated’ references 2017-03-27 11:30:08 -07:00
WHY-FREE
yow.lines Prefer straight quoting in some etc text files 2015-08-26 14:09:07 -07:00

This directory contains the architecture-independent files used by or
with Emacs.  This includes some text files of documentation for GNU
Emacs or of interest to Emacs users, and the file of dumped docstrings
for Emacs functions and variables.

COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES

File: emacs.icon
  Author: Sun Microsystems, Inc
  Copyright (C) 1999, 2001-2017 Free Software Foundation, Inc.
  License: GNU General Public License version 3 or later (see COPYING)