all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Raeburn <raeburn@raeburn.org>
To: Alin Soare <as1789@gmail.com>
Cc: Emacs Dev <emacs-devel@gnu.org>
Subject: Re: strange generate-new-buffer-name behaviour
Date: Sat, 11 Dec 2010 21:46:44 -0500	[thread overview]
Message-ID: <670D047F-0ECC-4A62-94AE-A3AE327885A1@raeburn.org> (raw)
In-Reply-To: <AANLkTikcpq70p05MGBK1g+1Xb9ytaBDRoTM-zhwU6wN6@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1756 bytes --]

      reply	other threads:[~2010-12-12  2:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-11 19:26 strange generate-new-buffer-name behaviour Alin Soare
2010-12-11 20:06 ` Ken Raeburn
2010-12-11 22:53   ` Alin Soare
2010-12-12  2:46     ` Ken Raeburn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=670D047F-0ECC-4A62-94AE-A3AE327885A1@raeburn.org \
    --to=raeburn@raeburn.org \
    --cc=as1789@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.