/* Simple built-in editing commands.
Copyright (C) 1985, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002,
- 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Emacs.
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);
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;
{
If point reaches the beginning or end of buffer, it stops there.
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;
{
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);
}
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;