emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/minibuf.c,v


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/minibuf.c,v
Date: Thu, 08 Feb 2007 00:06:43 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kim F. Storm <kfstorm>  07/02/08 00:06:43

Index: minibuf.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/minibuf.c,v
retrieving revision 1.322
retrieving revision 1.323
diff -u -b -r1.322 -r1.323
--- minibuf.c   30 Jan 2007 23:49:33 -0000      1.322
+++ minibuf.c   8 Feb 2007 00:06:43 -0000       1.323
@@ -472,7 +472,6 @@
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
   Lisp_Object enable_multibyte;
   int pos = INTEGERP (backup_n) ? XINT (backup_n) : 0;
-
   /* String to add to the history.  */
   Lisp_Object histstring;
 
@@ -484,6 +483,14 @@
 
   specbind (Qminibuffer_default, defalt);
 
+  /* If Vminibuffer_completing_file_name is `lambda' on entry, it was t
+     in previous recursive minibuffer, but was not set explicitly
+     to t for this invocation, so set it to nil in this minibuffer.
+     Save the old value now, before we change it.  */
+  specbind (intern ("minibuffer-completing-file-name"), 
Vminibuffer_completing_file_name);
+  if (EQ (Vminibuffer_completing_file_name, Qlambda))
+    Vminibuffer_completing_file_name = Qnil;
+
   single_kboard_state ();
 #ifdef HAVE_X_WINDOWS
   if (display_hourglass_p)
@@ -577,8 +584,7 @@
   minibuf_save_list
     = Fcons (Voverriding_local_map,
             Fcons (minibuf_window,
-                   Fcons (Vminibuffer_completing_file_name,
-                          minibuf_save_list)));
+                   minibuf_save_list));
   minibuf_save_list
     = Fcons (minibuf_prompt,
             Fcons (make_number (minibuf_prompt_width),
@@ -604,9 +610,13 @@
   Vminibuffer_history_position = histpos;
   Vminibuffer_history_variable = histvar;
   Vhelp_form = Vminibuffer_help_form;
-  /* If this minibuffer is reading a file name,
-     that doesn't mean recursive ones are.  */
-  Vminibuffer_completing_file_name = Qnil;
+  /* If this minibuffer is reading a file name, that doesn't mean
+     recursive ones are.  But we cannot set it to nil, because
+     completion code still need to know the minibuffer is completing a
+     file name.  So use `lambda' as intermediate value meaning
+     "t" in this minibuffer, but "nil" in next minibuffer.  */
+  if (!NILP (Vminibuffer_completing_file_name))
+    Vminibuffer_completing_file_name = Qlambda;
 
   if (inherit_input_method)
     {
@@ -928,8 +938,6 @@
     minibuf_window = temp;
 #endif
   minibuf_save_list = Fcdr (minibuf_save_list);
-  Vminibuffer_completing_file_name = Fcar (minibuf_save_list);
-  minibuf_save_list = Fcdr (minibuf_save_list);
 
   /* Erase the minibuffer we were using at this level.  */
   {
@@ -1793,9 +1801,11 @@
 
   val = read_minibuf (NILP (require_match)
                      ? (NILP (Vminibuffer_completing_file_name)
+                        || EQ (Vminibuffer_completing_file_name, Qlambda)
                         ? Vminibuffer_local_completion_map
                         : Vminibuffer_local_filename_completion_map)
                      : (NILP (Vminibuffer_completing_file_name)
+                        || EQ (Vminibuffer_completing_file_name, Qlambda)
                         ? Vminibuffer_local_must_match_map
                         : Vminibuffer_local_must_match_filename_map),
                      init, prompt, make_number (pos), 0,
@@ -2002,6 +2012,7 @@
       /* Some completion happened */
 
       if (! NILP (Vminibuffer_completing_file_name)
+         && ! EQ (Vminibuffer_completing_file_name, Qlambda)
          && SREF (completion, SBYTES (completion) - 1) == '/'
          && PT < ZV
          && FETCH_CHAR (PT_BYTE) == '/')
@@ -2291,7 +2302,8 @@
     GCPRO2 (completion, tem);
     /* If reading a file name,
        expand any $ENVVAR refs in the buffer and in TEM.  */
-    if (! NILP (Vminibuffer_completing_file_name))
+    if (! NILP (Vminibuffer_completing_file_name)
+       && ! EQ (Vminibuffer_completing_file_name, Qlambda))
       {
        Lisp_Object substituted;
        substituted = Fsubstitute_in_file_name (tem);
@@ -2406,6 +2418,7 @@
   /* Otherwise insert in minibuffer the chars we got */
 
   if (! NILP (Vminibuffer_completing_file_name)
+      && ! EQ (Vminibuffer_completing_file_name, Qlambda)
       && SREF (completion, SBYTES (completion) - 1) == '/'
       && PT < ZV
       && FETCH_CHAR (PT_BYTE) == '/')
@@ -2910,7 +2923,7 @@
 
   DEFVAR_LISP ("minibuffer-completing-file-name",
               &Vminibuffer_completing_file_name,
-              doc: /* Non-nil means completing file names.  */);
+              doc: /* Non-nil and non-`lambda' means completing file names.  
*/);
   Vminibuffer_completing_file_name = Qnil;
 
   DEFVAR_LISP ("minibuffer-help-form", &Vminibuffer_help_form,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]