changeset 95107:ab4a75e53461

(Finternal_complete_buffer): Only strip out hidden buffers if some non-hidden buffers are selected by string&pred.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 19 May 2008 11:22:44 +0000
parents d3a057985fe7
children 2f0a4ded2809
files src/ChangeLog src/minibuf.c
diffstat 2 files changed, 35 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon May 19 07:23:52 2008 +0000
+++ b/src/ChangeLog	Mon May 19 11:22:44 2008 +0000
@@ -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>
--- a/src/minibuf.c	Mon May 19 07:23:52 2008 +0000
+++ b/src/minibuf.c	Mon May 19 11:22:44 2008 +0000
@@ -781,11 +781,11 @@
       Lisp_Object histval;
 
       /* If variable is unbound, make it nil.  */
-      if (EQ (SYMBOL_VALUE (Vminibuffer_history_variable), Qunbound))
+
+      histval = find_symbol_value (Vminibuffer_history_variable);
+      if (EQ (histval, Qunbound))
 	Fset (Vminibuffer_history_variable, Qnil);
 
-      histval = Fsymbol_value (Vminibuffer_history_variable);
-
       /* 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 @@
   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);
 }