aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-08-15 03:54:35 +0000
committerRichard M. Stallman1993-08-15 03:54:35 +0000
commit719b4a405f158054cd7cfb6e41bf18357f877fec (patch)
tree8028eace7568e25cfaa8e16313cc961116af093a /src
parent94c8642adf30cf7e509cf2df86dfd3a5e588187e (diff)
downloademacs-719b4a405f158054cd7cfb6e41bf18357f877fec.tar.gz
emacs-719b4a405f158054cd7cfb6e41bf18357f877fec.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index ff58dbcaf7d..b9495a5bc46 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -75,6 +75,8 @@ Lisp_Object Vminibuffer_history_position;
75 75
76Lisp_Object Qminibuffer_history; 76Lisp_Object Qminibuffer_history;
77 77
78Lisp_Object Qread_file_name_internal;
79
78/* Normal hook for entry to minibuffer. */ 80/* Normal hook for entry to minibuffer. */
79 81
80Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook; 82Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook;
@@ -1175,6 +1177,19 @@ is added, provided that matches some possible completion.")
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 */
@@ -1389,6 +1404,9 @@ syms_of_minibuf ()
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