unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Decebal <cldwesterhof@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: How to circumvent warning in batch mode
Date: Thu, 8 Oct 2009 16:44:43 -0700 (PDT)	[thread overview]
Message-ID: <5ebdc222-a8b5-4eed-9481-39b813da5f1c@j28g2000vbl.googlegroups.com> (raw)

I have the following code:
emacs -batch -nw --eval='
  (let (
        (match-length)
        (reg-exp "^ +")
        (substitute-str "@")
        )
    (find-file "input")
    (goto-char (point-min))
    (while (re-search-forward "^ +" nil t)
      (setq match-length (- (point) (match-beginning 0)))
      (while (> match-length (length substitute-str))
        (setq substitute-str (concat substitute-str substitute-str)))
      (replace-match (substring substitute-str 0 match-length))
    )
    (write-file "outputEmacs")
  )
'
I have severall questions about it.
The input file is quite big and I get:
    File input is large (31MB), really open? (y or n)
Is there a way to circumvent this?
Is there a way to do this more efficient? This script needs about 20
seconds. When doing it with a Perl script, it takes about 6 seconds.
Instead of the '@' or chr$(64) I would like to use a nbsp or chr
$(160). But then the script needs almost 3 minutes. Also every space
is replaced by two characters chr$(194) + chr$(160).
What is going wrong here?


             reply	other threads:[~2009-10-08 23:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-08 23:44 Decebal [this message]
2009-10-09 13:43 ` How to circumvent warning in batch mode Kevin Rodgers
2009-10-09 14:42   ` Andreas Politz
     [not found]   ` <mailman.8415.1255099400.2239.help-gnu-emacs@gnu.org>
2009-10-10  8:23     ` Decebal
     [not found] ` <mailman.8407.1255095844.2239.help-gnu-emacs@gnu.org>
2009-10-10  8:50   ` 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=5ebdc222-a8b5-4eed-9481-39b813da5f1c@j28g2000vbl.googlegroups.com \
    --to=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).