diff options
| author | Jim Blandy | 1993-03-16 18:18:05 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-03-16 18:18:05 +0000 |
| commit | 6bbb0d4aaa68a2976cf3883fff8068c57f7a6bfa (patch) | |
| tree | 057fe5c5fdf095d8dc791f54ec793e60942149be /src/cmds.c | |
| parent | 80169ab5392d1bd5df9f6147bbb47e0edcba43fa (diff) | |
| download | emacs-6bbb0d4aaa68a2976cf3883fff8068c57f7a6bfa.tar.gz emacs-6bbb0d4aaa68a2976cf3883fff8068c57f7a6bfa.zip | |
* cmds.c (overwrite_binary_mode): Deleted; this implements the
wrong feature.
(Qoverwrite_mode_binary): New variable.
(internal_self_insert): If current_buffer->overwrite_mode is
`overwrite-mode-binary', do as overwrite_binary_mode used to.
(syms_of_cmds): Remove defvar of overwrite_binary_mode; initialize
Qoverwrite_mode_binary.
* buffer.c (syms_of_buffer): Doc fix for overwrite_mode.
* buffer.h (struct buffer): Doc fix.
Diffstat (limited to 'src/cmds.c')
| -rw-r--r-- | src/cmds.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cmds.c b/src/cmds.c index 9dfd2b48a8f..e81d7c61e59 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -26,7 +26,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 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 | /* A possible value for a buffer's overwrite-mode variable. */ |
| 30 | Lisp_Object Qoverwrite_mode_binary; | ||
| 31 | |||
| 30 | 32 | ||
| 31 | DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p", | 33 | DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p", |
| 32 | "Move point right ARG characters (left if ARG negative).\n\ | 34 | "Move point right ARG characters (left if ARG negative).\n\ |
| @@ -273,14 +275,16 @@ internal_self_insert (c1, noautofill) | |||
| 273 | Lisp_Object tem; | 275 | Lisp_Object tem; |
| 274 | register enum syntaxcode synt; | 276 | register enum syntaxcode synt; |
| 275 | register int c = c1; | 277 | register int c = c1; |
| 278 | Lisp_Object overwrite = current_buffer->overwrite_mode; | ||
| 276 | 279 | ||
| 277 | if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function)) | 280 | if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function)) |
| 278 | hairy = 1; | 281 | hairy = 1; |
| 279 | 282 | ||
| 280 | if (!NILP (current_buffer->overwrite_mode) | 283 | if (!NILP (overwrite) |
| 281 | && point < ZV | 284 | && point < ZV |
| 282 | && (overwrite_binary_mode || (c != '\n' && FETCH_CHAR (point) != '\n')) | 285 | && (EQ (overwrite, Qoverwrite_mode_binary) |
| 283 | && (overwrite_binary_mode | 286 | || (c != '\n' && FETCH_CHAR (point) != '\n')) |
| 287 | && (EQ (overwrite, Qoverwrite_mode_binary) | ||
| 284 | || FETCH_CHAR (point) != '\t' | 288 | || FETCH_CHAR (point) != '\t' |
| 285 | || XINT (current_buffer->tab_width) <= 0 | 289 | || XINT (current_buffer->tab_width) <= 0 |
| 286 | || XFASTINT (current_buffer->tab_width) > 20 | 290 | || XFASTINT (current_buffer->tab_width) > 20 |
| @@ -336,11 +340,8 @@ syms_of_cmds () | |||
| 336 | Qkill_forward_chars = intern ("kill-forward-chars"); | 340 | Qkill_forward_chars = intern ("kill-forward-chars"); |
| 337 | staticpro (&Qkill_forward_chars); | 341 | staticpro (&Qkill_forward_chars); |
| 338 | 342 | ||
| 339 | DEFVAR_BOOL ("overwrite-binary-mode", &overwrite_binary_mode, | 343 | Qoverwrite_mode_binary = intern ("overwrite-mode-binary"); |
| 340 | "*Non-nil means overwrite mode treats tab and newline normally.\n\ | 344 | staticpro (&Qoverwrite_mode_binary); |
| 341 | Ordinarily, overwriting preserves a tab until its whole width is overwritten\n\ | ||
| 342 | and never replaces a newline."); | ||
| 343 | overwrite_binary_mode = 1; | ||
| 344 | 345 | ||
| 345 | DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function, | 346 | DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function, |
| 346 | "Function called, if non-nil, whenever a close parenthesis is inserted.\n\ | 347 | "Function called, if non-nil, whenever a close parenthesis is inserted.\n\ |