From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Re: Disable undo in batch mode Date: Sun, 11 Oct 2009 07:22:58 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <3849881f-9ad2-4e36-b514-4bf7b4b364bc@m3g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1255272192 32600 80.91.229.12 (11 Oct 2009 14:43:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Oct 2009 14:43:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 11 16:42:57 2009 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 1MwzdR-0003jj-0m for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Oct 2009 16:42:57 +0200 Original-Received: from localhost ([127.0.0.1]:37719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwzdQ-0008Vh-Ha for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Oct 2009 10:42:56 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!37g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 17 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1255270978 30412 127.0.0.1 (11 Oct 2009 14:22:58 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 11 Oct 2009 14:22:58 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 37g2000yqm.googlegroups.com; posting-host=84.53.123.169; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu comp.emacs:99271 gnu.emacs.help:173747 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:68832 Archived-At: On Oct 11, 12:14=A0pm, Xah Lee wrote: > (defun my-process-file (fpath) > =A0 "Process the file at path FPATH ..." > =A0 (let () > =A0 =A0 ;; create temp buffer without undo record. > =A0 =A0 ;; first space in temp buff name is necessary > =A0 =A0 (set-buffer (get-buffer-create " myTemp")) > =A0 =A0 (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.