* Re: rename-buffer should have current buffer as default-value
2007-11-25 18:06 rename-buffer should have current buffer as default-value Drew Adams
@ 2007-11-25 21:45 ` Juri Linkov
2007-11-25 21:56 ` Drew Adams
0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2007-11-25 21:45 UTC (permalink / raw)
To: Drew Adams; +Cc: bug-gnu-emacs
> emacs -Q
> M-x rename-buffer RET M-n - there is no default value.
>
> The current buffer name should be the default value, available for
> editing.
It's a pity that neither `B' nor `b' interactive code letter can be
used becase `b' requires an existing buffer, and `B' provides the
other buffer's name as default. But fortunately now Lisp code is
allowed in the interactive specification of a C function:
Index: src/buffer.c
===================================================================
RCS file: /sources/emacs/emacs/src/buffer.c,v
retrieving revision 1.540
diff -c -r1.540 buffer.c
*** src/buffer.c 21 Nov 2007 20:59:46 -0000 1.540
--- src/buffer.c 25 Nov 2007 21:43:41 -0000
***************
*** 1169,1175 ****
}
\f
DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2,
! "sRename buffer (to new name): \nP",
doc: /* Change current buffer's name to NEWNAME (a string).
If second arg UNIQUE is nil or omitted, it is an error if a
buffer named NEWNAME already exists.
--- 1169,1176 ----
}
\f
DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2,
! "(list (read-buffer \"Rename buffer (to new name): \" \
! (current-buffer)) current-prefix-arg)",
doc: /* Change current buffer's name to NEWNAME (a string).
If second arg UNIQUE is nil or omitted, it is an error if a
buffer named NEWNAME already exists.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 3+ messages in thread