(Fdelete_backward_char): Count both bytes and chars.
This commit is contained in:
parent
1d1293ddf1
commit
ceb7e4f8e7
1 changed files with 6 additions and 5 deletions
11
src/cmds.c
11
src/cmds.c
|
@ -235,18 +235,19 @@ N was explicitly specified.")
|
|||
{
|
||||
Lisp_Object value;
|
||||
int deleted_special = 0;
|
||||
int pos, i;
|
||||
int pos, pos_byte, i;
|
||||
|
||||
CHECK_NUMBER (n, 0);
|
||||
|
||||
/* See if we are about to delete a tab or newline backwards. */
|
||||
pos = PT_BYTE;
|
||||
for (i = 0; i < XINT (n) && pos > BEGV_BYTE; i++)
|
||||
pos = PT;
|
||||
pos_byte = PT_BYTE;
|
||||
for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++)
|
||||
{
|
||||
int c;
|
||||
|
||||
DEC_POS (pos);
|
||||
c = FETCH_BYTE (pos);
|
||||
DEC_BOTH (pos, pos_byte);
|
||||
c = FETCH_BYTE (pos_byte);
|
||||
if (c == '\t' || c == '\n')
|
||||
{
|
||||
deleted_special = 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue