summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-05-22 13:25:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-05-22 13:29:13 -0700
commitdfed333b312d06b3416ebfadff544eae38313391 (patch)
treec4c013baf966e177418675b5ed08c9a08832396d /src/buffer.c
parent5c21832ae866077874fb662e49c695a7850ec22c (diff)
downloademacs-dfed333b312d06b3416ebfadff544eae38313391.tar.gz
emacs-dfed333b312d06b3416ebfadff544eae38313391.tar.bz2
emacs-dfed333b312d06b3416ebfadff544eae38313391.zip
Remove fixnum restriction on some display vars
This is a minor patch to remove some fixnum restrictions. Many more such patches are needed, but one thing at a time. * doc/emacs/custom.texi (Examining): Update fill-column example. * src/buffer.c (fill-column, left-margin, tab-width) (buffer-saved-size, left-margin-width, right-margin-width) (left-fringe-width, right-fringe-width, scroll-bar-width) (scroll-bar-height, buffer-display-count): Allow any integer; do not restrict to fixnums. * src/character.h (SANE_TAB_WIDTH): Do not assume tab_width is a nonnegative fixnum. (sanitize_tab_width): Take a Lisp_Object integer, not an EMACS_INT. Only use changed. * src/data.c (store_symval_forwarding): Remove unnecessary SYMBOLP since the predicate (e.g., Qintegerp) is always a symbol (leave the test in as an eassert). Avoid assignments inside if-conditions. * src/fileio.c (Fdo_auto_save): Do not assume buffer-saved-size is a fixnum. Avoid undefined behavior on EMACS_INT overflow by multiplying a fixnum by at most 4, not by at most 13. * src/window.c (set_window_buffer): When buffer-display-count is too large for a fixnum, make it a bignum. * src/xdisp.c (FILL_COLUMN_INDICATOR_NEEDED): Remove macro, ... (fill_column_indicator_column): ... replacing with this new function. All uses changed. The function is a bit pickier, to prevent problems with non-character fixnums and columns out of range for int, and to remove the assumption that integers are in fixnum range. (append_space_for_newline, extend_face_to_end_of_line): Avoid undefined behavior with signed integer overflow. Simplify.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 3b5078a175b..209e29f0f19 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5603,17 +5603,17 @@ Use the command `abbrev-mode' to change this variable. */);
doc: /* Non-nil if searches and matches should ignore case. */);
DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column),
- Qfixnump,
+ Qintegerp,
doc: /* Column beyond which automatic line-wrapping should happen.
Interactively, you can set the buffer local value using \\[set-fill-column]. */);
DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin),
- Qfixnump,
+ Qintegerp,
doc: /* Column for the default `indent-line-function' to indent to.
Linefeed indents to this column in Fundamental mode. */);
DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width),
- Qfixnump,
+ Qintegerp,
doc: /* Distance between tab stops (for display of tab characters), in columns.
NOTE: This controls the display width of a TAB character, and not
the size of an indentation step.
@@ -5784,7 +5784,7 @@ If it is nil, that means don't auto-save this buffer. */);
Backing up is done before the first time the file is saved. */);
DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length),
- Qfixnump,
+ Qintegerp,
doc: /* Length of current buffer when last read in, saved or auto-saved.
0 initially.
-1 means auto-saving turned off until next real save.
@@ -5858,7 +5858,7 @@ In addition, a char-table has six extra slots to control the display of:
See also the functions `display-table-slot' and `set-display-table-slot'. */);
DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols),
- Qfixnump,
+ Qintegerp,
doc: /* Width in columns of left marginal area for display of a buffer.
A value of nil means no marginal area.
@@ -5866,7 +5866,7 @@ Setting this variable does not take effect until a new buffer is displayed
in a window. To make the change take effect, call `set-window-buffer'. */);
DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols),
- Qfixnump,
+ Qintegerp,
doc: /* Width in columns of right marginal area for display of a buffer.
A value of nil means no marginal area.
@@ -5874,7 +5874,7 @@ Setting this variable does not take effect until a new buffer is displayed
in a window. To make the change take effect, call `set-window-buffer'. */);
DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width),
- Qfixnump,
+ Qintegerp,
doc: /* Width of this buffer's left fringe (in pixels).
A value of 0 means no left fringe is shown in this buffer's window.
A value of nil means to use the left fringe width from the window's frame.
@@ -5883,7 +5883,7 @@ Setting this variable does not take effect until a new buffer is displayed
in a window. To make the change take effect, call `set-window-buffer'. */);
DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width),
- Qfixnump,
+ Qintegerp,
doc: /* Width of this buffer's right fringe (in pixels).
A value of 0 means no right fringe is shown in this buffer's window.
A value of nil means to use the right fringe width from the window's frame.
@@ -5900,12 +5900,12 @@ Setting this variable does not take effect until a new buffer is displayed
in a window. To make the change take effect, call `set-window-buffer'. */);
DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width),
- Qfixnump,
+ Qintegerp,
doc: /* Width of this buffer's vertical scroll bars in pixels.
A value of nil means to use the scroll bar width from the window's frame. */);
DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, scroll_bar_height),
- Qfixnump,
+ Qintegerp,
doc: /* Height of this buffer's horizontal scroll bars in pixels.
A value of nil means to use the scroll bar height from the window's frame. */);
@@ -6175,7 +6175,7 @@ Setting this variable is very fast, much faster than scanning all the text in
the buffer looking for properties to change. */);
DEFVAR_PER_BUFFER ("buffer-display-count",
- &BVAR (current_buffer, display_count), Qfixnump,
+ &BVAR (current_buffer, display_count), Qintegerp,
doc: /* A number incremented each time this buffer is displayed in a window.
The function `set-window-buffer' increments it. */);