On Dec 11, 2010, at 17:53, Alin Soare wrote:
> (generate-new-buffer-name "foo")
> => "foo<5>"
> (generate-new-buffer-name "foo" "foo<3>")
> => "foo<3>"
> (generate-new-buffer-name "foo" "foo<6>")
> => "foo<5>"
>
> However, for me all these forms evaluate to "foo"
This might be obvious, but: Do you actually have existing buffers named "foo", "foo<2>", "foo<3>", and "foo<4>" as described in the paragraph before that example code?
I did not create the buffers with the given names.
Then that explains why you're getting different results. The function gives you back "foo" if that buffer doesn't exist, or finds a number to append so that it doesn't match the name of an existing buffer. The text before the example explains how it assumes some of those buffers already exist.
Ken |