aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2003-08-17 00:25:17 +0000
committerRichard M. Stallman2003-08-17 00:25:17 +0000
commit29e16385d0a531e25b18fbb13cc7111a2650eecc (patch)
tree55910b266029b7fd8afd8ba8961f0d7e9282244d /src
parent2a6f12e29a4c719f586fc9df92254d967d38f36e (diff)
downloademacs-29e16385d0a531e25b18fbb13cc7111a2650eecc.tar.gz
emacs-29e16385d0a531e25b18fbb13cc7111a2650eecc.zip
(Fforward_word): Argument changed to optional. Set default value to 1.
Diffstat (limited to 'src')
-rw-r--r--src/syntax.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 706706a53a1..eef646b21dd 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1277,21 +1277,25 @@ scan_words (from, count)
1277 return from; 1277 return from;
1278} 1278}
1279 1279
1280DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p", 1280DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 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).
1282Normally returns t. 1282Normally returns t.
1283If an edge of the buffer or a field boundary is reached, point is left there 1283If an edge of the buffer or a field boundary is reached, point is left there
1284and the function returns nil. Field boundaries are not noticed if 1284and 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 (count) 1286 (arg)
1287 Lisp_Object count; 1287 Lisp_Object arg;
1288{ 1288{
1289 int orig_val, val; 1289 int orig_val, val;
1290 CHECK_NUMBER (count);
1291 1290
1292 val = orig_val = scan_words (PT, XINT (count)); 1291 if (NILP (arg))
1292 XSETFASTINT (arg, 1);
1293 else
1294 CHECK_NUMBER (arg);
1295
1296 val = orig_val = scan_words (PT, XINT (arg));
1293 if (! orig_val) 1297 if (! orig_val)
1294 val = XINT (count) > 0 ? ZV : BEGV; 1298 val = XINT (arg) > 0 ? ZV : BEGV;
1295 1299
1296 /* Avoid jumping out of an input field. */ 1300 /* Avoid jumping out of an input field. */
1297 val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT), 1301 val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT),