[comp.text.tex] tags-ispell

aglew@crhc.uiuc.edu (Andy Glew) (11/21/90)

Tonight I wanted to ispell all of the files in my MS thesis
(which is spread all over the place in upwards of 60 files).

ispell -l understands \input and \include LaTeX directives,
but GNU EMACS' ispell mode does not, so a lot of misspelled words
cannot be found in the root of the document.

As a quick workaround I wrote the following, which loop
over all the files in your tag table, asking you if you want to
ispell any of them:


  (defun tags-ispell ()
	 (interactive)
	 (tags-search "\\`.")
	 (tags-ispell-prompter)
	 (tags-ispell-continue))
  (defun tags-ispell-continue ()
	 (interactive)
	 (while t
		(tags-loop-continue)
		(tags-ispell-prompter)))
  (defun tags-ispell-prompter () 
	 (if (y-or-n-p (format "ispell this file (%s)? " (file-name-nondirectory (buffer-file-name))))
	     (ispell-buffer)))

  (make-global-binding "\M-ss" 'tags-ispell)
  (make-global-binding "\M-s\M-s" 'tags-ispell-continue)


Use and enjoy.

--
Andy Glew, a-glew@uiuc.edu [get ph nameserver from uxc.cso.uiuc.edu:net/qi]

geoff@ITcorp.com (Geoff Kuenning) (11/22/90)

In article <AGLEW.90Nov21042456@cobra.crhc.uiuc.edu> aglew@crhc.uiuc.edu
(Andy Glew) writes:

> ispell -l understands \input and \include LaTeX directives,
> but GNU EMACS' ispell mode does not, so a lot of misspelled words
> cannot be found in the root of the document.
> 
> As a quick workaround I wrote the following...

Emacs seem to suffer from a syndrome which causes them to try to do
everything from inside emacs, even when that is highly inappropriate.  As
an alternative, I suggest:

	^Z
	% ispell root.tex
	% fg

	Geoff Kuenning	geoff@la.locus.com	geoff@ITcorp.com

moss@cs.umass.edu (Eliot Moss) (11/24/90)

I take Geoff's point, and it may not be reasonable to try to do *everything*
from inside Emacs, but once you're used to doing spelling correction with the
Emacs interface, why should you have to learn a different interface when you
want to correct a batch of related files? Besides, there are so many people
who want to do everything in Emacs, there's little point to posting news items
against it :-) ....						Eliot
--

		J. Eliot B. Moss, Assistant Professor
		Department of Computer and Information Science
		Lederle Graduate Research Center
		University of Massachusetts
		Amherst, MA  01003
		(413) 545-4206; Moss@cs.umass.edu

aglew@crhc.uiuc.edu (Andy Glew) (11/27/90)

    > ispell -l understands \input and \include LaTeX directives,
    > but GNU EMACS' ispell mode does not, so a lot of misspelled words
    > cannot be found in the root of the document.
    > 
    > As a quick workaround I wrote the following...

    Emacs [users] seem to suffer from a syndrome which causes them to try to do
    everything from inside emacs, even when that is highly inappropriate.  As
    an alternative, I suggest:

	    ^Z
	    % ispell root.tex
	    % fg

Well, let's see, I just tried the suggestion.

First, I had to open a regular xterm window.  Normally I do not have
shell windows.

Then, ispell choked because my root file was read-only.  My GNU EMACS
environment automatically asks me if I want to RCS check out a file
when I attempt to modify it and it is non-writable.  With plain ispell
I had to remember how to check out (well, okay, I remembered it) and I
had to type in the command.

Then, ispell gave me maybe two lines of context before querying for
every change.  GNU EMACS' ispell gives me a wondow full of context.

Then, I had to open another window with the ispell man page in it to
figure out what the commands were.  GNU EMACS' help functions give me
that for free.



Yes - running ispell plain would have been fine if I were already an
experienced ispell user.  I am not - this was the first time I used
ispell.  GNU EMACS let me run ispell with an interface I was already
familiar with, with more information than is normally available from
ispell.  GNU EMACS is the beginnings of an integrated software
development environment, with editor and tools.

--
Andy Glew, a-glew@uiuc.edu [get ph nameserver from uxc.cso.uiuc.edu:net/qi]

marcel@cs.caltech.edu (Marcel van der Goot) (11/27/90)

In <AGLEW.90Nov26153931@cobra.crhc.uiuc.edu> Andy Glew (aglew@crhc.uiuc.edu)
writes:

> My GNU EMACS environment automatically asks me [...]
> [...]
> GNU EMACS let me run ispell with an interface I was already
> familiar with, with more information than is normally available from
> ispell.  GNU EMACS is the beginnings of an integrated software
> development environment, with editor and tools.

I see that your GNU EMACS environment also automatically duplicates
your postings :-)

	1c1
	< Article 4075 of comp.text.tex:
	---
	> Article 4076 of comp.text.tex:
	6,7c6,7
	< Message-ID: <AGLEW.90Nov26153931@cobra.crhc.uiuc.edu>
	< Date: 26 Nov 90 23:39:31 GMT
	---
	> Message-ID: <AGLEW.90Nov26154558@cobra.crhc.uiuc.edu>
	> Date: 26 Nov 90 23:45:58 GMT

