home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.lucid-emacs.help
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!chemabs!zfs60
- From: zfs60@cas.org (Zhiyong John Shen)
- Subject: ispell dies when line is too long
- In-Reply-To: zfs60@cas.org's message of Tue, 17 Nov 1992 23:32:53 GMT
- Message-ID: <ZFS60.92Nov18085025@zfs60mws.cas.org>
- Sender: usenet@cas.org
- Organization: Chemical Abstracts Service, Columbus, Ohio
- References: <1992Nov17.222650.22439@ntmtv> <ZFS60.92Nov17183253@zfs60mws.cas.org>
- Date: Wed, 18 Nov 1992 13:50:25 GMT
- Lines: 39
-
- since several other readers of the group asked me to post things if i
- find a cure, i will put my temporary and partial workaround here, in
- the hope that a better solution will be found by a better elisper.
-
- here it is, it simply splits the line (and insert a backslash to mark
- it), i did not bother to reconnect the split lines after ispell-buffer
- because my application does not need reconnection, but it should be
- fairly easy to do so.
-
- it seems to work for me, but any criticism and/or improvement would be
- greatly appreciate, as i am not very good at making lisp codes tight
- or efficient.
-
- ;;;
- ;;; written by zhiyong "john" shen, but all gnu claims apply
- ;;;
- (defun text-split-line ()
- "Split long text lines to make ispell happy."
- (goto-char (point-min))
- (while (not (eobp))
- (beginning-of-line)
- (if (eolp) (forward-line 1))
- (setq counter 0)
- (while (not (eolp))
- (forward-char 1)
- (if (eolp) (progn (forward-line 1) (setq counter 0)))
- (setq counter (1+ counter))
- (if (> counter 250)
- (progn (backward-word 1)
- (insert-string "\\\012")
- (forward-line 1) (beginning-of-line)
- (setq counter 0))))
- (end-of-line)))
-
- (defun text-ispell-buffer ()
- "ispell the text buffer."
- (interactive)
- (text-split-line)
- (ispell-buffer))
-