diff options
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/syntax.c b/src/syntax.c index 79df112d265..706706a53a1 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -1277,25 +1277,21 @@ scan_words (from, count) | |||
| 1277 | return from; | 1277 | return from; |
| 1278 | } | 1278 | } |
| 1279 | 1279 | ||
| 1280 | DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "p", | 1280 | DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p", |
| 1281 | doc: /* Move point forward ARG words (backward if ARG is negative). | 1281 | doc: /* Move point forward ARG words (backward if ARG is negative). |
| 1282 | Normally returns t. | 1282 | Normally returns t. |
| 1283 | If an edge of the buffer or a field boundary is reached, point is left there | 1283 | If an edge of the buffer or a field boundary is reached, point is left there |
| 1284 | and the function returns nil. Field boundaries are not noticed if | 1284 | and the function returns nil. Field boundaries are not noticed if |
| 1285 | `inhibit-field-text-motion' is non-nil. */) | 1285 | `inhibit-field-text-motion' is non-nil. */) |
| 1286 | (arg) | 1286 | (count) |
| 1287 | Lisp_Object arg; | 1287 | Lisp_Object count; |
| 1288 | { | 1288 | { |
| 1289 | int orig_val, val; | 1289 | int orig_val, val; |
| 1290 | CHECK_NUMBER (count); | ||
| 1290 | 1291 | ||
| 1291 | if (NILP (arg)) | 1292 | val = orig_val = scan_words (PT, XINT (count)); |
| 1292 | XSETFASTINT (arg, 1); | ||
| 1293 | else | ||
| 1294 | CHECK_NUMBER (arg); | ||
| 1295 | |||
| 1296 | val = orig_val = scan_words (PT, XINT (arg)); | ||
| 1297 | if (! orig_val) | 1293 | if (! orig_val) |
| 1298 | val = XINT (arg) > 0 ? ZV : BEGV; | 1294 | val = XINT (count) > 0 ? ZV : BEGV; |
| 1299 | 1295 | ||
| 1300 | /* Avoid jumping out of an input field. */ | 1296 | /* Avoid jumping out of an input field. */ |
| 1301 | val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT), | 1297 | val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT), |
| @@ -3110,6 +3106,3 @@ See the info node `(elisp)Syntax Properties' for a description of the | |||
| 3110 | defsubr (&Sbackward_prefix_chars); | 3106 | defsubr (&Sbackward_prefix_chars); |
| 3111 | defsubr (&Sparse_partial_sexp); | 3107 | defsubr (&Sparse_partial_sexp); |
| 3112 | } | 3108 | } |
| 3113 | |||
| 3114 | /* arch-tag: 3e297b9f-088e-4b64-8f4c-fb0b3443e412 | ||
| 3115 | (do not change this comment) */ | ||