emacs-devel
[Top][All Lists]
Advanced

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

with-temp-buffer and undo [was: Big desktop undo buffer crashes Emacs]


From: Lars Hansen
Subject: with-temp-buffer and undo [was: Big desktop undo buffer crashes Emacs]
Date: Fri, 12 May 2006 12:50:23 +0200
User-agent: Debian Thunderbird 1.0.2 (X11/20060423)

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)

reply via email to

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