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

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

Re: Disable undo in batch mode


From: Decebal
Subject: Re: Disable undo in batch mode
Date: Sun, 11 Oct 2009 07:22:58 -0700 (PDT)
User-agent: G2/1.0

On Oct 11, 12:14 pm, Xah Lee <xah...@gmail.com> wrote:
> (defun my-process-file (fpath)
>   "Process the file at path FPATH ..."
>   (let ()
>     ;; create temp buffer without undo record.
>     ;; first space in temp buff name is necessary
>     (set-buffer (get-buffer-create " myTemp"))
>     (insert-file-contents fpath nil nil nil t)

I am afraid that this does not work. When using:
        (switch-to-buffer (find-file-noselect input-file t t))
        (buffer-disable-undo)
my script takes 24 seconds.
When I change those two lines to:
        (set-buffer (get-buffer-create " myTemp"))
        (insert-file-contents input-file nil nil nil t)
it takes 592 seconds. About 25 times as long.


reply via email to

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