changeset 15875:5ffb83189a1b

(Fdelete_backward_char): Fix off-by-one error. Treat deleted newline specially.
author Karl Heuer <kwzh@gnu.org>
date Fri, 16 Aug 1996 23:14:09 +0000
parents 48c181ba52a8
children d814bc72503f
files src/cmds.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/cmds.c	Fri Aug 16 19:09:34 1996 +0000
+++ b/src/cmds.c	Fri Aug 16 23:14:09 1996 +0000
@@ -208,19 +208,19 @@
      Lisp_Object n, killflag;
 {
   Lisp_Object value;
-  int deleted_tab = 0;
+  int deleted_special = 0;
   int i;
 
   CHECK_NUMBER (n, 0);
 
-  /* See if we are about to delete a tab backwards.  */
-  for (i = 0; i < XINT (n); i++)
+  /* See if we are about to delete a tab or newline backwards.  */
+  for (i = 1; i <= XINT (n); i++)
     {
       if (point - i < BEGV)
 	break;
-      if (FETCH_CHAR (point - i) == '\t')
+      if (FETCH_CHAR (point - i) == '\t' || FETCH_CHAR (point - i) == '\n')
 	{
-	  deleted_tab = 1;
+	  deleted_special = 1;
 	  break;
 	}
     }
@@ -231,7 +231,7 @@
      unless at end of line.  */
   if (XINT (n) > 0
       && ! NILP (current_buffer->overwrite_mode)
-      && ! deleted_tab
+      && ! deleted_special
       && ! (point == ZV || FETCH_CHAR (point) == '\n'))
     {
       Finsert_char (make_number (' '), XINT (n));