GNU bug report logs - #1229
generate-new-buffer-name could be more efficient

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Thu, 23 Oct 2008 07:10:04 UTC

Severity: wishlist

Found in version 23.0.60

Fixed in version 24.2

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 1229 <at> debbugs.gnu.org
Subject: bug#1229: generate-new-buffer-name could be more efficient
Date: Tue, 03 Jul 2012 13:21:12 -0400
Stefan Monnier wrote:

>> +       sprintf (number, "-%"pD"d", Frandom (make_number (999999)));
>
> I don't like this arbitrary constant.  Maybe we could use something
> like "N * Flength (Vbuffer_alist)".

OK; though personally I don't see that it matters. IIUC, mkstemp,
fileio.c's make_temp_name, etc, all use a finite number of possible
random states, and they don't have the <2>... fallback that
generate-new-buffer-name does.

(Another option is to extract the random scheme that make_temp_name uses
to a separate function and use that here too.)

What do you want the arbitrary constant N to be ? :)




This bug report was last modified 12 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.