From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: How to Date: Sat, 10 Oct 2009 22:06:07 +0200 Message-ID: <4AD0E92F.7070301@easy-emacs.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1255205254 16684 80.91.229.12 (10 Oct 2009 20:07:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Oct 2009 20:07:34 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Decebal Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 10 22:07:24 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 1MwiDq-0002zG-W6 for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Oct 2009 22:07:23 +0200 Original-Received: from localhost ([127.0.0.1]:33837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwiDq-0003tx-9A for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Oct 2009 16:07:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MwiDV-0003tj-MM for help-gnu-emacs@gnu.org; Sat, 10 Oct 2009 16:07:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MwiDR-0003so-Qq for help-gnu-emacs@gnu.org; Sat, 10 Oct 2009 16:07:01 -0400 Original-Received: from [199.232.76.173] (port=59157 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwiDR-0003sk-Nc for help-gnu-emacs@gnu.org; Sat, 10 Oct 2009 16:06:57 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.8]:51377) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MwiDR-00042f-4n for help-gnu-emacs@gnu.org; Sat, 10 Oct 2009 16:06:57 -0400 Original-Received: from [192.168.178.27] (p54BEB826.dip0.t-ipconnect.de [84.190.184.38]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Li23m-1MSJPo25Zq-00nDBW; Sat, 10 Oct 2009 22:06:55 +0200 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: X-Provags-ID: V01U2FsdGVkX19F37x/QIa4HL4N0DFxrX7ujIzq3yG7NjMbdqh CGgeoMqEguMZA3DO0bI3Or2uKTk9xl2vAx2E91nNUHwVNvEB3B zpaEr8mjKf1SNukEYKbIoVELctAkDMn X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:68817 Archived-At: Decebal wrote: > 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... it's in files.el, save-buffer, AFAIS (if (and modp (buffer-file-name)) (message "Saving file %s..." (buffer-file-name))) commenting out these lines should cancel the message HTH Andreas > 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. >