]> git.eshelyaron.com Git - emacs.git/commitdiff
(Finternal_complete_buffer): Only strip out hidden buffers
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 19 May 2008 11:22:44 +0000 (11:22 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 19 May 2008 11:22:44 +0000 (11:22 +0000)
if some non-hidden buffers are selected by string&pred.

src/ChangeLog
src/minibuf.c

index 0a04daf0c5b57872c351ceffe23852a404be02d5..b71af77179c36cff74c07b5fd23ebd787d9e8005 100644 (file)
@@ -1,23 +1,28 @@
+2008-05-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuf.c (Finternal_complete_buffer): Only strip out hidden buffers
+       if some non-hidden buffers are selected by string&pred.
+
 2008-05-19  Kenichi Handa  <handa@m17n.org>
 
        * font.c (font_list_entities): Fix handling of cache.
        (font_matching_entity): Likewise.
 
-       * ftfont.c (cs_iso8859_1): Deleted.
+       * ftfont.c (cs_iso8859_1): Delete.
        (ft_face_cache): New variable.
        (struct ftfont_info): New member fc_charset_idx;
-       (ftfont_build_basic_charsets): Deleted.
+       (ftfont_build_basic_charsets): Delete.
        (fc_charset_table): New variable.
        (ftfont_pattern_entity): New arg fc_charset_idx.  Store (FILENAME
        . FC_CHARSET_IDX) as :font-entity property in the font entity.
        Callers changed.
        (ftfont_lookup_cache, ftfont_get_charset): New funcitons.
-       (ftfont_spec_pattern): New argument fc_charset_idx.  Check
-       registry more rigidly.  Callers changed.
+       (ftfont_spec_pattern): New argument fc_charset_idx.
+       Check registry more rigidly.  Change callers.
        (ftfont_open, ftfont_close, ftfont_has_char): Adjustd for the
        change of :font-entity property of the font.
 
-       * xftfont.c (xftfont_open): Ajusted for the change of :font-entity
+       * xftfont.c (xftfont_open): Ajuste for the change of :font-entity
        property of the font.
 
 2008-05-18  Juanma Barranquero  <lekktu@gmail.com>
index 5a7a4b284491e952938de6cf1b436345af0215d4..907c21cff44d3e16fff3ac33fc1d5f8c94abd368 100644 (file)
@@ -781,10 +781,10 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
       Lisp_Object histval;
 
       /* If variable is unbound, make it nil.  */
-      if (EQ (SYMBOL_VALUE (Vminibuffer_history_variable), Qunbound))
-       Fset (Vminibuffer_history_variable, Qnil);
 
-      histval = Fsymbol_value (Vminibuffer_history_variable);
+      histval = find_symbol_value (Vminibuffer_history_variable);
+      if (EQ (histval, Qunbound))
+       Fset (Vminibuffer_history_variable, Qnil);
 
       /* The value of the history variable must be a cons or nil.  Other
         values are unacceptable.  We silently ignore these values.  */
@@ -1959,7 +1959,28 @@ The arguments STRING and PREDICATE are as in `try-completion',
   if (NILP (flag))
     return Ftry_completion (string, Vbuffer_alist, predicate);
   else if (EQ (flag, Qt))
-    return Fall_completions (string, Vbuffer_alist, predicate, Qt);
+    {
+      Lisp_Object res = Fall_completions (string, Vbuffer_alist, predicate);
+      if (SCHARS (string) > 0)
+       return res;
+      else
+       { /* Strip out internal buffers.  */
+         Lisp_Object bufs = res;
+         /* First, look for a non-internal buffer in `res'.  */
+         while (CONSP (bufs) && SREF (XCAR (bufs), 0) == ' ')
+           bufs = XCDR (bufs);
+         if (NILP (bufs))
+           /* All bufs in `res' are internal, so don't trip them out.  */
+           return res;
+         res = bufs;
+         while (CONSP (XCDR (bufs)))
+           if (SREF (XCAR (XCDR (bufs)), 0) == ' ')
+             XSETCDR (bufs, XCDR (XCDR (bufs)));
+           else
+             bufs = XCDR (bufs);
+         return res;
+       }
+    }
   else                         /* assume `lambda' */
     return Ftest_completion (string, Vbuffer_alist, predicate);
 }