Ralf Angeli <[EMAIL PROTECTED]> writes:

> * David Kastrup (2007-07-22) writes:
>
>> Ralf Angeli <[EMAIL PROTECTED]> writes:
>>
>>> -              (find-file file)
>>> +         (set-buffer (get-buffer-create file))
>>>                (erase-buffer)
>>
>> NO!!!!!!  You can't just take a buffer that happens to have the same
>> _buffer_ name as the file and kill it.  What were you thinking?  Ok,
>> it is Sunday morning.
>>
>> If you start and end with a clean slate, probably the easiest thing to
>> do is to wrap everything in
>>
>> (with-temp-file file
>>    ...
>> )
>
> `generate-new-buffer' instead of `get-buffer-create' should work as
> well, I guess.

Probably, but it is still pointless not to just use with-temp-file
which is there exactly for that purpose and is as far as I can see
available in Emacs 21.4 and a moderately up to date XEmacs-21.4.

Less code to maintain, less ways for things to go wrong.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


_______________________________________________
auctex-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to