Incidentally, I think it's not too useful for a program like ispell
to recognize \include. Usually, the included files are just macro
definitions. In those cases where a text is so long as to be split over
several files, you generally want to check each file separately as you
write or change it. And almost any shell allows you to use wild-cards
if you really want to check everything.

I generally use
	striptex filename | spell
No attempts to write a file, no checking in or checking out, no
contexts, no queries, no obscure commands (striptex removes words
starting with a backslash).

					Marcel van der Goot
					marcel@vlsi.cs.caltech.edu

aglew@crhc.uiuc.edu (Andy Glew) (11/27/90)

    I see that your GNU EMACS environment also automatically duplicates
    your postings :-)

	    1c1
	    < Article 4075 of comp.text.tex:
	    ---
	    > Article 4076 of comp.text.tex:
	    6,7c6,7
	    < Message-ID: <AGLEW.90Nov26153931@cobra.crhc.uiuc.edu>
	    < Date: 26 Nov 90 23:39:31 GMT
	    ---
	    > Message-ID: <AGLEW.90Nov26154558@cobra.crhc.uiuc.edu>
	    > Date: 26 Nov 90 23:45:58 GMT

No, that's NNTP getting so slow that I try again...
--
Andy Glew, a-glew@uiuc.edu [get ph nameserver from uxc.cso.uiuc.edu:net/qi]

moss@cs.umass.edu (Eliot Moss) (11/28/90)

>>>>> On 27 Nov 90 00:04:35 GMT, marcel@cs.caltech.edu (Marcel van der Goot) said:

Marcel> Incidentally, I think it's not too useful for a program like ispell
Marcel> to recognize \include. Usually, the included files are just macro
Marcel> definitions.

I don't think so; perhaps you're thinking of \input? The \include feature
would appear to be used primarily for sectioning a large document, and using a
"main" file to set up all the necessary macros, etc. \include also allows for
specific sections to be selected dynamically via \includeonly.

Marcel> In those cases where a text is so long as to be split over several
Marcel> files, you generally want to check each file separately as you write
Marcel> or change it. And almost any shell allows you to use wild-cards if you
Marcel> really want to check everything.

But checking the files one at a time is exactly what tags-ispell will do for
you! And you get to choose which files you want to check as you go.

Marcel> I generally use
Marcel> 	striptex filename | spell
Marcel> No attempts to write a file, no checking in or checking out, no
Marcel> contexts, no queries, no obscure commands (striptex removes words
Marcel> starting with a backslash).

There is a program, detex, that we use (and comes recommended for this
purpose) as a filter in front of ispell when spell checking files from within
Emacs. You seem to think that somehow the Emacs interface is lower
functionality, but it's not -- it's higher functionality. Sure, you can
probably write shell scripts and stuff that offer the same features, but why
do it, especially when you have to learn an interface different from the one
you use to spell check single files in Emacs?
--

		J. Eliot B. Moss, Assistant Professor
		Department of Computer and Information Science
		Lederle Graduate Research Center
		University of Massachusetts
		Amherst, MA  01003
		(413) 545-4206; Moss@cs.umass.edu