aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorRichard M. Stallman1999-11-09 19:00:59 +0000
committerRichard M. Stallman1999-11-09 19:00:59 +0000
commit2c6ea900ee425a3cfc23b625b4841b89af407e78 (patch)
tree3ad45a6a0bdaa25c5ab9ebfd65bc0cdae3f81fa9 /src/syntax.c
parentc252ce765356c8aed23effba20e05caff8ebf215 (diff)
downloademacs-2c6ea900ee425a3cfc23b625b4841b89af407e78.tar.gz
emacs-2c6ea900ee425a3cfc23b625b4841b89af407e78.zip
(Fforward_word): Handle fields even if would have hit
an edge of the buffer. Return nil if affected by fields.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 60501f9677f..da28d6eed6d 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1222,26 +1222,24 @@ scan_words (from, count)
1222DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p", 1222DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p",
1223 "Move point forward ARG words (backward if ARG is negative).\n\ 1223 "Move point forward ARG words (backward if ARG is negative).\n\
1224Normally returns t.\n\ 1224Normally returns t.\n\
1225If an edge of the buffer is reached, point is left there\n\ 1225If an edge of the buffer or a field boundary is reached, point is left there\n\
1226and nil is returned.") 1226and the function returns nil.")
1227 (count) 1227 (count)
1228 Lisp_Object count; 1228 Lisp_Object count;
1229{ 1229{
1230 int val, prompt_end; 1230 int orig_val, val;
1231 CHECK_NUMBER (count, 0); 1231 CHECK_NUMBER (count, 0);
1232 1232
1233 if (!(val = scan_words (PT, XINT (count)))) 1233 val = orig_val = scan_words (PT, XINT (count));
1234 { 1234 if (! orig_val)
1235 SET_PT (XINT (count) > 0 ? ZV : BEGV); 1235 val = XINT (count) > 0 ? ZV : BEGV;
1236 return Qnil;
1237 }
1238 1236
1239 /* Avoid jumping out of an input field. */ 1237 /* Avoid jumping out of an input field. */
1240 val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT), 1238 val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT),
1241 Qt, Qnil)); 1239 Qt, Qnil));
1242 1240
1243 SET_PT (val); 1241 SET_PT (val);
1244 return Qt; 1242 return (val == orig_val ? Qt : Qnil);
1245} 1243}
1246 1244
1247Lisp_Object skip_chars (); 1245Lisp_Object skip_chars ();