aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1996-08-16 23:14:09 +0000
committerKarl Heuer1996-08-16 23:14:09 +0000
commit7c98317117409635639de6eb311e9fc508762ef1 (patch)
treed997c16f36b5b48dbeee95019be0c1e2f737da78 /src
parent24ff6e06b36286cf6e7cb581477258164fb45f69 (diff)
downloademacs-7c98317117409635639de6eb311e9fc508762ef1.tar.gz
emacs-7c98317117409635639de6eb311e9fc508762ef1.zip
(Fdelete_backward_char): Fix off-by-one error.
Treat deleted newline specially.
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 5c0f7cd4751..9c29982cc80 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -208,19 +208,19 @@ N was explicitly specified.")
208 Lisp_Object n, killflag; 208 Lisp_Object n, killflag;
209{ 209{
210 Lisp_Object value; 210 Lisp_Object value;
211 int deleted_tab = 0; 211 int deleted_special = 0;
212 int i; 212 int i;
213 213
214 CHECK_NUMBER (n, 0); 214 CHECK_NUMBER (n, 0);
215 215
216 /* See if we are about to delete a tab backwards. */ 216 /* See if we are about to delete a tab or newline backwards. */
217 for (i = 0; i < XINT (n); i++) 217 for (i = 1; i <= XINT (n); i++)
218 { 218 {
219 if (point - i < BEGV) 219 if (point - i < BEGV)
220 break; 220 break;
221 if (FETCH_CHAR (point - i) == '\t') 221 if (FETCH_CHAR (point - i) == '\t' || FETCH_CHAR (point - i) == '\n')
222 { 222 {
223 deleted_tab = 1; 223 deleted_special = 1;
224 break; 224 break;
225 } 225 }
226 } 226 }
@@ -231,7 +231,7 @@ N was explicitly specified.")
231 unless at end of line. */ 231 unless at end of line. */
232 if (XINT (n) > 0 232 if (XINT (n) > 0
233 && ! NILP (current_buffer->overwrite_mode) 233 && ! NILP (current_buffer->overwrite_mode)
234 && ! deleted_tab 234 && ! deleted_special
235 && ! (point == ZV || FETCH_CHAR (point) == '\n')) 235 && ! (point == ZV || FETCH_CHAR (point) == '\n'))
236 { 236 {
237 Finsert_char (make_number (' '), XINT (n)); 237 Finsert_char (make_number (' '), XINT (n));