From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: How to Date: Sat, 10 Oct 2009 11:33:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1255200056 2756 80.91.229.12 (10 Oct 2009 18:40:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Oct 2009 18:40:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 10 20:40:46 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 1Mwgs1-0008Fk-RE for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Oct 2009 20:40:46 +0200 Original-Received: from localhost ([127.0.0.1]:55855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mwgs1-0001hk-5R for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Oct 2009 14:40:45 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!k19g2000yqc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1255199597 5613 127.0.0.1 (10 Oct 2009 18:33:17 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 10 Oct 2009 18:33:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k19g2000yqc.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 gnu.emacs.help:173726 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:68816 Archived-At: In a Bash script I changed: local i local length=${#1} for i in $(seq ${1}) ; do printf " Regel %${length}d voor de test\n" ${i} done >${2} to: emacs -batch -nw --eval=' (let ( (i) (nr-of-lines '${1}') (nr-of-lines-length) (output-file "'"${2}"'")) (setq nr-of-lines-length (length (number-to-string nr-of- lines))) (dotimes (i nr-of-lines t) (insert (format (format " Regel %%%dd voor de test\n" nr-of-lines-length) (1+ i)))) (write-file output-file)) ' 2>/dev/null The Bash version took 293 seconds and the Emacs Lisp version 59 seconds. So it is about 5 times as fast. The Emacs batch gives output like: Saving file /home/cecil/temp/inputEmacs... Wrote /home/cecil/temp/inputEmacs That is why I use the 2>/dev/null. Is there a way to circumvent the generation of the above output? Because when there is an error it is also thrown away and that is not nice.