From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: problem with elisp Date: Wed, 08 Oct 2008 15:25:02 -0400 Organization: A noiseless patient Spider Message-ID: References: <87od1u7w3z.fsf@poczta.po.opole.pl> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1223494995 12178 80.91.229.12 (8 Oct 2008 19:43:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2008 19:43:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 08 21:44:13 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Knex2-0000Tn-JE for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 21:44:04 +0200 Original-Received: from localhost ([127.0.0.1]:53693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Knevy-0008KI-Nk for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 15:42:58 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!news.motzarella.org!motzarella.org!barmar Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-X-Trace: feeder.motzarella.org U2FsdGVkX1+EHFPP4xPxMIB51Ft+ydwdZR0XoxvO0H5rj81swmNvsMgfjZdMSkOw+ReLUuB5ZzvucBQgqmLFG/KDCmz0zybXn+DpwIDC9x8pCHuCQyh/kszs2SeVVbxs7yyX1MIe5VY= Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Wed, 8 Oct 2008 19:25:03 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+qD550qhyuyqwoTMVvSCA8JjqCb4NKuQY= Cancel-Lock: sha1:LzSLXr/kJLhPBQSrYLfNiJY5tjM= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:163223 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58567 Archived-At: In article , Nikolaj Schumacher wrote: > Seweryn Kokot wrote: > > > Could you explain to me why the following function doesn't work in the first > > version and when swapping line > > (let ((string-temp (make-temp-name ""))) > > with > > (let ((string-temp "@temp@")) > > it works correctly? > > Could you specify what's not working? It seems to work for me. > > `make-temp-name' is not a good idea for what you're doing, though. > While the same string will never be returned twice, there is no > guarantee that the string doesn't exist in your buffer. So make sure > you use a very unique prefix. On the other hand, there's no added > benefit from using `make-temp-name' instead of just the prefix. Unless you try to use the function in the buffer containing the function's source code, since the prefix is guaranteed to exist in that buffer. If you use make-temp-name with a suitably random prefix, the chance of an unintended match should be negligible. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***