diff options
| author | Karl Heuer | 1998-02-22 01:06:06 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-02-22 01:06:06 +0000 |
| commit | ceb7e4f8e7946d6225f82d497cc46a05f4b49340 (patch) | |
| tree | 2979763732704209663f71d26eaa7816ce7ebbe3 /src | |
| parent | 1d1293ddf167be4451faa228266322dfcd8ac51d (diff) | |
| download | emacs-ceb7e4f8e7946d6225f82d497cc46a05f4b49340.tar.gz emacs-ceb7e4f8e7946d6225f82d497cc46a05f4b49340.zip | |
(Fdelete_backward_char): Count both bytes and chars.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmds.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cmds.c b/src/cmds.c index 4dedbf6a609..ba7745ac814 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -235,18 +235,19 @@ N was explicitly specified.") | |||
| 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; |