[INCLUDED_FCNTL]: Don't include fcntl.h again.
[bpt/emacs.git] / src / cmds.c
index 1025c9c..b6411d4 100644 (file)
@@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 
-#include "config.h"
+#include <config.h>
 #include "lisp.h"
 #include "commands.h"
 #include "buffer.h"
 #include "lisp.h"
 #include "commands.h"
 #include "buffer.h"
@@ -105,7 +105,7 @@ With positive ARG, a non-empty line at the end counts as one line\n\
     }
 
   negp = count <= 0;
     }
 
   negp = count <= 0;
-  pos = scan_buffer ('\n', pos2, count - negp, &shortage);
+  pos = scan_buffer ('\n', pos2, count - negp, &shortage, 1);
   if (shortage > 0
       && (negp
          || (ZV > BEGV
   if (shortage > 0
       && (negp
          || (ZV > BEGV
@@ -241,10 +241,10 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long.")
   arg = Fprefix_numeric_value (arg1);
 
   if (!NILP (current_buffer->read_only))
   arg = Fprefix_numeric_value (arg1);
 
   if (!NILP (current_buffer->read_only))
-    Fsignal (Qbuffer_read_only, Qnil);
+    Fbarf_if_buffer_read_only ();
 
   /* Inserting a newline at the end of a line produces better
 
   /* Inserting a newline at the end of a line produces better
-     redisplay in try_window_id than inserting at the ebginning fo a
+     redisplay in try_window_id than inserting at the beginning of a
      line, and the textual result is the same.  So, if we're at
      beginning of line, pretend to be at the end of the previous line.  
 
      line, and the textual result is the same.  So, if we're at
      beginning of line, pretend to be at the end of the previous line.  
 
@@ -253,6 +253,15 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long.")
      features all do nothing in that case.  */
 
   flag = point > BEGV && FETCH_CHAR (point - 1) == '\n';
      features all do nothing in that case.  */
 
   flag = point > BEGV && FETCH_CHAR (point - 1) == '\n';
+#ifdef USE_TEXT_PROPERTIES
+  /* We cannot use this optimization if properties change
+     in the vicinity.
+     ??? We need to check for change hook properties, etc.  */
+  if (flag)
+    if (! (point - 1 > BEGV && ! property_change_between_p (point - 2, point)))
+      flag = 0;
+#endif
+
   if (flag)
     SET_PT (point - 1);
 
   if (flag)
     SET_PT (point - 1);
 
@@ -286,8 +295,9 @@ internal_self_insert (c1, noautofill)
   Lisp_Object tem;
   register enum syntaxcode synt;
   register int c = c1;
   Lisp_Object tem;
   register enum syntaxcode synt;
   register int c = c1;
-  Lisp_Object overwrite = current_buffer->overwrite_mode;
+  Lisp_Object overwrite;
 
 
+  overwrite = current_buffer->overwrite_mode;
   if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function))
     hairy = 1;
 
   if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function))
     hairy = 1;
 
@@ -380,7 +390,11 @@ keys_of_cmds ()
   initial_define_key (global_map, Ctl('I'), "self-insert-command");
   for (n = 040; n < 0177; n++)
     initial_define_key (global_map, n, "self-insert-command");
   initial_define_key (global_map, Ctl('I'), "self-insert-command");
   for (n = 040; n < 0177; n++)
     initial_define_key (global_map, n, "self-insert-command");
-  for (n = 0240; n < 0377; n++)
+#ifdef MSDOS
+  for (n = 0200; n < 0240; n++)
+    initial_define_key (global_map, n, "self-insert-command");
+#endif
+  for (n = 0240; n < 0400; n++)
     initial_define_key (global_map, n, "self-insert-command");
 
   initial_define_key (global_map, Ctl ('A'), "beginning-of-line");
     initial_define_key (global_map, n, "self-insert-command");
 
   initial_define_key (global_map, Ctl ('A'), "beginning-of-line");