Elisp performance on Windows and Linux

Posted by JasonFruit on Stack Overflow See other posts from Stack Overflow or by JasonFruit
Published on 2008-12-04T15:30:31Z Indexed on 2010/04/27 3:53 UTC
Read the original article Hit count: 530

Filed under:
|
|
|
|

I have the following dead simple elisp functions; the first removes the fill breaks from the current paragraph, and the second loops through the current document applying the first to each paragraph in turn, in effect removing all single line-breaks from the document. It runs fast on my low-spec Puppy Linux box using emacs 22.3 (10 seconds for 600 pages of Thomas Aquinas), but when I go to a powerful Windows XP machine with emacs 21.3, it takes almost an hour to do the same document. What can I do to make it run as well on the Windows machine with emacs 21.3?

(defun remove-line-breaks () 
  "Remove line endings in a paragraph."
  (interactive) 
  (let ((fill-column 90002000)) 
    (fill-paragraph nil)))

:

(defun remove-all-line-breaks ()
  "Remove all single line-breaks in a document"
  (interactive)
  (while (not (= (point) (buffer-end 1)))
       (remove-line-breaks)
       (next-line 1)))

Forgive my poor elisp; I'm having great fun learning Lisp and starting to use the power of emacs, but I'm new to it yet.

© Stack Overflow or respective owner

Related posts about emacs

Related posts about elisp