]> code.delx.au - gnu-emacs/blobdiff - src/minibuf.c
* src/macfont.m (mac_font_shape): Make sure that total_advance is increasing.
[gnu-emacs] / src / minibuf.c
index 644e5276fe05fde815c41d86ca950ae2da42c827..57eea05b0fc897a6b17eb6d394da570104d97109 100644 (file)
@@ -194,7 +194,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
   int c;
   unsigned char hide_char = 0;
   struct emacs_tty etty;
-  bool etty_valid IF_LINT (= false);
+  bool etty_valid UNINIT;
 
   /* Check, whether we need to suppress echoing.  */
   if (CHARACTERP (Vread_hide_char))
@@ -630,8 +630,31 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
                            Qrear_nonsticky, Qt, Qnil);
        Fput_text_property (make_number (BEG), make_number (PT),
                            Qfield, Qt, Qnil);
-       Fadd_text_properties (make_number (BEG), make_number (PT),
-                             Vminibuffer_prompt_properties, Qnil);
+       if (CONSP (Vminibuffer_prompt_properties))
+         {
+           /* We want to apply all properties from
+              `minibuffer-prompt-properties' to the region normally,
+              but if the `face' property is present, add that
+              property to the end of the face properties to avoid
+              overwriting faces. */
+           Lisp_Object list = Vminibuffer_prompt_properties;
+           while (CONSP (list))
+             {
+               Lisp_Object key = XCAR (list);
+               list = XCDR (list);
+               if (CONSP (list))
+                 {
+                   Lisp_Object val = XCAR (list);
+                   list = XCDR (list);
+                   if (EQ (key, Qface))
+                     Fadd_face_text_property (make_number (BEG),
+                                              make_number (PT), val, Qt, Qnil);
+                   else
+                     Fput_text_property (make_number (BEG), make_number (PT),
+                                         key, val, Qnil);
+                 }
+             }
+         }
       }
     unbind_to (count1, Qnil);
   }
@@ -1663,6 +1686,8 @@ the values STRING, PREDICATE and `lambda'.  */)
       tem = Fassoc_string (string, collection, completion_ignore_case ? Qt : Qnil);
       if (NILP (tem))
        return Qnil;
+      else if (CONSP (tem))
+        tem = XCAR (tem);
     }
   else if (VECTORP (collection))
     {
@@ -1815,8 +1840,8 @@ DEFUN ("assoc-string", Fassoc_string, Sassoc_string, 2, 3, 0,
 This returns the first element of LIST whose car matches the string or
 symbol KEY, or nil if no match exists.  When performing the
 comparison, symbols are first converted to strings, and unibyte
-strings to multibyte.  If the optional arg CASE-FOLD is non-nil, case
-is ignored.
+strings to multibyte.  If the optional arg CASE-FOLD is non-nil, both
+KEY and the elements of LIST are upcased for comparison.
 
 Unlike `assoc', KEY can also match an entry in LIST consisting of a
 single string, rather than a cons cell whose car is a string.  */)
@@ -1964,7 +1989,9 @@ controls the behavior, rather than this variable.  */);
 
   DEFVAR_BOOL ("enable-recursive-minibuffers", enable_recursive_minibuffers,
               doc: /* Non-nil means to allow minibuffer commands while in the minibuffer.
-This variable makes a difference whenever the minibuffer window is active. */);
+This variable makes a difference whenever the minibuffer window is active.
+Also see `minibuffer-depth-indicator-mode', which may be handy if this
+variable is non-nil. */);
   enable_recursive_minibuffers = 0;
 
   DEFVAR_LISP ("minibuffer-completion-table", Vminibuffer_completion_table,