[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: with-temp-buffer and undo [was: Big desktop undo buffer crashes Emac
From: |
Andreas Schwab |
Subject: |
Re: with-temp-buffer and undo [was: Big desktop undo buffer crashes Emacs] |
Date: |
Fri, 12 May 2006 13:41:02 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) |
Lars Hansen <address@hidden> writes:
> Lars Hansen wrote:
>
>>I suggest to use with-temp-buffer (and buffer-disable-undo)
>>
>>
> Does it ever make sense to save undo information in a temporary buffer?
> If not, I suggest to disable it in with-temp-buffer.
> Patch attached.
> *** subr.el~ 2006-05-12 08:24:10.000000000 +0200
> --- subr.el 2006-05-12 12:40:59.575290323 +0200
> ***************
> *** 2220,2226 ****
> See also `with-temp-file' and `with-output-to-string'."
> (declare (indent 0) (debug t))
> (let ((temp-buffer (make-symbol "temp-buffer")))
> ! `(let ((,temp-buffer (generate-new-buffer " *temp*")))
> (unwind-protect
> (with-current-buffer ,temp-buffer
> ,@body)
> --- 2220,2227 ----
> See also `with-temp-file' and `with-output-to-string'."
> (declare (indent 0) (debug t))
> (let ((temp-buffer (make-symbol "temp-buffer")))
> ! `(let ((,temp-buffer (generate-new-buffer " *temp*"))
> ! (buffer-undo-list t))
> (unwind-protect
> (with-current-buffer ,temp-buffer
> ,@body)
This won't disable undo in the temp buffer, you'd need to move that below
with-current-buffer.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."