From 8c2dccbf9d50500ae749e008cf326f206e747ed9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 19 May 2008 11:22:44 +0000 Subject: [PATCH] (Finternal_complete_buffer): Only strip out hidden buffers if some non-hidden buffers are selected by string&pred. --- src/ChangeLog | 15 ++++++++++----- src/minibuf.c | 29 +++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0a04daf0c5b..b71af77179c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,23 +1,28 @@ +2008-05-19 Stefan Monnier + + * 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 * 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 diff --git a/src/minibuf.c b/src/minibuf.c index 5a7a4b28449..907c21cff44 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -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); } -- 2.39.2