diff options
| author | Karl Heuer | 1994-04-05 22:53:54 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-04-05 22:53:54 +0000 |
| commit | 1e00c2ff9164aff0d12c5df4365a03ae169365a0 (patch) | |
| tree | 912d1ce9020e376defefaee60934eb9bb6699c25 /src | |
| parent | e73b01a42af3a0985ee8cb8f4de555939dd7f129 (diff) | |
| download | emacs-1e00c2ff9164aff0d12c5df4365a03ae169365a0.tar.gz emacs-1e00c2ff9164aff0d12c5df4365a03ae169365a0.zip | |
(do_completion): gcpro some things.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 23 |
1 files 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 () | |||
| 1045 | Lisp_Object completion, tem; | 1045 | Lisp_Object completion, tem; |
| 1046 | int completedp; | 1046 | int completedp; |
| 1047 | Lisp_Object last; | 1047 | Lisp_Object last; |
| 1048 | struct gcpro gcpro1, gcpro2; | ||
| 1048 | 1049 | ||
| 1050 | GCPRO2 (completion, last); | ||
| 1049 | completion = Ftry_completion (Fbuffer_string (), Vminibuffer_completion_table, | 1051 | completion = Ftry_completion (Fbuffer_string (), Vminibuffer_completion_table, |
| 1050 | Vminibuffer_completion_predicate); | 1052 | Vminibuffer_completion_predicate); |
| 1051 | last = last_exact_completion; | 1053 | last = last_exact_completion; |
| @@ -1055,11 +1057,15 @@ do_completion () | |||
| 1055 | { | 1057 | { |
| 1056 | bitch_at_user (); | 1058 | bitch_at_user (); |
| 1057 | temp_echo_area_glyphs (" [No match]"); | 1059 | temp_echo_area_glyphs (" [No match]"); |
| 1060 | UNGCPRO; | ||
| 1058 | return 0; | 1061 | return 0; |
| 1059 | } | 1062 | } |
| 1060 | 1063 | ||
| 1061 | if (EQ (completion, Qt)) /* exact and unique match */ | 1064 | if (EQ (completion, Qt)) /* exact and unique match */ |
| 1062 | return 1; | 1065 | { |
| 1066 | UNGCPRO; | ||
| 1067 | return 1; | ||
| 1068 | } | ||
| 1063 | 1069 | ||
| 1064 | /* compiler bug */ | 1070 | /* compiler bug */ |
| 1065 | tem = Fstring_equal (completion, Fbuffer_string()); | 1071 | tem = Fstring_equal (completion, Fbuffer_string()); |
| @@ -1097,7 +1103,9 @@ do_completion () | |||
| 1097 | Qlambda); | 1103 | Qlambda); |
| 1098 | 1104 | ||
| 1099 | if (NILP (tem)) | 1105 | if (NILP (tem)) |
| 1100 | { /* not an exact match */ | 1106 | { |
| 1107 | /* not an exact match */ | ||
| 1108 | UNGCPRO; | ||
| 1101 | if (completedp) | 1109 | if (completedp) |
| 1102 | return 5; | 1110 | return 5; |
| 1103 | else if (auto_help) | 1111 | else if (auto_help) |
| @@ -1107,7 +1115,10 @@ do_completion () | |||
| 1107 | return 6; | 1115 | return 6; |
| 1108 | } | 1116 | } |
| 1109 | else if (completedp) | 1117 | else if (completedp) |
| 1110 | return 4; | 1118 | { |
| 1119 | UNGCPRO; | ||
| 1120 | return 4; | ||
| 1121 | } | ||
| 1111 | /* If the last exact completion and this one were the same, | 1122 | /* If the last exact completion and this one were the same, |
| 1112 | it means we've already given a "Complete but not unique" | 1123 | it means we've already given a "Complete but not unique" |
| 1113 | message and the user's hit TAB again, so now we give him help. */ | 1124 | message and the user's hit TAB again, so now we give him help. */ |
| @@ -1118,9 +1129,10 @@ do_completion () | |||
| 1118 | if (!NILP (Fequal (tem, last))) | 1129 | if (!NILP (Fequal (tem, last))) |
| 1119 | Fminibuffer_completion_help (); | 1130 | Fminibuffer_completion_help (); |
| 1120 | } | 1131 | } |
| 1132 | UNGCPRO; | ||
| 1121 | return 3; | 1133 | return 3; |
| 1122 | } | 1134 | } |
| 1123 | 1135 | ||
| 1124 | /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ | 1136 | /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ |
| 1125 | 1137 | ||
| 1126 | Lisp_Object | 1138 | Lisp_Object |
| @@ -1562,6 +1574,9 @@ syms_of_minibuf () | |||
| 1562 | Qminibuffer_completion_predicate = intern ("minibuffer-completion-predicate"); | 1574 | Qminibuffer_completion_predicate = intern ("minibuffer-completion-predicate"); |
| 1563 | staticpro (&Qminibuffer_completion_predicate); | 1575 | staticpro (&Qminibuffer_completion_predicate); |
| 1564 | 1576 | ||
| 1577 | staticpro (&last_exact_completion); | ||
| 1578 | last_exact_completion = Qnil; | ||
| 1579 | |||
| 1565 | staticpro (&last_minibuf_string); | 1580 | staticpro (&last_minibuf_string); |
| 1566 | last_minibuf_string = Qnil; | 1581 | last_minibuf_string = Qnil; |
| 1567 | 1582 | ||