unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to circumvent warning in batch mode
@ 2009-10-08 23:44 Decebal
  2009-10-09 13:43 ` Kevin Rodgers
       [not found] ` <mailman.8407.1255095844.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Decebal @ 2009-10-08 23:44 UTC (permalink / raw)
  To: help-gnu-emacs

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?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-10  8:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-08 23:44 How to circumvent warning in batch mode Decebal
2009-10-09 13:43 ` 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

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