[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to circumvent warning in batch mode
From: |
Decebal |
Subject: |
How to circumvent warning in batch mode |
Date: |
Thu, 8 Oct 2009 16:44:43 -0700 (PDT) |
User-agent: |
G2/1.0 |
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?
- How to circumvent warning in batch mode,
Decebal <=
- Message not available