unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Decebal <cldwesterhof@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to
Date: Sat, 10 Oct 2009 22:06:07 +0200	[thread overview]
Message-ID: <4AD0E92F.7070301@easy-emacs.de> (raw)
In-Reply-To: <afa23e97-b571-4fa5-8f53-3c211ed308bb@k19g2000yqc.googlegroups.com>

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.
> 





  reply	other threads:[~2009-10-10 20:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-10 18:33 How to Decebal
2009-10-10 20:06 ` Andreas Röhler [this message]
2009-10-10 20:55 ` How to [write sequentially numbered lines] Vassil Nikolov
2009-10-10 21:20   ` Decebal
     [not found] ` <mailman.8511.1255205222.2239.help-gnu-emacs@gnu.org>
2009-10-10 20:57   ` How to Decebal
2009-10-11  1:41     ` Decebal
2009-10-11  8:11       ` Andreas Röhler
     [not found]       ` <mailman.8527.1255248737.2239.help-gnu-emacs@gnu.org>
2009-10-11 16:20         ` Decebal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AD0E92F.7070301@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=cldwesterhof@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).