bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#1229: generate-new-buffer-name could be more efficient


From: Glenn Morris
Subject: bug#1229: generate-new-buffer-name could be more efficient
Date: Tue, 03 Jul 2012 13:21:12 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

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 ? :)





reply via email to

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