comparison src/cmds.c @ 40041:9d6d2c8564b3

(Fbeginning_of_line, Fend_of_line): Clarify interaction with fields and suggest using `forward-line' to avoid them.
author Miles Bader <miles@gnu.org>
date Fri, 19 Oct 2001 06:19:07 +0000
parents 42b7a798ff79
children cdfd4d09b79a
comparison
equal deleted inserted replaced
40040:51d732cff5a4 40041:9d6d2c8564b3
1 /* Simple built-in editing commands. 1 /* Simple built-in editing commands.
2 Copyright (C) 1985, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. 2 Copyright (C) 1985, 93, 94, 95, 96, 97, 1998, 2001 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
148 shortage--; 148 shortage--;
149 149
150 return make_number (count <= 0 ? - shortage : shortage); 150 return make_number (count <= 0 ? - shortage : shortage);
151 } 151 }
152 152
153 DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, 153 DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, 0, 1, "p",
154 0, 1, "p", 154 doc: /* Move point to beginning of current line.
155 "Move point to beginning of current line.\n\ 155 With argument N not nil or 1, move forward N - 1 lines first.
156 With argument N not nil or 1, move forward N - 1 lines first.\n\ 156 If point reaches the beginning or end of buffer, it stops there.
157 If point reaches the beginning or end of buffer, it stops there.\n\ 157
158 This command does not move point across a field boundary\n\ 158 This command does not move point across a field boundary unless doing so
159 unless it would move beyond there to a different line.\n\ 159 would move beyond there to a different line; If N is nil or 1, and point
160 If N is nil or 1, and point starts at a field boundary, point does not move.") 160 starts at a field boundary, point does not move. To ignore field
161 (n) 161 boundaries, either bind `inhibit-field-text-motion' to t, or use the
162 `forward-line' function instead. For instance, `(forward-line 0)' does
163 the same thing as `(beginning-of-line)', except that it ignores field
164 boundaries. */)
165 (n)
162 Lisp_Object n; 166 Lisp_Object n;
163 { 167 {
164 if (NILP (n)) 168 if (NILP (n))
165 XSETFASTINT (n, 1); 169 XSETFASTINT (n, 1);
166 else 170 else
169 SET_PT (XINT (Fline_beginning_position (n))); 173 SET_PT (XINT (Fline_beginning_position (n)));
170 174
171 return Qnil; 175 return Qnil;
172 } 176 }
173 177
174 DEFUN ("end-of-line", Fend_of_line, Send_of_line, 178 DEFUN ("end-of-line", Fend_of_line, Send_of_line, 0, 1, "p",
175 0, 1, "p", 179 doc: /* Move point to end of current line.
176 "Move point to end of current line.\n\ 180 With argument N not nil or 1, move forward N - 1 lines first.
177 With argument N not nil or 1, move forward N - 1 lines first.\n\ 181 If point reaches the beginning or end of buffer, it stops there.
178 If point reaches the beginning or end of buffer, it stops there.\n\ 182
179 This command does not move point across a field boundary\n\ 183 This command does not move point across a field boundary unless doing so
180 unless it would move beyond there to a different line.\n\ 184 would move beyond there to a different line; if N is nil or 1, and
181 If N is nil or 1, and point starts at a field boundary, point does not move.") 185 point starts at a field boundary, point does not move. To ignore field
182 (n) 186 boundaries bind `inhibit-field-text-motion' to t. */)
187 (n)
183 Lisp_Object n; 188 Lisp_Object n;
184 { 189 {
185 if (NILP (n)) 190 if (NILP (n))
186 XSETFASTINT (n, 1); 191 XSETFASTINT (n, 1);
187 else 192 else