aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorGerd Moellmann1999-09-02 20:35:55 +0000
committerGerd Moellmann1999-09-02 20:35:55 +0000
commitce1dc5105eb5aaa6025ea2b4702c926efdc28d61 (patch)
tree15eb56c7a5d55fb0f2c48e417439059bd7a26ba4 /src/syntax.c
parent7ec44ec68f9fd212d3c4209a71148eb42daff7eb (diff)
downloademacs-ce1dc5105eb5aaa6025ea2b4702c926efdc28d61.tar.gz
emacs-ce1dc5105eb5aaa6025ea2b4702c926efdc28d61.zip
(Fforward_word): Stop at a mini-buffer prompt end
in both directions. Extend documentation.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 82fabc254e7..5b5eb341678 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1227,7 +1227,7 @@ and nil is returned.")
1227 (count) 1227 (count)
1228 Lisp_Object count; 1228 Lisp_Object count;
1229{ 1229{
1230 int val; 1230 int val, prompt_end;
1231 CHECK_NUMBER (count, 0); 1231 CHECK_NUMBER (count, 0);
1232 1232
1233 if (!(val = scan_words (PT, XINT (count)))) 1233 if (!(val = scan_words (PT, XINT (count))))
@@ -1236,16 +1236,15 @@ and nil is returned.")
1236 return Qnil; 1236 return Qnil;
1237 } 1237 }
1238 1238
1239 /* If in a mini-buffer and moving backwards, stop in front of the 1239 /* If in a mini-buffer and moving backwards, stop at the end of the
1240 prompt if we are currently in front of it. This prevents 1240 prompt. This prevents accidentially moving into the read-only
1241 accidentially moving into the read-only prompt. */ 1241 prompt. */
1242 if (INTEGERP (current_buffer->minibuffer_prompt_length)) 1242 if (INTEGERP (current_buffer->minibuffer_prompt_length)
1243 { 1243 && (prompt_end = XINT (current_buffer->minibuffer_prompt_length),
1244 int prompt_end = XFASTINT (current_buffer->minibuffer_prompt_length); 1244 ((PT > prompt_end && val < prompt_end)
1245 if (PT > prompt_end && val < prompt_end) 1245 || (PT < prompt_end && val > prompt_end))))
1246 val = prompt_end; 1246 val = prompt_end;
1247 } 1247
1248
1249 SET_PT (val); 1248 SET_PT (val);
1250 return Qt; 1249 return Qt;
1251} 1250}