Mercurial > emacs
comparison src/cmds.c @ 1948:e7b8107294b7
(syms_of_cmds): New var `overwrite-binary-mode'.
(internal_self_insert): Handle that var.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 24 Feb 1993 08:59:25 +0000 |
parents | 79f020f34683 |
children | 2c37a16ab05e |
comparison
equal
deleted
inserted
replaced
1947:ba1e55a4ba76 | 1948:e7b8107294b7 |
---|---|
24 #include "buffer.h" | 24 #include "buffer.h" |
25 #include "syntax.h" | 25 #include "syntax.h" |
26 | 26 |
27 Lisp_Object Qkill_forward_chars, Qkill_backward_chars, Vblink_paren_function; | 27 Lisp_Object Qkill_forward_chars, Qkill_backward_chars, Vblink_paren_function; |
28 | 28 |
29 int overwrite_binary_mode; | |
29 | 30 |
30 DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p", | 31 DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p", |
31 "Move point right ARG characters (left if ARG negative).\n\ | 32 "Move point right ARG characters (left if ARG negative).\n\ |
32 On reaching end of buffer, stop and signal error.") | 33 On reaching end of buffer, stop and signal error.") |
33 (n) | 34 (n) |
275 if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function)) | 276 if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function)) |
276 hairy = 1; | 277 hairy = 1; |
277 | 278 |
278 if (!NILP (current_buffer->overwrite_mode) | 279 if (!NILP (current_buffer->overwrite_mode) |
279 && point < ZV | 280 && point < ZV |
280 && c != '\n' && FETCH_CHAR (point) != '\n' | 281 && (overwrite_binary_mode || (c != '\n' && FETCH_CHAR (point) != '\n')) |
281 && (FETCH_CHAR (point) != '\t' | 282 && (overwrite_binary_mode |
283 || FETCH_CHAR (point) != '\t' | |
282 || XINT (current_buffer->tab_width) <= 0 | 284 || XINT (current_buffer->tab_width) <= 0 |
283 || !((current_column () + 1) % XFASTINT (current_buffer->tab_width)))) | 285 || !((current_column () + 1) % XFASTINT (current_buffer->tab_width)))) |
284 { | 286 { |
285 del_range (point, point + 1); | 287 del_range (point, point + 1); |
286 hairy = 1; | 288 hairy = 1; |
330 staticpro (&Qkill_backward_chars); | 332 staticpro (&Qkill_backward_chars); |
331 | 333 |
332 Qkill_forward_chars = intern ("kill-forward-chars"); | 334 Qkill_forward_chars = intern ("kill-forward-chars"); |
333 staticpro (&Qkill_forward_chars); | 335 staticpro (&Qkill_forward_chars); |
334 | 336 |
337 DEFVAR_BOOL ("overwrite-binary-mode", &overwrite_binary_mode, | |
338 "*Non-nil means overwrite mode treats tab and newline normally.\n\ | |
339 Ordinarily, overwriting preserves a tab until its whole width is overwritten\n\ | |
340 and never replaces a newline."); | |
341 overwrite_tabs_mode = 1; | |
342 | |
335 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function, | 343 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function, |
336 "Function called, if non-nil, whenever a close parenthesis is inserted.\n\ | 344 "Function called, if non-nil, whenever a close parenthesis is inserted.\n\ |
337 More precisely, a char with closeparen syntax is self-inserted."); | 345 More precisely, a char with closeparen syntax is self-inserted."); |
338 Vblink_paren_function = Qnil; | 346 Vblink_paren_function = Qnil; |
339 | 347 |