comparison src/cmds.c @ 20958:806727604be8

(Fdelete_backward_char): Count both bytes and chars.
author Karl Heuer <kwzh@gnu.org>
date Sun, 22 Feb 1998 01:06:06 +0000
parents ed9ed828415e
children 3bf522f06501
comparison
equal deleted inserted replaced
20957:25bb3da85d05 20958:806727604be8
233 (n, killflag) 233 (n, killflag)
234 Lisp_Object n, killflag; 234 Lisp_Object n, killflag;
235 { 235 {
236 Lisp_Object value; 236 Lisp_Object value;
237 int deleted_special = 0; 237 int deleted_special = 0;
238 int pos, i; 238 int pos, pos_byte, i;
239 239
240 CHECK_NUMBER (n, 0); 240 CHECK_NUMBER (n, 0);
241 241
242 /* See if we are about to delete a tab or newline backwards. */ 242 /* See if we are about to delete a tab or newline backwards. */
243 pos = PT_BYTE; 243 pos = PT;
244 for (i = 0; i < XINT (n) && pos > BEGV_BYTE; i++) 244 pos_byte = PT_BYTE;
245 for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++)
245 { 246 {
246 int c; 247 int c;
247 248
248 DEC_POS (pos); 249 DEC_BOTH (pos, pos_byte);
249 c = FETCH_BYTE (pos); 250 c = FETCH_BYTE (pos_byte);
250 if (c == '\t' || c == '\n') 251 if (c == '\t' || c == '\n')
251 { 252 {
252 deleted_special = 1; 253 deleted_special = 1;
253 break; 254 break;
254 } 255 }