summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2003-08-17 00:25:17 +0000
committerRichard M. Stallman <rms@gnu.org>2003-08-17 00:25:17 +0000
commit29e16385d0a531e25b18fbb13cc7111a2650eecc (patch)
tree55910b266029b7fd8afd8ba8961f0d7e9282244d
parent2a6f12e29a4c719f586fc9df92254d967d38f36e (diff)
downloademacs-29e16385d0a531e25b18fbb13cc7111a2650eecc.tar.gz
(Fforward_word): Argument changed to optional. Set default value to 1.
-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)
return from;
}
-DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p",
+DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "p",
doc: /* Move point forward ARG words (backward if ARG is negative).
Normally returns t.
If an edge of the buffer or a field boundary is reached, point is left there
and the function returns nil. Field boundaries are not noticed if
`inhibit-field-text-motion' is non-nil. */)
- (count)
- Lisp_Object count;
+ (arg)
+ Lisp_Object arg;
{
int orig_val, val;
- CHECK_NUMBER (count);
- val = orig_val = scan_words (PT, XINT (count));
+ if (NILP (arg))
+ XSETFASTINT (arg, 1);
+ else
+ CHECK_NUMBER (arg);
+
+ val = orig_val = scan_words (PT, XINT (arg));
if (! orig_val)
- val = XINT (count) > 0 ? ZV : BEGV;
+ val = XINT (arg) > 0 ? ZV : BEGV;
/* Avoid jumping out of an input field. */
val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT),