From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Disable undo in batch mode Date: Sun, 11 Oct 2009 03:14:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3849881f-9ad2-4e36-b514-4bf7b4b364bc@m3g2000pri.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1255324862 29133 80.91.229.12 (12 Oct 2009 05:21:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2009 05:21:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 12 07:20:52 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 1MxDL1-0006Z4-S7 for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Oct 2009 07:20:52 +0200 Original-Received: from localhost ([127.0.0.1]:55416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxDL1-0001nN-9u for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Oct 2009 01:20:51 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!m3g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 48 Original-NNTP-Posting-Host: 76.102.12.87 Original-X-Trace: posting.google.com 1255256068 23339 127.0.0.1 (11 Oct 2009 10:14:28 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 11 Oct 2009 10:14:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m3g2000pri.googlegroups.com; posting-host=76.102.12.87; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.25 Safari/532.0, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu comp.emacs:99270 gnu.emacs.help:173740 X-Mailman-Approved-At: Mon, 12 Oct 2009 01:17:22 -0400 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:68865 Archived-At: On Oct 10, 6:49 pm, Decebal wrote: > I am doing a lot of work on a big buffer (65 MB). I understood that > there is a possibility to disable the undo functionality. Something > that is not used in batch-mode. So this could give a performance > boost. > How can I disable undo? > Are there other things that could be usefull performance wise? buffer-disable-undo you find it by calling =E2=80=9Celisp-index-search=E2=80=9D with search wor= d =E2=80=9Cundo=E2=80=9D. for batch processing, you want to disable undo, also turn off syntax coloring, possibly turn off auto save, auto back up, auto major mode selection, ...etc. best do it with temp buffer e.g. (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) ;; process it ... ;; (goto-char 0) ; move to begining of file's content ;; ... ;; (write-file fpath) ;; write back to the file (kill-buffer " myTemp"))) or use with-temp-buffer or with-temp-file. for more tips on using elisp as a text processing lang like perl, python, see: =E2=80=A2 Text Processing with Emacs Lisp http://xahlee.org/emacs/elisp_idioms_batch.html Xah =E2=88=91 http://xahlee.org/ =E2=98=84