comparison src/syntax.c @ 26391:216416ad34fe

(Fforward_word): Handle fields even if would have hit an edge of the buffer. Return nil if affected by fields.
author Richard M. Stallman <rms@gnu.org>
date Tue, 09 Nov 1999 19:00:59 +0000
parents 1cbb1b30793d
children b7438760079b
comparison
equal deleted inserted replaced
26390:5aa0cfc19c76 26391:216416ad34fe
1220 } 1220 }
1221 1221
1222 DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p", 1222 DEFUN ("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\
1224 Normally returns t.\n\ 1224 Normally returns t.\n\
1225 If an edge of the buffer is reached, point is left there\n\ 1225 If an edge of the buffer or a field boundary is reached, point is left there\n\
1226 and nil is returned.") 1226 and 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
1247 Lisp_Object skip_chars (); 1245 Lisp_Object skip_chars ();
1248 1246
1249 DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0, 1247 DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0,