emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange generate-new-buffer-name behaviour


From: Ken Raeburn
Subject: Re: strange generate-new-buffer-name behaviour
Date: Sat, 11 Dec 2010 21:46:44 -0500

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]