summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Teirlinck <teirllm@auburn.edu>2003-12-25 17:31:23 +0000
committerLuc Teirlinck <teirllm@auburn.edu>2003-12-25 17:31:23 +0000
commit86408abdf4871166dadc6694cfa309244a4c46fb (patch)
tree546ed391c3ad4e77ec86a5aec014896193232248
parentb91485007d4c4fd637291364eecd363e1cecfa9d (diff)
downloademacs-86408abdf4871166dadc6694cfa309244a4c46fb.tar.gz
(Fcompleting_read): Undo previous change.
-rw-r--r--src/minibuf.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index 4c98f7ba708..baeb0cef7b5 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1578,10 +1578,13 @@ Completion ignores case if the ambient value of
Lisp_Object prompt, table, predicate, require_match, initial_input;
Lisp_Object hist, def, inherit_input_method;
{
- Lisp_Object val, histvar, histpos;
+ Lisp_Object val, histvar, histpos, position;
+ Lisp_Object init;
+ int pos = 0;
int count = SPECPDL_INDEX ();
struct gcpro gcpro1;
+ init = initial_input;
GCPRO1 (def);
specbind (Qminibuffer_completion_table, table);
@@ -1590,6 +1593,23 @@ Completion ignores case if the ambient value of
EQ (require_match, Qt) ? Qnil : require_match);
last_exact_completion = Qnil;
+ position = Qnil;
+ if (!NILP (init))
+ {
+ if (CONSP (init))
+ {
+ position = Fcdr (init);
+ init = Fcar (init);
+ }
+ CHECK_STRING (init);
+ if (!NILP (position))
+ {
+ CHECK_NUMBER (position);
+ /* Convert to distance from end of input. */
+ pos = XINT (position) - SCHARS (init);
+ }
+ }
+
if (SYMBOLP (hist))
{
histvar = hist;
@@ -1608,7 +1628,7 @@ Completion ignores case if the ambient value of
val = read_minibuf (NILP (require_match)
? Vminibuffer_local_completion_map
: Vminibuffer_local_must_match_map,
- initial_input, prompt, Qnil, 0,
+ init, prompt, make_number (pos), 0,
histvar, histpos, def, 0,
!NILP (inherit_input_method));