Mercurial > emacs
comparison src/minibuf.c @ 4641:9b8e20b21a66
(Qread_file_name_internal): New var.
(syms_of_minibuf): Set it up and protect it.
(Fminibuffer_complete_word): When completing a file name,
expand envvar references.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 15 Aug 1993 03:54:35 +0000 |
parents | f189820e7ea7 |
children | 1fc792473491 |
comparison
equal
deleted
inserted
replaced
4640:1ae92cbb80ba | 4641:9b8e20b21a66 |
---|---|
72 /* Current position in the history list (adjusted by M-n and M-p). */ | 72 /* Current position in the history list (adjusted by M-n and M-p). */ |
73 | 73 |
74 Lisp_Object Vminibuffer_history_position; | 74 Lisp_Object Vminibuffer_history_position; |
75 | 75 |
76 Lisp_Object Qminibuffer_history; | 76 Lisp_Object Qminibuffer_history; |
77 | |
78 Lisp_Object Qread_file_name_internal; | |
77 | 79 |
78 /* Normal hook for entry to minibuffer. */ | 80 /* Normal hook for entry to minibuffer. */ |
79 | 81 |
80 Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; | 82 Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; |
81 | 83 |
1173 { | 1175 { |
1174 register unsigned char *buffer_string; | 1176 register unsigned char *buffer_string; |
1175 int buffer_length, completion_length; | 1177 int buffer_length, completion_length; |
1176 | 1178 |
1177 tem = Fbuffer_string (); | 1179 tem = Fbuffer_string (); |
1180 /* If reading a file name, | |
1181 expand any $ENVVAR refs in the buffer and in TEM. */ | |
1182 if (EQ (Vminibuffer_completion_table, Qread_file_name_internal)) | |
1183 { | |
1184 Lisp_Object substituted; | |
1185 substituted = Fsubstitute_in_file_name (tem); | |
1186 if (! EQ (substituted, tem)) | |
1187 { | |
1188 tem = substituted; | |
1189 Ferase_buffer (); | |
1190 insert_from_string (tem, 0, XSTRING (tem)->size); | |
1191 } | |
1192 } | |
1178 buffer_string = XSTRING (tem)->data; | 1193 buffer_string = XSTRING (tem)->data; |
1179 completion_string = XSTRING (completion)->data; | 1194 completion_string = XSTRING (completion)->data; |
1180 buffer_length = XSTRING (tem)->size; /* ie ZV - BEGV */ | 1195 buffer_length = XSTRING (tem)->size; /* ie ZV - BEGV */ |
1181 completion_length = XSTRING (completion)->size; | 1196 completion_length = XSTRING (completion)->size; |
1182 i = buffer_length - completion_length; | 1197 i = buffer_length - completion_length; |
1387 minibuf_level = 0; | 1402 minibuf_level = 0; |
1388 minibuf_prompt = 0; | 1403 minibuf_prompt = 0; |
1389 minibuf_save_vector_size = 5; | 1404 minibuf_save_vector_size = 5; |
1390 minibuf_save_vector = (struct minibuf_save_data *) malloc (5 * sizeof (struct minibuf_save_data)); | 1405 minibuf_save_vector = (struct minibuf_save_data *) malloc (5 * sizeof (struct minibuf_save_data)); |
1391 | 1406 |
1407 Qread_file_name_internal = intern ("read-file-name-internal"); | |
1408 staticpro (&Qread_file_name_internal); | |
1409 | |
1392 Qminibuffer_completion_table = intern ("minibuffer-completion-table"); | 1410 Qminibuffer_completion_table = intern ("minibuffer-completion-table"); |
1393 staticpro (&Qminibuffer_completion_table); | 1411 staticpro (&Qminibuffer_completion_table); |
1394 | 1412 |
1395 Qminibuffer_completion_confirm = intern ("minibuffer-completion-confirm"); | 1413 Qminibuffer_completion_confirm = intern ("minibuffer-completion-confirm"); |
1396 staticpro (&Qminibuffer_completion_confirm); | 1414 staticpro (&Qminibuffer_completion_confirm); |