(Fformat): When formatting an integer as float take precision into account.
[bpt/emacs.git] / src / cmds.c
index 4d7228e..b89074f 100644 (file)
@@ -1,12 +1,12 @@
 /* Simple built-in editing commands.
-   Copyright (C) 1985, 93, 94, 95, 96, 97, 1998, 2001, 02, 03
-             Free Software Foundation, Inc.
+   Copyright (C) 1985, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002,
+                 2003, 2004, 2005, 2006, 2007 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 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -16,8 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 
 #include <config.h>
@@ -77,12 +77,12 @@ On reaching end of buffer, stop and signal error.  */)
     if (new_point < BEGV)
       {
        SET_PT (BEGV);
-       Fsignal (Qbeginning_of_buffer, Qnil);
+       xsignal0 (Qbeginning_of_buffer);
       }
     if (new_point > ZV)
       {
        SET_PT (ZV);
-       Fsignal (Qend_of_buffer, Qnil);
+       xsignal0 (Qend_of_buffer);
       }
 
     SET_PT (new_point);
@@ -157,13 +157,13 @@ DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, 0, 1, "p",
 With argument N not nil or 1, move forward N - 1 lines first.
 If point reaches the beginning or end of buffer, it stops there.
 
-This command does not move point across a field boundary unless doing so
-would move beyond there to a different line; If N is nil or 1, and point
-starts at a field boundary, point does not move.  To ignore field
-boundaries, either bind `inhibit-field-text-motion' to t, or use the
-`forward-line' function instead.  For instance, `(forward-line 0)' does
-the same thing as `(beginning-of-line)', except that it ignores field
-boundaries.  */)
+This function constrains point to the current field unless this moves
+point to a different line than the original, unconstrained result.  If
+N is nil or 1, and a front-sticky field starts at point, the point
+does not move.  To ignore field boundaries bind
+`inhibit-field-text-motion' to t, or use the `forward-line' function
+instead.  For instance, `(forward-line 0)' does the same thing as
+`(beginning-of-line)', except that it ignores field boundaries.  */)
      (n)
      Lisp_Object n;
 {
@@ -181,12 +181,13 @@ DEFUN ("end-of-line", Fend_of_line, Send_of_line, 0, 1, "p",
        doc: /* Move point to end of current line.
 With argument N not nil or 1, move forward N - 1 lines first.
 If point reaches the beginning or end of buffer, it stops there.
-To ignore intangibility, bind `inhibit-text-motion-hooks' to t.
+To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
 
-This command does not move point across a field boundary unless doing so
-would move beyond there to a different line; if N is nil or 1, and
-point starts at a field boundary, point does not move.  To ignore field
-boundaries bind `inhibit-field-text-motion' to t.  */)
+This function constrains point to the current field unless this moves
+point to a different line than the original, unconstrained result.  If
+N is nil or 1, and a rear-sticky field ends at point, the point does
+not move.  To ignore field boundaries bind `inhibit-field-text-motion'
+to t.  */)
      (n)
      Lisp_Object n;
 {
@@ -244,14 +245,14 @@ N was explicitly specified.  */)
       if (XINT (n) < 0)
        {
          if (pos < BEGV)
-           Fsignal (Qbeginning_of_buffer, Qnil);
+           xsignal0 (Qbeginning_of_buffer);
          else
            del_range (pos, PT);
        }
       else
        {
          if (pos > ZV)
-           Fsignal (Qend_of_buffer, Qnil);
+           xsignal0 (Qend_of_buffer);
          else
            del_range (PT, pos);
        }
@@ -527,7 +528,8 @@ internal_self_insert (c, noautofill)
           justification, if any, know where the end is going to be.  */
        SET_PT_BOTH (PT - 1, PT_BYTE - 1);
       tem = call0 (current_buffer->auto_fill_function);
-      if (c == '\n')
+      /* Test PT < ZV in case the auto-fill-function is strange.  */
+      if (c == '\n' && PT < ZV)
        SET_PT_BOTH (PT + 1, PT_BYTE + 1);
       if (!NILP (tem))
        hairy = 2;
@@ -620,3 +622,6 @@ keys_of_cmds ()
   initial_define_key (global_map, Ctl ('F'), "forward-char");
   initial_define_key (global_map, 0177, "delete-backward-char");
 }
+
+/* arch-tag: 022ba3cd-67f9-4978-9c5d-7d2b18d8644e
+   (do not change this comment) */