Mercurial > hg > xemacs-beta
comparison src/cmds.c @ 446:1ccc32a20af4 r21-2-38
Import from CVS: tag r21-2-38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:37:21 +0200 |
parents | 576fb035e263 |
children | 0784d089fdc9 |
comparison
equal
deleted
inserted
replaced
445:34f3776fcf0e | 446:1ccc32a20af4 |
---|---|
194 This function does not move point. | 194 This function does not move point. |
195 */ | 195 */ |
196 (count, buffer)) | 196 (count, buffer)) |
197 { | 197 { |
198 struct buffer *buf = decode_buffer (buffer, 1); | 198 struct buffer *buf = decode_buffer (buffer, 1); |
199 int n; | 199 EMACS_INT n; |
200 | 200 |
201 if (NILP (count)) | 201 if (NILP (count)) |
202 n = 1; | 202 n = 1; |
203 else | 203 else |
204 { | 204 { |
222 | 222 |
223 BUF_SET_PT (b, XINT (Fpoint_at_eol (count, buffer))); | 223 BUF_SET_PT (b, XINT (Fpoint_at_eol (count, buffer))); |
224 return Qnil; | 224 return Qnil; |
225 } | 225 } |
226 | 226 |
227 DEFUN ("delete-char", Fdelete_char, 1, 2, "*p\nP", /* | 227 DEFUN ("delete-char", Fdelete_char, 0, 2, "*p\nP", /* |
228 Delete the following COUNT characters (previous, with negative COUNT). | 228 Delete the following COUNT characters (previous, with negative COUNT). |
229 Optional second arg KILLP non-nil means kill instead (save in kill ring). | 229 Optional second arg KILLP non-nil means kill instead (save in kill ring). |
230 Interactively, COUNT is the prefix arg, and KILLP is set if | 230 Interactively, COUNT is the prefix arg, and KILLP is set if |
231 COUNT was explicitly specified. | 231 COUNT was explicitly specified. |
232 */ | 232 */ |
233 (count, killp)) | 233 (count, killp)) |
234 { | 234 { |
235 /* This function can GC */ | 235 /* This function can GC */ |
236 Bufpos pos; | 236 Bufpos pos; |
237 struct buffer *buf = current_buffer; | 237 struct buffer *buf = current_buffer; |
238 int n; | 238 EMACS_INT n; |
239 | 239 |
240 CHECK_INT (count); | 240 if (NILP (count)) |
241 n = XINT (count); | 241 n = 1; |
242 else | |
243 { | |
244 CHECK_INT (count); | |
245 n = XINT (count); | |
246 } | |
242 | 247 |
243 pos = BUF_PT (buf) + n; | 248 pos = BUF_PT (buf) + n; |
244 if (NILP (killp)) | 249 if (NILP (killp)) |
245 { | 250 { |
246 if (n < 0) | 251 if (n < 0) |
263 call1 (Qkill_forward_chars, count); | 268 call1 (Qkill_forward_chars, count); |
264 } | 269 } |
265 return Qnil; | 270 return Qnil; |
266 } | 271 } |
267 | 272 |
268 DEFUN ("delete-backward-char", Fdelete_backward_char, 1, 2, "*p\nP", /* | 273 DEFUN ("delete-backward-char", Fdelete_backward_char, 0, 2, "*p\nP", /* |
269 Delete the previous COUNT characters (following, with negative COUNT). | 274 Delete the previous COUNT characters (following, with negative COUNT). |
270 Optional second arg KILLP non-nil means kill instead (save in kill ring). | 275 Optional second arg KILLP non-nil means kill instead (save in kill ring). |
271 Interactively, COUNT is the prefix arg, and KILLP is set if | 276 Interactively, COUNT is the prefix arg, and KILLP is set if |
272 COUNT was explicitly specified. | 277 COUNT was explicitly specified. |
273 */ | 278 */ |
274 (count, killp)) | 279 (count, killp)) |
275 { | 280 { |
276 /* This function can GC */ | 281 /* This function can GC */ |
277 CHECK_INT (count); | 282 EMACS_INT n; |
278 return Fdelete_char (make_int (- XINT (count)), killp); | 283 |
284 if (NILP (count)) | |
285 n = 1; | |
286 else | |
287 { | |
288 CHECK_INT (count); | |
289 n = XINT (count); | |
290 } | |
291 | |
292 return Fdelete_char (make_int (- n), killp); | |
279 } | 293 } |
280 | 294 |
281 static void internal_self_insert (Emchar ch, int noautofill); | 295 static void internal_self_insert (Emchar ch, int noautofill); |
282 | 296 |
283 DEFUN ("self-insert-command", Fself_insert_command, 1, 1, "*p", /* | 297 DEFUN ("self-insert-command", Fself_insert_command, 1, 1, "*p", /* |
288 (count)) | 302 (count)) |
289 { | 303 { |
290 /* This function can GC */ | 304 /* This function can GC */ |
291 Emchar ch; | 305 Emchar ch; |
292 Lisp_Object c; | 306 Lisp_Object c; |
293 int n; | 307 EMACS_INT n; |
294 | 308 |
295 CHECK_NATNUM (count); | 309 CHECK_NATNUM (count); |
296 n = XINT (count); | 310 n = XINT (count); |
297 | 311 |
298 if (CHAR_OR_CHAR_INTP (Vlast_command_char)) | 312 if (CHAR_OR_CHAR_INTP (Vlast_command_char)) |