X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d113efea8e0a56aedd60615f5dc6669c72aca77f..d2ad6275c8b11d33d6bbfa9359420d534aa641bc:/src/cmds.c diff --git a/src/cmds.c b/src/cmds.c index 1ac81af45a..72d35b8cef 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -1,6 +1,6 @@ /* 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 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -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 @@ -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; { @@ -183,10 +183,11 @@ 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-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; { @@ -535,7 +536,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;