summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2008-03-16 17:46:19 +0000
committerJuri Linkov <juri@jurta.org>2008-03-16 17:46:19 +0000
commit6206d6c2826e5f58d1211865ff66c1762ab57921 (patch)
tree8b9a9433041a4bf9f60e3c3e216833351502948f
parentf564644bb24e635429f9fc8990882d3291f69387 (diff)
(Fcall_interactively): For interactive code letters
'b' and 'B' put the buffer list into the list of default "future" values of the minibuffer.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/callint.c37
2 files changed, 34 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 57e5d831189..a38335d0dc4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-16 Juri Linkov <juri@jurta.org>
+
+ * callint.c (Fcall_interactively): For interactive code letters
+ 'b' and 'B' put the buffer list into the list of default "future"
+ values of the minibuffer.
+
2008-03-16 Andreas Schwab <schwab@suse.de>
* keyboard.c (read_key_sequence): Fix downcasing of letters with
diff --git a/src/callint.c b/src/callint.c
index 8a9f8322d9b..76d234e8678 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -513,16 +513,35 @@ invoke it. If KEYS is omitted or nil, the return value of
break;
case 'b': /* Name of existing buffer */
- args[i] = Fcurrent_buffer ();
- if (EQ (selected_window, minibuf_window))
- args[i] = Fother_buffer (args[i], Qnil, Qnil);
- args[i] = Fread_buffer (callint_message, args[i], Qt);
- break;
-
case 'B': /* Name of buffer, possibly nonexistent */
- args[i] = Fread_buffer (callint_message,
- Fother_buffer (Fcurrent_buffer (), Qnil, Qnil),
- Qnil);
+ {
+ Lisp_Object tema, temb, temc;
+ int skip_current = 1;
+
+ if (*tem == 'b' && !EQ (selected_window, minibuf_window))
+ skip_current = 0;
+
+ /* Get a list of buffer names (except the current buffer and
+ internal buffers), and use this list for default values. */
+ tema = Qnil;
+ temc = Fcurrent_buffer ();
+ teml = Fbuffer_list (selected_frame);
+ for (; CONSP (teml); teml = XCDR (teml))
+ {
+ temb = XCAR (teml);
+ if (skip_current && EQ (temb, temc))
+ continue;
+ if (NILP (temb))
+ continue;
+ if (NILP (XBUFFER (temb)->name))
+ continue;
+ if (SREF (XBUFFER (temb)->name, 0) == ' ')
+ continue;
+ tema = Fcons (XBUFFER (temb)->name, tema);
+ }
+ args[i] = Fread_buffer (callint_message, Fnreverse (tema),
+ *tem == 'b' ? Qt : Qnil);
+ }
break;
case 'c': /* Character */