From 1e00c2ff9164aff0d12c5df4365a03ae169365a0 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Tue, 5 Apr 1994 22:53:54 +0000 Subject: [PATCH] (do_completion): gcpro some things. --- src/minibuf.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/minibuf.c b/src/minibuf.c index c4def1bf400..fc53c3922d5 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1045,7 +1045,9 @@ do_completion () Lisp_Object completion, tem; int completedp; Lisp_Object last; + struct gcpro gcpro1, gcpro2; + GCPRO2 (completion, last); completion = Ftry_completion (Fbuffer_string (), Vminibuffer_completion_table, Vminibuffer_completion_predicate); last = last_exact_completion; @@ -1055,11 +1057,15 @@ do_completion () { bitch_at_user (); temp_echo_area_glyphs (" [No match]"); + UNGCPRO; return 0; } if (EQ (completion, Qt)) /* exact and unique match */ - return 1; + { + UNGCPRO; + return 1; + } /* compiler bug */ tem = Fstring_equal (completion, Fbuffer_string()); @@ -1097,7 +1103,9 @@ do_completion () Qlambda); if (NILP (tem)) - { /* not an exact match */ + { + /* not an exact match */ + UNGCPRO; if (completedp) return 5; else if (auto_help) @@ -1107,7 +1115,10 @@ do_completion () return 6; } else if (completedp) - return 4; + { + UNGCPRO; + return 4; + } /* If the last exact completion and this one were the same, it means we've already given a "Complete but not unique" message and the user's hit TAB again, so now we give him help. */ @@ -1118,9 +1129,10 @@ do_completion () if (!NILP (Fequal (tem, last))) Fminibuffer_completion_help (); } + UNGCPRO; return 3; } - + /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ Lisp_Object @@ -1562,6 +1574,9 @@ syms_of_minibuf () Qminibuffer_completion_predicate = intern ("minibuffer-completion-predicate"); staticpro (&Qminibuffer_completion_predicate); + staticpro (&last_exact_completion); + last_exact_completion = Qnil; + staticpro (&last_minibuf_string); last_minibuf_string = Qnil; -- 2.39.5