# HG changeset patch # User Richard M. Stallman # Date 839442483 0 # Node ID 73e83d35cd7026ae0082a23f4cd636e1bf72531c # Parent 71ede15e1ca3773ca3596875ab2fbe1c448a451a (Fread_from_minibuffer): Make position 0 in the initial input mean the beginning. diff -r 71ede15e1ca3 -r 73e83d35cd70 src/minibuf.c --- a/src/minibuf.c Wed Aug 07 18:27:20 1996 +0000 +++ b/src/minibuf.c Wed Aug 07 18:28:03 1996 +0000 @@ -493,7 +493,7 @@ If optional second arg INITIAL-CONTENTS is non-nil, it is a string\n\ to be inserted into the minibuffer before reading input.\n\ If INITIAL-CONTENTS is (STRING . POSITION), the initial input\n\ - is STRING, but point is placed POSITION characters into the string.\n\ + is STRING, but point is placed at position POSITION in the minibuffer.\n\ Third arg KEYMAP is a keymap to use whilst reading;\n\ if omitted or nil, the default is `minibuffer-local-map'.\n\ If fourth arg READ is non-nil, then interpret the result as a lisp object\n\ @@ -531,7 +531,11 @@ { CHECK_NUMBER (position, 0); /* Convert to distance from end of input. */ - pos = XINT (position) - 1 - XSTRING (initial_contents)->size; + if (XINT (position) < 1) + /* A number too small means the beginning of the string. */ + pos = - XSTRING (initial_contents)->size; + else + pos = XINT (position) - 1 - XSTRING (initial_contents)->size; } }