Mercurial > emacs
changeset 25401:3f78f1fed4e0
(Fforward_word): If in a mini-buffer and moving
backwards, stop in front of the prompt to prevent accidentially
moving into the read-only prompt.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 25 Aug 1999 21:12:36 +0000 |
parents | c75839c09c84 |
children | 857e8b5b1194 |
files | src/syntax.c |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/syntax.c Wed Aug 25 21:12:15 1999 +0000 +++ b/src/syntax.c Wed Aug 25 21:12:36 1999 +0000 @@ -1214,6 +1214,17 @@ SET_PT (XINT (count) > 0 ? ZV : BEGV); return Qnil; } + + /* If in a mini-buffer and moving backwards, stop in front of the + prompt if we are currently in front of it. This prevents + accidentially moving into the read-only prompt. */ + if (INTEGERP (current_buffer->minibuffer_prompt_length)) + { + int prompt_end = XFASTINT (current_buffer->minibuffer_prompt_length); + if (PT > prompt_end && val < prompt_end) + val = prompt_end; + } + SET_PT (val); return Qt; }