X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fcmds.c;h=881bb63f49762ef5a6bed6d2fb89a3e06da8d3f5;hp=82e75689d9c0ab1ed5606bfde63aedeb1be4b6a9;hb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;hpb=a40368ea9486a5da02004feb1254b9cceb857228 diff --git a/src/cmds.c b/src/cmds.c index 82e7568..881bb63 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -196,7 +196,7 @@ This function does not move point. (count, buffer)) { struct buffer *buf = decode_buffer (buffer, 1); - int n; + EMACS_INT n; if (NILP (count)) n = 1; @@ -224,7 +224,7 @@ If BUFFER is nil, the current buffer is assumed. return Qnil; } -DEFUN ("delete-char", Fdelete_char, 1, 2, "*p\nP", /* +DEFUN ("delete-char", Fdelete_char, 0, 2, "*p\nP", /* Delete the following COUNT characters (previous, with negative COUNT). Optional second arg KILLP non-nil means kill instead (save in kill ring). Interactively, COUNT is the prefix arg, and KILLP is set if @@ -235,10 +235,15 @@ COUNT was explicitly specified. /* This function can GC */ Bufpos pos; struct buffer *buf = current_buffer; - int n; + EMACS_INT n; - CHECK_INT (count); - n = XINT (count); + if (NILP (count)) + n = 1; + else + { + CHECK_INT (count); + n = XINT (count); + } pos = BUF_PT (buf) + n; if (NILP (killp)) @@ -265,7 +270,7 @@ COUNT was explicitly specified. return Qnil; } -DEFUN ("delete-backward-char", Fdelete_backward_char, 1, 2, "*p\nP", /* +DEFUN ("delete-backward-char", Fdelete_backward_char, 0, 2, "*p\nP", /* Delete the previous COUNT characters (following, with negative COUNT). Optional second arg KILLP non-nil means kill instead (save in kill ring). Interactively, COUNT is the prefix arg, and KILLP is set if @@ -274,8 +279,17 @@ COUNT was explicitly specified. (count, killp)) { /* This function can GC */ - CHECK_INT (count); - return Fdelete_char (make_int (- XINT (count)), killp); + EMACS_INT n; + + if (NILP (count)) + n = 1; + else + { + CHECK_INT (count); + n = XINT (count); + } + + return Fdelete_char (make_int (- n), killp); } static void internal_self_insert (Emchar ch, int noautofill); @@ -290,7 +304,7 @@ If a prefix arg COUNT is specified, the character is inserted COUNT times. /* This function can GC */ Emchar ch; Lisp_Object c; - int n; + EMACS_INT n; CHECK_NATNUM (count); n = XINT (count);