]> code.delx.au - gnu-emacs/blobdiff - src/cmds.c
(SYSTEM_TYPE): Use berkeley-unix.
[gnu-emacs] / src / cmds.c
index 2a212ad6223c0019669fe530aed39170882cd01c..c8e9bfd76ec02ff7d10defd20d89dcf9b77b602d 100644 (file)
@@ -1,11 +1,11 @@
 /* Simple built-in editing commands.
-   Copyright (C) 1985 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1992 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -94,7 +94,8 @@ With positive ARG, a non-empty line at the end counts as one line\n\
   pos = scan_buffer ('\n', pos2, count - negp, &shortage);
   if (shortage > 0
       && (negp
-         || (ZV >= BEGV
+         || (ZV > BEGV
+             && pos != pos2
              && FETCH_CHAR (pos - 1) != '\n')))
     shortage--;
   SET_PT (pos);
@@ -255,6 +256,12 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long.")
   return Qnil;
 }
 
+/* Insert character C1.  If NOAUTOFILL is nonzero, don't do autofill
+   even if it is enabled.
+
+   If this insertion is suitable for direct output (completely simple),
+   return 0.  A value of 1 indicates this *might* not have been simple.  */
+
 internal_self_insert (c1, noautofill)
      char c1;
      int noautofill;
@@ -283,8 +290,12 @@ internal_self_insert (c1, noautofill)
       && NILP (current_buffer->read_only)
       && point > BEGV && SYNTAX (FETCH_CHAR (point - 1)) == Sword)
     {
-      tem = Fexpand_abbrev ();
-      if (!NILP (tem))
+      int modiff = MODIFF;
+      Fexpand_abbrev ();
+      /* We can't trust the value of Fexpand_abbrev,
+        but if Fexpand_abbrev changed the buffer,
+        assume it expanded something.  */
+      if (MODIFF != modiff)
        hairy = 1;
     }
   if ((c == ' ' || c == '\n')